From c37d769384c7dac0d205d1b1f9c53889f2a9f7e6 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 30 Jan 2026 15:59:12 -0800 Subject: [PATCH 01/22] First --- sdk/ai/azure-ai-projects/.env.template | 10 ++++++---- sdk/ai/azure-ai-projects/_tsp-location.yaml | 4 ---- sdk/ai/azure-ai-projects/post-emitter-fixes.cmd | 2 +- sdk/ai/azure-ai-projects/tsp-location.yaml | 4 ++++ 4 files changed, 11 insertions(+), 9 deletions(-) delete mode 100644 sdk/ai/azure-ai-projects/_tsp-location.yaml create mode 100644 sdk/ai/azure-ai-projects/tsp-location.yaml diff --git a/sdk/ai/azure-ai-projects/.env.template b/sdk/ai/azure-ai-projects/.env.template index 023b15d3bb74..69f47413f7e5 100644 --- a/sdk/ai/azure-ai-projects/.env.template +++ b/sdk/ai/azure-ai-projects/.env.template @@ -9,10 +9,15 @@ # 3. Run the tests (`pytest`) or run samples in the `samples` folder # +# Set to true for console logging +AZURE_AI_PROJECTS_CONSOLE_LOGGING= + ####################################################################### # # Used in samples # +####################################################################### + # Project endpoint has the format: # `https://.services.ai.azure.com/api/projects/` AZURE_AI_PROJECT_ENDPOINT= @@ -23,12 +28,8 @@ CONNECTION_NAME= AZURE_AI_PROJECTS_AZURE_SUBSCRIPTION_ID= AZURE_AI_PROJECTS_AZURE_RESOURCE_GROUP= AZURE_AI_PROJECTS_AZURE_AOAI_ACCOUNT= - -# Used in Memory Store samples MEMORY_STORE_CHAT_MODEL_DEPLOYMENT_NAME= MEMORY_STORE_EMBEDDING_MODEL_DEPLOYMENT_NAME= - -# Used in Agent tools samples IMAGE_GENERATION_MODEL_DEPLOYMENT_NAME= BING_PROJECT_CONNECTION_ID= MCP_PROJECT_CONNECTION_ID= @@ -50,6 +51,7 @@ A2A_USER_INPUT= ####################################################################### # # Used in tests +# ####################################################################### # Used for recording or playback 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 00631b52071a..000000000000 --- a/sdk/ai/azure-ai-projects/_tsp-location.yaml +++ /dev/null @@ -1,4 +0,0 @@ -directory: specification/ai/Foundry -commit: 51415f0131fc0e65f88e8a75b4b729a528e8e959 -repo: Azure/azure-rest-api-specs -additionalDirectories: diff --git a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd index 6826a3a15591..a347fd395fe5 100644 --- a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd +++ b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd @@ -1,7 +1,7 @@ REM REM To emit from TypeSpec, run this in the current folder: REM -REM tsp-client update --debug --local-spec-repo e:\src\azure-rest-api-specs-pr\specification\ai\Azure.AI.Projects +REM tsp-client update --debug --local-spec-repo e:\src\azure-rest-api-specs\specification\ai-foundry\data-plane\Foundry REM REM (replace `e:\src\...` with the local folder containing up to date TypeSpec) REM 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..9f9400d68c59 --- /dev/null +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/ai-foundry/data-plane/Foundry +commit: ac1aa168fb5e530b01ef31c525dcb0848aeb6fbc +repo: Azure/azure-rest-api-specs +additionalDirectories: From 108bdd1b2f2b1e8de354f7f7beb44532e3f95d2c Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 30 Jan 2026 16:50:33 -0800 Subject: [PATCH 02/22] Re-emit. Apply some post-emitter-fixes --- sdk/ai/azure-ai-projects/_metadata.json | 2 +- .../azure-ai-projects/apiview-properties.json | 155 +- .../azure/ai/projects/_client.py | 39 +- .../azure/ai/projects/_configuration.py | 15 +- .../azure/ai/projects/_utils/model_base.py | 2 +- .../azure/ai/projects/aio/_client.py | 39 +- .../azure/ai/projects/aio/_configuration.py | 15 +- .../ai/projects/aio/operations/__init__.py | 16 +- .../ai/projects/aio/operations/_operations.py | 5659 ++++++++------- .../azure/ai/projects/models/__init__.py | 70 +- .../azure/ai/projects/models/_enums.py | 317 +- .../azure/ai/projects/models/_models.py | 2395 ++++--- .../azure/ai/projects/operations/__init__.py | 16 +- .../ai/projects/operations/_operations.py | 6381 ++++++++++------- .../azure-ai-projects/post-emitter-fixes.cmd | 9 +- sdk/ai/azure-ai-projects/pyproject.toml | 2 +- .../memories/sample_memory_advanced.py | 8 +- .../memories/sample_memory_advanced_async.py | 8 +- .../samples/memories/sample_memory_basic.py | 4 +- .../memories/sample_memory_basic_async.py | 4 +- 20 files changed, 8759 insertions(+), 6397 deletions(-) diff --git a/sdk/ai/azure-ai-projects/_metadata.json b/sdk/ai/azure-ai-projects/_metadata.json index 509044270b48..539264d9b9bb 100644 --- a/sdk/ai/azure-ai-projects/_metadata.json +++ b/sdk/ai/azure-ai-projects/_metadata.json @@ -1,3 +1,3 @@ { - "apiVersion": "2025-11-15-preview" + "apiVersion": "v1" } \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index bfc2a677bb06..bd38ab31572c 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -3,17 +3,17 @@ "CrossLanguageDefinitionId": { "azure.ai.projects.models.Tool": "OpenAI.Tool", "azure.ai.projects.models.A2APreviewTool": "Azure.AI.Projects.A2APreviewTool", + "azure.ai.projects.models.InsightRequest": "Azure.AI.Projects.InsightRequest", + "azure.ai.projects.models.AgentClusterInsightRequest": "Azure.AI.Projects.AgentClusterInsightRequest", "azure.ai.projects.models.InsightResult": "Azure.AI.Projects.InsightResult", "azure.ai.projects.models.AgentClusterInsightResult": "Azure.AI.Projects.AgentClusterInsightResult", - "azure.ai.projects.models.InsightRequest": "Azure.AI.Projects.InsightRequest", - "azure.ai.projects.models.AgentClusterInsightsRequest": "Azure.AI.Projects.AgentClusterInsightsRequest", "azure.ai.projects.models.AgentDefinition": "Azure.AI.Projects.AgentDefinition", "azure.ai.projects.models.AgentDetails": "Azure.AI.Projects.AgentObject", "azure.ai.projects.models.BaseCredentials": "Azure.AI.Projects.BaseCredentials", - "azure.ai.projects.models.AgenticIdentityCredentials": "Azure.AI.Projects.AgenticIdentityCredentials", - "azure.ai.projects.models.AgentId": "Azure.AI.Projects.AgentId", + "azure.ai.projects.models.AgenticIdentityPreviewCredentials": "Azure.AI.Projects.AgenticIdentityPreviewCredentials", "azure.ai.projects.models.AgentObjectVersions": "Azure.AI.Projects.AgentObject.versions.anonymous", "azure.ai.projects.models.AgentReference": "Azure.AI.Projects.AgentReference", + "azure.ai.projects.models.AgentsPagedResultAgentObject": "Azure.AI.Projects.AgentsPagedResult", "azure.ai.projects.models.EvaluationTaxonomyInput": "Azure.AI.Projects.EvaluationTaxonomyInput", "azure.ai.projects.models.AgentTaxonomyInput": "Azure.AI.Projects.AgentTaxonomyInput", "azure.ai.projects.models.AgentVersionDetails": "Azure.AI.Projects.AgentVersionObject", @@ -33,6 +33,7 @@ "azure.ai.projects.models.ApproximateLocation": "OpenAI.ApproximateLocation", "azure.ai.projects.models.Target": "Azure.AI.Projects.Target", "azure.ai.projects.models.AzureAIAgentTarget": "Azure.AI.Projects.AzureAIAgentTarget", + "azure.ai.projects.models.AzureAIModelTarget": "Azure.AI.Projects.AzureAIModelTarget", "azure.ai.projects.models.Index": "Azure.AI.Projects.Index", "azure.ai.projects.models.AzureAISearchIndex": "Azure.AI.Projects.AzureAISearchIndex", "azure.ai.projects.models.AzureAISearchTool": "Azure.AI.Projects.AzureAISearchTool", @@ -80,7 +81,6 @@ "azure.ai.projects.models.EvaluationRuleAction": "Azure.AI.Projects.EvaluationRuleAction", "azure.ai.projects.models.ContinuousEvaluationRuleAction": "Azure.AI.Projects.ContinuousEvaluationRuleAction", "azure.ai.projects.models.CosmosDBIndex": "Azure.AI.Projects.CosmosDBIndex", - "azure.ai.projects.models.CreatedBy": "Azure.AI.Projects.CreatedBy", "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", @@ -104,18 +104,18 @@ "azure.ai.projects.models.EmbeddingConfiguration": "Azure.AI.Projects.EmbeddingConfiguration", "azure.ai.projects.models.EntraIDCredentials": "Azure.AI.Projects.EntraIDCredentials", "azure.ai.projects.models.Error": "OpenAI.Error", - "azure.ai.projects.models.EvalCompareReport": "Azure.AI.Projects.EvalCompareReport", "azure.ai.projects.models.EvalResult": "Azure.AI.Projects.EvalResult", "azure.ai.projects.models.EvalRunResultCompareItem": "Azure.AI.Projects.EvalRunResultCompareItem", "azure.ai.projects.models.EvalRunResultComparison": "Azure.AI.Projects.EvalRunResultComparison", "azure.ai.projects.models.EvalRunResultSummary": "Azure.AI.Projects.EvalRunResultSummary", - "azure.ai.projects.models.EvaluationComparisonRequest": "Azure.AI.Projects.EvaluationComparisonRequest", + "azure.ai.projects.models.EvaluationComparisonInsightRequest": "Azure.AI.Projects.EvaluationComparisonInsightRequest", + "azure.ai.projects.models.EvaluationComparisonInsightResult": "Azure.AI.Projects.EvaluationComparisonInsightResult", "azure.ai.projects.models.InsightSample": "Azure.AI.Projects.InsightSample", "azure.ai.projects.models.EvaluationResultSample": "Azure.AI.Projects.EvaluationResultSample", "azure.ai.projects.models.EvaluationRule": "Azure.AI.Projects.EvaluationRule", "azure.ai.projects.models.EvaluationRuleFilter": "Azure.AI.Projects.EvaluationRuleFilter", + "azure.ai.projects.models.EvaluationRunClusterInsightRequest": "Azure.AI.Projects.EvaluationRunClusterInsightRequest", "azure.ai.projects.models.EvaluationRunClusterInsightResult": "Azure.AI.Projects.EvaluationRunClusterInsightResult", - "azure.ai.projects.models.EvaluationRunClusterInsightsRequest": "Azure.AI.Projects.EvaluationRunClusterInsightsRequest", "azure.ai.projects.models.ScheduleTask": "Azure.AI.Projects.ScheduleTask", "azure.ai.projects.models.EvaluationScheduleTask": "Azure.AI.Projects.EvaluationScheduleTask", "azure.ai.projects.models.EvaluationTaxonomy": "Azure.AI.Projects.EvaluationTaxonomy", @@ -149,7 +149,6 @@ "azure.ai.projects.models.HourlyRecurrenceSchedule": "Azure.AI.Projects.HourlyRecurrenceSchedule", "azure.ai.projects.models.HumanEvaluationRuleAction": "Azure.AI.Projects.HumanEvaluationRuleAction", "azure.ai.projects.models.HybridSearchOptions": "OpenAI.HybridSearchOptions", - "azure.ai.projects.models.ImageBasedHostedAgentDefinition": "Azure.AI.Projects.ImageBasedHostedAgentDefinition", "azure.ai.projects.models.ImageGenTool": "OpenAI.ImageGenTool", "azure.ai.projects.models.ImageGenToolInputImageMask": "OpenAI.ImageGenToolInputImageMask", "azure.ai.projects.models.InputContent": "OpenAI.InputContent", @@ -238,6 +237,7 @@ "azure.ai.projects.models.MicrosoftFabricPreviewTool": "Azure.AI.Projects.MicrosoftFabricPreviewTool", "azure.ai.projects.models.ModelDeployment": "Azure.AI.Projects.ModelDeployment", "azure.ai.projects.models.ModelDeploymentSku": "Azure.AI.Projects.Sku", + "azure.ai.projects.models.ModelSamplingParams": "Azure.AI.Projects.ModelSamplingParams", "azure.ai.projects.models.MonthlyRecurrenceSchedule": "Azure.AI.Projects.MonthlyRecurrenceSchedule", "azure.ai.projects.models.Move": "OpenAI.Move", "azure.ai.projects.models.NoAuthenticationCredentials": "Azure.AI.Projects.NoAuthenticationCredentials", @@ -259,7 +259,7 @@ "azure.ai.projects.models.PendingUploadRequest": "Azure.AI.Projects.PendingUploadRequest", "azure.ai.projects.models.PendingUploadResponse": "Azure.AI.Projects.PendingUploadResponse", "azure.ai.projects.models.PromptAgentDefinition": "Azure.AI.Projects.PromptAgentDefinition", - "azure.ai.projects.models.PromptAgentDefinitionText": "Azure.AI.Projects.PromptAgentDefinition.text.anonymous", + "azure.ai.projects.models.PromptAgentDefinitionTextOptions": "Azure.AI.Projects.PromptAgentDefinitionTextOptions", "azure.ai.projects.models.PromptBasedEvaluatorDefinition": "Azure.AI.Projects.PromptBasedEvaluatorDefinition", "azure.ai.projects.models.ProtocolVersionRecord": "Azure.AI.Projects.ProtocolVersionRecord", "azure.ai.projects.models.RaiConfig": "Azure.AI.Projects.RaiConfig", @@ -277,6 +277,9 @@ "azure.ai.projects.models.Scroll": "OpenAI.Scroll", "azure.ai.projects.models.SharepointGroundingToolParameters": "Azure.AI.Projects.SharepointGroundingToolParameters", "azure.ai.projects.models.SharepointPreviewTool": "Azure.AI.Projects.SharepointPreviewTool", + "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.StructuredInputDefinition": "Azure.AI.Projects.StructuredInputDefinition", "azure.ai.projects.models.StructuredOutputDefinition": "Azure.AI.Projects.StructuredOutputDefinition", "azure.ai.projects.models.StructuredOutputsItemResource": "Azure.AI.Projects.StructuredOutputsItemResource", @@ -287,6 +290,16 @@ "azure.ai.projects.models.TextResponseFormatConfigurationResponseFormatJsonObject": "OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject", "azure.ai.projects.models.TextResponseFormatConfigurationResponseFormatText": "OpenAI.TextResponseFormatConfigurationResponseFormatText", "azure.ai.projects.models.TextResponseFormatJsonSchema": "OpenAI.TextResponseFormatJsonSchema", + "azure.ai.projects.models.ToolChoiceAllowed": "OpenAI.ToolChoiceAllowed", + "azure.ai.projects.models.ToolChoiceCodeInterpreter": "OpenAI.ToolChoiceCodeInterpreter", + "azure.ai.projects.models.ToolChoiceComputerUsePreview": "OpenAI.ToolChoiceComputerUsePreview", + "azure.ai.projects.models.ToolChoiceCustom": "OpenAI.ToolChoiceCustom", + "azure.ai.projects.models.ToolChoiceFileSearch": "OpenAI.ToolChoiceFileSearch", + "azure.ai.projects.models.ToolChoiceFunction": "OpenAI.ToolChoiceFunction", + "azure.ai.projects.models.ToolChoiceImageGeneration": "OpenAI.ToolChoiceImageGeneration", + "azure.ai.projects.models.ToolChoiceMCP": "OpenAI.ToolChoiceMCP", + "azure.ai.projects.models.ToolChoiceWebSearchPreview": "OpenAI.ToolChoiceWebSearchPreview", + "azure.ai.projects.models.ToolChoiceWebSearchPreview20250311": "OpenAI.ToolChoiceWebSearchPreview20250311", "azure.ai.projects.models.ToolDescription": "Azure.AI.Projects.ToolDescription", "azure.ai.projects.models.ToolProjectConnection": "Azure.AI.Projects.ToolProjectConnection", "azure.ai.projects.models.TopLogProb": "OpenAI.TopLogProb", @@ -305,8 +318,8 @@ "azure.ai.projects.models.WebSearchTool": "OpenAI.WebSearchTool", "azure.ai.projects.models.WebSearchToolFilters": "OpenAI.WebSearchToolFilters", "azure.ai.projects.models.WeeklyRecurrenceSchedule": "Azure.AI.Projects.WeeklyRecurrenceSchedule", - "azure.ai.projects.models.WorkflowActionOutputItemResource": "Azure.AI.Projects.WorkflowActionOutputItemResource", "azure.ai.projects.models.WorkflowAgentDefinition": "Azure.AI.Projects.WorkflowAgentDefinition", + "azure.ai.projects.models.WorkflowPreviewActionOutputItemResource": "Azure.AI.Projects.WorkflowPreviewActionOutputItemResource", "azure.ai.projects.models.AgentKind": "Azure.AI.Projects.AgentKind", "azure.ai.projects.models.AgentProtocol": "Azure.AI.Projects.AgentProtocol", "azure.ai.projects.models.ToolType": "OpenAI.ToolType", @@ -319,9 +332,30 @@ "azure.ai.projects.models.InputFidelity": "OpenAI.InputFidelity", "azure.ai.projects.models.OpenApiAuthType": "Azure.AI.Projects.OpenApiAuthType", "azure.ai.projects.models.SearchContextSize": "OpenAI.SearchContextSize", + "azure.ai.projects.models.ToolChoiceParamType": "OpenAI.ToolChoiceParamType", "azure.ai.projects.models.TextResponseFormatConfigurationType": "OpenAI.TextResponseFormatConfigurationType", + "azure.ai.projects.models.FoundryPreviewOptInKeys": "Azure.AI.Projects.FoundryPreviewOptInKeys", "azure.ai.projects.models.PageOrder": "Azure.AI.Projects.PageOrder", "azure.ai.projects.models.ContainerLogKind": "Azure.AI.Projects.ContainerLogKind", + "azure.ai.projects.models.ConnectionType": "Azure.AI.Projects.ConnectionType", + "azure.ai.projects.models.CredentialType": "Azure.AI.Projects.CredentialType", + "azure.ai.projects.models.DatasetType": "Azure.AI.Projects.DatasetType", + "azure.ai.projects.models.PendingUploadType": "Azure.AI.Projects.PendingUploadType", + "azure.ai.projects.models.DeploymentType": "Azure.AI.Projects.DeploymentType", + "azure.ai.projects.models.EvaluationTaxonomyInputType": "Azure.AI.Projects.EvaluationTaxonomyInputType", + "azure.ai.projects.models.RiskCategory": "Azure.AI.Projects.RiskCategory", + "azure.ai.projects.models.EvaluationRuleActionType": "Azure.AI.Projects.EvaluationRuleActionType", + "azure.ai.projects.models.EvaluationRuleEventType": "Azure.AI.Projects.EvaluationRuleEventType", + "azure.ai.projects.models.EvaluatorType": "Azure.AI.Projects.EvaluatorType", + "azure.ai.projects.models.EvaluatorCategory": "Azure.AI.Projects.EvaluatorCategory", + "azure.ai.projects.models.EvaluatorDefinitionType": "Azure.AI.Projects.EvaluatorDefinitionType", + "azure.ai.projects.models.EvaluatorMetricType": "Azure.AI.Projects.EvaluatorMetricType", + "azure.ai.projects.models.EvaluatorMetricDirection": "Azure.AI.Projects.EvaluatorMetricDirection", + "azure.ai.projects.models.IndexType": "Azure.AI.Projects.IndexType", + "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", + "azure.ai.projects.models.TreatmentEffectType": "Azure.AI.Projects.TreatmentEffectType", "azure.ai.projects.models.MemoryStoreKind": "Azure.AI.Projects.MemoryStoreKind", "azure.ai.projects.models.MemoryItemKind": "Azure.AI.Projects.MemoryItemKind", "azure.ai.projects.models.InputItemType": "OpenAI.InputItemType", @@ -342,38 +376,19 @@ "azure.ai.projects.models.FunctionShellCallItemStatus": "OpenAI.FunctionShellCallItemStatus", "azure.ai.projects.models.FunctionShellCallOutputOutcomeParamType": "OpenAI.FunctionShellCallOutputOutcomeParamType", "azure.ai.projects.models.MemoryOperationKind": "Azure.AI.Projects.MemoryOperationKind", - "azure.ai.projects.models.ConnectionType": "Azure.AI.Projects.ConnectionType", - "azure.ai.projects.models.CredentialType": "Azure.AI.Projects.CredentialType", - "azure.ai.projects.models.DatasetType": "Azure.AI.Projects.DatasetType", - "azure.ai.projects.models.PendingUploadType": "Azure.AI.Projects.PendingUploadType", - "azure.ai.projects.models.IndexType": "Azure.AI.Projects.IndexType", - "azure.ai.projects.models.DeploymentType": "Azure.AI.Projects.DeploymentType", "azure.ai.projects.models.AttackStrategy": "Azure.AI.Projects.AttackStrategy", - "azure.ai.projects.models.RiskCategory": "Azure.AI.Projects.RiskCategory", - "azure.ai.projects.models.EvaluationRuleActionType": "Azure.AI.Projects.EvaluationRuleActionType", - "azure.ai.projects.models.EvaluationRuleEventType": "Azure.AI.Projects.EvaluationRuleEventType", - "azure.ai.projects.models.EvaluationTaxonomyInputType": "Azure.AI.Projects.EvaluationTaxonomyInputType", - "azure.ai.projects.models.EvaluatorType": "Azure.AI.Projects.EvaluatorType", - "azure.ai.projects.models.EvaluatorCategory": "Azure.AI.Projects.EvaluatorCategory", - "azure.ai.projects.models.EvaluatorDefinitionType": "Azure.AI.Projects.EvaluatorDefinitionType", - "azure.ai.projects.models.EvaluatorMetricType": "Azure.AI.Projects.EvaluatorMetricType", - "azure.ai.projects.models.EvaluatorMetricDirection": "Azure.AI.Projects.EvaluatorMetricDirection", - "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", - "azure.ai.projects.models.TreatmentEffectType": "Azure.AI.Projects.TreatmentEffectType", "azure.ai.projects.models.ScheduleProvisioningStatus": "Azure.AI.Projects.ScheduleProvisioningStatus", "azure.ai.projects.models.TriggerType": "Azure.AI.Projects.TriggerType", "azure.ai.projects.models.RecurrenceType": "Azure.AI.Projects.RecurrenceType", "azure.ai.projects.models.DayOfWeek": "Azure.AI.Projects.DayOfWeek", "azure.ai.projects.models.ScheduleTaskType": "Azure.AI.Projects.ScheduleTaskType", "azure.ai.projects.models.MemoryStoreUpdateStatus": "Azure.AI.Projects.MemoryStoreUpdateStatus", - "azure.ai.projects.models.FunctionShellCallOutputOutcomeType": "OpenAI.FunctionShellCallOutputOutcomeType", - "azure.ai.projects.models.ApplyPatchFileOperationType": "OpenAI.ApplyPatchFileOperationType", "azure.ai.projects.models.ItemResourceType": "OpenAI.ItemResourceType", "azure.ai.projects.models.ApplyPatchCallStatus": "OpenAI.ApplyPatchCallStatus", + "azure.ai.projects.models.ApplyPatchFileOperationType": "OpenAI.ApplyPatchFileOperationType", "azure.ai.projects.models.ApplyPatchCallOutputStatus": "OpenAI.ApplyPatchCallOutputStatus", "azure.ai.projects.models.LocalShellCallStatus": "OpenAI.LocalShellCallStatus", + "azure.ai.projects.models.FunctionShellCallOutputOutcomeType": "OpenAI.FunctionShellCallOutputOutcomeType", "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.create": "Azure.AI.Projects.Agents.createAgent", @@ -400,20 +415,6 @@ "azure.ai.projects.aio.operations.AgentsOperations.list_versions": "Azure.AI.Projects.Agents.listAgentVersions", "azure.ai.projects.operations.AgentsOperations.stream_agent_container_logs": "Azure.AI.Projects.Agents.streamAgentContainerLogs", "azure.ai.projects.aio.operations.AgentsOperations.stream_agent_container_logs": "Azure.AI.Projects.Agents.streamAgentContainerLogs", - "azure.ai.projects.operations.MemoryStoresOperations.create": "Azure.AI.Projects.MemoryStores.createMemoryStore", - "azure.ai.projects.aio.operations.MemoryStoresOperations.create": "Azure.AI.Projects.MemoryStores.createMemoryStore", - "azure.ai.projects.operations.MemoryStoresOperations.update": "Azure.AI.Projects.MemoryStores.updateMemoryStore", - "azure.ai.projects.aio.operations.MemoryStoresOperations.update": "Azure.AI.Projects.MemoryStores.updateMemoryStore", - "azure.ai.projects.operations.MemoryStoresOperations.get": "Azure.AI.Projects.MemoryStores.getMemoryStore", - "azure.ai.projects.aio.operations.MemoryStoresOperations.get": "Azure.AI.Projects.MemoryStores.getMemoryStore", - "azure.ai.projects.operations.MemoryStoresOperations.list": "Azure.AI.Projects.MemoryStores.listMemoryStores", - "azure.ai.projects.aio.operations.MemoryStoresOperations.list": "Azure.AI.Projects.MemoryStores.listMemoryStores", - "azure.ai.projects.operations.MemoryStoresOperations.delete": "Azure.AI.Projects.MemoryStores.deleteMemoryStore", - "azure.ai.projects.aio.operations.MemoryStoresOperations.delete": "Azure.AI.Projects.MemoryStores.deleteMemoryStore", - "azure.ai.projects.operations.MemoryStoresOperations.search_memories": "Azure.AI.Projects.MemoryStores.searchMemories", - "azure.ai.projects.aio.operations.MemoryStoresOperations.search_memories": "Azure.AI.Projects.MemoryStores.searchMemories", - "azure.ai.projects.operations.MemoryStoresOperations.delete_scope": "Azure.AI.Projects.MemoryStores.deleteScope", - "azure.ai.projects.aio.operations.MemoryStoresOperations.delete_scope": "Azure.AI.Projects.MemoryStores.deleteScope", "azure.ai.projects.operations.ConnectionsOperations.list": "Azure.AI.Projects.Connections.list", "azure.ai.projects.aio.operations.ConnectionsOperations.list": "Azure.AI.Projects.Connections.list", "azure.ai.projects.operations.DatasetsOperations.list_versions": "Azure.AI.Projects.Datasets.listVersions", @@ -430,34 +431,10 @@ "azure.ai.projects.aio.operations.DatasetsOperations.pending_upload": "Azure.AI.Projects.Datasets.startPendingUploadVersion", "azure.ai.projects.operations.DatasetsOperations.get_credentials": "Azure.AI.Projects.Datasets.getCredentials", "azure.ai.projects.aio.operations.DatasetsOperations.get_credentials": "Azure.AI.Projects.Datasets.getCredentials", - "azure.ai.projects.operations.IndexesOperations.list_versions": "Azure.AI.Projects.Indexes.listVersions", - "azure.ai.projects.aio.operations.IndexesOperations.list_versions": "Azure.AI.Projects.Indexes.listVersions", - "azure.ai.projects.operations.IndexesOperations.list": "Azure.AI.Projects.Indexes.listLatest", - "azure.ai.projects.aio.operations.IndexesOperations.list": "Azure.AI.Projects.Indexes.listLatest", - "azure.ai.projects.operations.IndexesOperations.get": "Azure.AI.Projects.Indexes.getVersion", - "azure.ai.projects.aio.operations.IndexesOperations.get": "Azure.AI.Projects.Indexes.getVersion", - "azure.ai.projects.operations.IndexesOperations.delete": "Azure.AI.Projects.Indexes.deleteVersion", - "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.DeploymentsOperations.get": "Azure.AI.Projects.Deployments.get", "azure.ai.projects.aio.operations.DeploymentsOperations.get": "Azure.AI.Projects.Deployments.get", "azure.ai.projects.operations.DeploymentsOperations.list": "Azure.AI.Projects.Deployments.list", "azure.ai.projects.aio.operations.DeploymentsOperations.list": "Azure.AI.Projects.Deployments.list", - "azure.ai.projects.operations.RedTeamsOperations.get": "Azure.AI.Projects.RedTeams.get", - "azure.ai.projects.aio.operations.RedTeamsOperations.get": "Azure.AI.Projects.RedTeams.get", - "azure.ai.projects.operations.RedTeamsOperations.list": "Azure.AI.Projects.RedTeams.list", - "azure.ai.projects.aio.operations.RedTeamsOperations.list": "Azure.AI.Projects.RedTeams.list", - "azure.ai.projects.operations.RedTeamsOperations.create": "Azure.AI.Projects.RedTeams.create", - "azure.ai.projects.aio.operations.RedTeamsOperations.create": "Azure.AI.Projects.RedTeams.create", - "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", - "azure.ai.projects.aio.operations.EvaluationRulesOperations.delete": "Azure.AI.Projects.EvaluationRules.delete", - "azure.ai.projects.operations.EvaluationRulesOperations.create_or_update": "Azure.AI.Projects.EvaluationRules.createOrUpdate", - "azure.ai.projects.aio.operations.EvaluationRulesOperations.create_or_update": "Azure.AI.Projects.EvaluationRules.createOrUpdate", - "azure.ai.projects.operations.EvaluationRulesOperations.list": "Azure.AI.Projects.EvaluationRules.list", - "azure.ai.projects.aio.operations.EvaluationRulesOperations.list": "Azure.AI.Projects.EvaluationRules.list", "azure.ai.projects.operations.EvaluationTaxonomiesOperations.get": "Azure.AI.Projects.EvaluationTaxonomies.get", "azure.ai.projects.aio.operations.EvaluationTaxonomiesOperations.get": "Azure.AI.Projects.EvaluationTaxonomies.get", "azure.ai.projects.operations.EvaluationTaxonomiesOperations.list": "Azure.AI.Projects.EvaluationTaxonomies.list", @@ -468,6 +445,14 @@ "azure.ai.projects.aio.operations.EvaluationTaxonomiesOperations.create": "Azure.AI.Projects.EvaluationTaxonomies.create", "azure.ai.projects.operations.EvaluationTaxonomiesOperations.update": "Azure.AI.Projects.EvaluationTaxonomies.update", "azure.ai.projects.aio.operations.EvaluationTaxonomiesOperations.update": "Azure.AI.Projects.EvaluationTaxonomies.update", + "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", + "azure.ai.projects.aio.operations.EvaluationRulesOperations.delete": "Azure.AI.Projects.EvaluationRules.delete", + "azure.ai.projects.operations.EvaluationRulesOperations.create_or_update": "Azure.AI.Projects.EvaluationRules.createOrUpdate", + "azure.ai.projects.aio.operations.EvaluationRulesOperations.create_or_update": "Azure.AI.Projects.EvaluationRules.createOrUpdate", + "azure.ai.projects.operations.EvaluationRulesOperations.list": "Azure.AI.Projects.EvaluationRules.list", + "azure.ai.projects.aio.operations.EvaluationRulesOperations.list": "Azure.AI.Projects.EvaluationRules.list", "azure.ai.projects.operations.EvaluatorsOperations.list_versions": "Azure.AI.Projects.Evaluators.listVersions", "azure.ai.projects.aio.operations.EvaluatorsOperations.list_versions": "Azure.AI.Projects.Evaluators.listVersions", "azure.ai.projects.operations.EvaluatorsOperations.list_latest_versions": "Azure.AI.Projects.Evaluators.listLatestVersions", @@ -480,12 +465,42 @@ "azure.ai.projects.aio.operations.EvaluatorsOperations.create_version": "Azure.AI.Projects.Evaluators.createVersion", "azure.ai.projects.operations.EvaluatorsOperations.update_version": "Azure.AI.Projects.Evaluators.updateVersion", "azure.ai.projects.aio.operations.EvaluatorsOperations.update_version": "Azure.AI.Projects.Evaluators.updateVersion", + "azure.ai.projects.operations.IndexesOperations.list_versions": "Azure.AI.Projects.Indexes.listVersions", + "azure.ai.projects.aio.operations.IndexesOperations.list_versions": "Azure.AI.Projects.Indexes.listVersions", + "azure.ai.projects.operations.IndexesOperations.list": "Azure.AI.Projects.Indexes.listLatest", + "azure.ai.projects.aio.operations.IndexesOperations.list": "Azure.AI.Projects.Indexes.listLatest", + "azure.ai.projects.operations.IndexesOperations.get": "Azure.AI.Projects.Indexes.getVersion", + "azure.ai.projects.aio.operations.IndexesOperations.get": "Azure.AI.Projects.Indexes.getVersion", + "azure.ai.projects.operations.IndexesOperations.delete": "Azure.AI.Projects.Indexes.deleteVersion", + "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.InsightsOperations.generate": "Azure.AI.Projects.Insights.generate", "azure.ai.projects.aio.operations.InsightsOperations.generate": "Azure.AI.Projects.Insights.generate", "azure.ai.projects.operations.InsightsOperations.get": "Azure.AI.Projects.Insights.get", "azure.ai.projects.aio.operations.InsightsOperations.get": "Azure.AI.Projects.Insights.get", "azure.ai.projects.operations.InsightsOperations.list": "Azure.AI.Projects.Insights.list", "azure.ai.projects.aio.operations.InsightsOperations.list": "Azure.AI.Projects.Insights.list", + "azure.ai.projects.operations.MemoryStoresOperations.create": "Azure.AI.Projects.MemoryStores.createMemoryStore", + "azure.ai.projects.aio.operations.MemoryStoresOperations.create": "Azure.AI.Projects.MemoryStores.createMemoryStore", + "azure.ai.projects.operations.MemoryStoresOperations.update": "Azure.AI.Projects.MemoryStores.updateMemoryStore", + "azure.ai.projects.aio.operations.MemoryStoresOperations.update": "Azure.AI.Projects.MemoryStores.updateMemoryStore", + "azure.ai.projects.operations.MemoryStoresOperations.get": "Azure.AI.Projects.MemoryStores.getMemoryStore", + "azure.ai.projects.aio.operations.MemoryStoresOperations.get": "Azure.AI.Projects.MemoryStores.getMemoryStore", + "azure.ai.projects.operations.MemoryStoresOperations.list": "Azure.AI.Projects.MemoryStores.listMemoryStores", + "azure.ai.projects.aio.operations.MemoryStoresOperations.list": "Azure.AI.Projects.MemoryStores.listMemoryStores", + "azure.ai.projects.operations.MemoryStoresOperations.delete": "Azure.AI.Projects.MemoryStores.deleteMemoryStore", + "azure.ai.projects.aio.operations.MemoryStoresOperations.delete": "Azure.AI.Projects.MemoryStores.deleteMemoryStore", + "azure.ai.projects.operations.MemoryStoresOperations.search_memories": "Azure.AI.Projects.MemoryStores.searchMemories", + "azure.ai.projects.aio.operations.MemoryStoresOperations.search_memories": "Azure.AI.Projects.MemoryStores.searchMemories", + "azure.ai.projects.operations.MemoryStoresOperations.delete_scope": "Azure.AI.Projects.MemoryStores.deleteScope", + "azure.ai.projects.aio.operations.MemoryStoresOperations.delete_scope": "Azure.AI.Projects.MemoryStores.deleteScope", + "azure.ai.projects.operations.RedTeamsOperations.get": "Azure.AI.Projects.RedTeams.get", + "azure.ai.projects.aio.operations.RedTeamsOperations.get": "Azure.AI.Projects.RedTeams.get", + "azure.ai.projects.operations.RedTeamsOperations.list": "Azure.AI.Projects.RedTeams.list", + "azure.ai.projects.aio.operations.RedTeamsOperations.list": "Azure.AI.Projects.RedTeams.list", + "azure.ai.projects.operations.RedTeamsOperations.create": "Azure.AI.Projects.RedTeams.create", + "azure.ai.projects.aio.operations.RedTeamsOperations.create": "Azure.AI.Projects.RedTeams.create", "azure.ai.projects.operations.SchedulesOperations.delete": "Azure.AI.Projects.Schedules.delete", "azure.ai.projects.aio.operations.SchedulesOperations.delete": "Azure.AI.Projects.Schedules.delete", "azure.ai.projects.operations.SchedulesOperations.get": "Azure.AI.Projects.Schedules.get", 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 65df15b7b235..db8115d758a2 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_client.py @@ -40,39 +40,38 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes :ivar agents: AgentsOperations operations :vartype agents: azure.ai.projects.operations.AgentsOperations - :ivar memory_stores: MemoryStoresOperations operations - :vartype memory_stores: azure.ai.projects.operations.MemoryStoresOperations :ivar connections: ConnectionsOperations operations :vartype connections: azure.ai.projects.operations.ConnectionsOperations :ivar datasets: DatasetsOperations operations :vartype datasets: azure.ai.projects.operations.DatasetsOperations - :ivar indexes: IndexesOperations operations - :vartype indexes: azure.ai.projects.operations.IndexesOperations :ivar deployments: DeploymentsOperations operations :vartype deployments: azure.ai.projects.operations.DeploymentsOperations - :ivar red_teams: RedTeamsOperations operations - :vartype red_teams: azure.ai.projects.operations.RedTeamsOperations - :ivar evaluation_rules: EvaluationRulesOperations operations - :vartype evaluation_rules: azure.ai.projects.operations.EvaluationRulesOperations :ivar evaluation_taxonomies: EvaluationTaxonomiesOperations operations :vartype evaluation_taxonomies: azure.ai.projects.operations.EvaluationTaxonomiesOperations + :ivar evaluation_rules: EvaluationRulesOperations operations + :vartype evaluation_rules: azure.ai.projects.operations.EvaluationRulesOperations :ivar evaluators: EvaluatorsOperations operations :vartype evaluators: azure.ai.projects.operations.EvaluatorsOperations + :ivar indexes: IndexesOperations operations + :vartype indexes: azure.ai.projects.operations.IndexesOperations :ivar insights: InsightsOperations operations :vartype insights: azure.ai.projects.operations.InsightsOperations + :ivar memory_stores: MemoryStoresOperations operations + :vartype memory_stores: azure.ai.projects.operations.MemoryStoresOperations + :ivar red_teams: RedTeamsOperations operations + :vartype red_teams: azure.ai.projects.operations.RedTeamsOperations :ivar schedules: SchedulesOperations operations :vartype schedules: azure.ai.projects.operations.SchedulesOperations :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. + "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. Default value is - "2025-11-15-preview". Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Default value is "v1". Note + that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -103,20 +102,20 @@ def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) self._deserialize = Deserializer() self._serialize.client_side_validation = False self.agents = AgentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.memory_stores = MemoryStoresOperations(self._client, self._config, self._serialize, self._deserialize) self.connections = ConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) self.datasets = DatasetsOperations(self._client, self._config, self._serialize, self._deserialize) - self.indexes = IndexesOperations(self._client, self._config, self._serialize, self._deserialize) self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.red_teams = RedTeamsOperations(self._client, self._config, self._serialize, self._deserialize) - self.evaluation_rules = EvaluationRulesOperations( + self.evaluation_taxonomies = EvaluationTaxonomiesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.evaluation_taxonomies = EvaluationTaxonomiesOperations( + self.evaluation_rules = EvaluationRulesOperations( self._client, self._config, self._serialize, self._deserialize ) self.evaluators = EvaluatorsOperations(self._client, self._config, self._serialize, self._deserialize) + self.indexes = IndexesOperations(self._client, self._config, self._serialize, self._deserialize) self.insights = InsightsOperations(self._client, self._config, self._serialize, self._deserialize) + self.memory_stores = MemoryStoresOperations(self._client, self._config, self._serialize, self._deserialize) + self.red_teams = RedTeamsOperations(self._client, self._config, self._serialize, self._deserialize) self.schedules = SchedulesOperations(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/_configuration.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_configuration.py index ad3f889051fe..5607f6b685fd 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_configuration.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_configuration.py @@ -23,21 +23,20 @@ class AIProjectClientConfiguration: # pylint: disable=too-many-instance-attribu 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. + "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. Default value is - "2025-11-15-preview". Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Default value is "v1". 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", "2025-11-15-preview") + api_version: str = kwargs.pop("api_version", "v1") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") 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 e0637b7cfdc4..5e1a2d0fa5ec 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 @@ -6,7 +6,7 @@ # 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-error, no-value-for-parameter +# pylint: disable=protected-access, broad-except import copy import calendar 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 1b918785c3c0..eac98069ec59 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 @@ -40,39 +40,38 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes :ivar agents: AgentsOperations operations :vartype agents: azure.ai.projects.aio.operations.AgentsOperations - :ivar memory_stores: MemoryStoresOperations operations - :vartype memory_stores: azure.ai.projects.aio.operations.MemoryStoresOperations :ivar connections: ConnectionsOperations operations :vartype connections: azure.ai.projects.aio.operations.ConnectionsOperations :ivar datasets: DatasetsOperations operations :vartype datasets: azure.ai.projects.aio.operations.DatasetsOperations - :ivar indexes: IndexesOperations operations - :vartype indexes: azure.ai.projects.aio.operations.IndexesOperations :ivar deployments: DeploymentsOperations operations :vartype deployments: azure.ai.projects.aio.operations.DeploymentsOperations - :ivar red_teams: RedTeamsOperations operations - :vartype red_teams: azure.ai.projects.aio.operations.RedTeamsOperations - :ivar evaluation_rules: EvaluationRulesOperations operations - :vartype evaluation_rules: azure.ai.projects.aio.operations.EvaluationRulesOperations :ivar evaluation_taxonomies: EvaluationTaxonomiesOperations operations :vartype evaluation_taxonomies: azure.ai.projects.aio.operations.EvaluationTaxonomiesOperations + :ivar evaluation_rules: EvaluationRulesOperations operations + :vartype evaluation_rules: azure.ai.projects.aio.operations.EvaluationRulesOperations :ivar evaluators: EvaluatorsOperations operations :vartype evaluators: azure.ai.projects.aio.operations.EvaluatorsOperations + :ivar indexes: IndexesOperations operations + :vartype indexes: azure.ai.projects.aio.operations.IndexesOperations :ivar insights: InsightsOperations operations :vartype insights: azure.ai.projects.aio.operations.InsightsOperations + :ivar memory_stores: MemoryStoresOperations operations + :vartype memory_stores: azure.ai.projects.aio.operations.MemoryStoresOperations + :ivar red_teams: RedTeamsOperations operations + :vartype red_teams: azure.ai.projects.aio.operations.RedTeamsOperations :ivar schedules: SchedulesOperations operations :vartype schedules: azure.ai.projects.aio.operations.SchedulesOperations :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. + "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. Default value is - "2025-11-15-preview". Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Default value is "v1". Note + that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -103,20 +102,20 @@ def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: self._deserialize = Deserializer() self._serialize.client_side_validation = False self.agents = AgentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.memory_stores = MemoryStoresOperations(self._client, self._config, self._serialize, self._deserialize) self.connections = ConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) self.datasets = DatasetsOperations(self._client, self._config, self._serialize, self._deserialize) - self.indexes = IndexesOperations(self._client, self._config, self._serialize, self._deserialize) self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.red_teams = RedTeamsOperations(self._client, self._config, self._serialize, self._deserialize) - self.evaluation_rules = EvaluationRulesOperations( + self.evaluation_taxonomies = EvaluationTaxonomiesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.evaluation_taxonomies = EvaluationTaxonomiesOperations( + self.evaluation_rules = EvaluationRulesOperations( self._client, self._config, self._serialize, self._deserialize ) self.evaluators = EvaluatorsOperations(self._client, self._config, self._serialize, self._deserialize) + self.indexes = IndexesOperations(self._client, self._config, self._serialize, self._deserialize) self.insights = InsightsOperations(self._client, self._config, self._serialize, self._deserialize) + self.memory_stores = MemoryStoresOperations(self._client, self._config, self._serialize, self._deserialize) + self.red_teams = RedTeamsOperations(self._client, self._config, self._serialize, self._deserialize) self.schedules = SchedulesOperations(self._client, self._config, self._serialize, self._deserialize) def send_request( 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 39ed534eb174..91e944b3bbae 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 @@ -23,21 +23,20 @@ class AIProjectClientConfiguration: # pylint: disable=too-many-instance-attribu 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. + "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. Default value is - "2025-11-15-preview". Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Default value is "v1". 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", "2025-11-15-preview") + api_version: str = kwargs.pop("api_version", "v1") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") 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 5ae1225f30fa..7c53165b9f1d 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 @@ -13,16 +13,16 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import AgentsOperations # type: ignore -from ._operations import MemoryStoresOperations # type: ignore from ._operations import ConnectionsOperations # type: ignore from ._operations import DatasetsOperations # type: ignore -from ._operations import IndexesOperations # type: ignore from ._operations import DeploymentsOperations # type: ignore -from ._operations import RedTeamsOperations # type: ignore -from ._operations import EvaluationRulesOperations # type: ignore from ._operations import EvaluationTaxonomiesOperations # type: ignore +from ._operations import EvaluationRulesOperations # type: ignore from ._operations import EvaluatorsOperations # type: ignore +from ._operations import IndexesOperations # type: ignore from ._operations import InsightsOperations # type: ignore +from ._operations import MemoryStoresOperations # type: ignore +from ._operations import RedTeamsOperations # type: ignore from ._operations import SchedulesOperations # type: ignore from ._patch import __all__ as _patch_all @@ -31,16 +31,16 @@ __all__ = [ "AgentsOperations", - "MemoryStoresOperations", "ConnectionsOperations", "DatasetsOperations", - "IndexesOperations", "DeploymentsOperations", - "RedTeamsOperations", - "EvaluationRulesOperations", "EvaluationTaxonomiesOperations", + "EvaluationRulesOperations", "EvaluatorsOperations", + "IndexesOperations", "InsightsOperations", + "MemoryStoresOperations", + "RedTeamsOperations", "SchedulesOperations", ] __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 c5bbefb67fe9..9bfc4afc7bc3 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 @@ -35,6 +35,7 @@ from ... import models as _models from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer +from ...models._enums import FoundryPreviewOptInKeys from ...operations._operations import ( build_agents_create_from_manifest_request, build_agents_create_request, @@ -198,6 +199,14 @@ async def create( *, name: str, definition: _models.AgentDefinition, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, @@ -215,6 +224,16 @@ async def create( :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 foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or + ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -234,12 +253,34 @@ async def create( @overload async def create( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + body: JSON, + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: """Creates the agent. :param body: Required. :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or + ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -250,12 +291,34 @@ async def create( @overload async def create( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + body: IO[bytes], + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: """Creates the agent. :param body: Required. :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or + ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -271,6 +334,14 @@ async def create( *, name: str = _Unset, definition: _models.AgentDefinition = _Unset, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any @@ -289,6 +360,16 @@ async def create( :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 foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or + ~azure.ai.projects.models.MEMORY_STORES_V1 :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. @@ -331,6 +412,7 @@ async def create( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_agents_create_request( + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -378,19 +460,23 @@ async def update( agent_name: str, *, definition: _models.AgentDefinition, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any ) -> _models.AgentDetails: - """Updates the agent by adding a new version if there are any changes to the agent definition. - If no changes, returns the existing agent version. + """Updates the 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 agent to retrieve. 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 foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -410,15 +496,24 @@ async def update( @overload async def update( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: JSON, + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: - """Updates the agent by adding a new version if there are any changes to the agent definition. - If no changes, returns the existing agent version. + """Updates the 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 agent to retrieve. Required. :type agent_name: str :param body: Required. :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -429,15 +524,24 @@ async def update( @overload async def update( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: IO[bytes], + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: - """Updates the agent by adding a new version if there are any changes to the agent definition. - If no changes, returns the existing agent version. + """Updates the 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 agent to retrieve. Required. :type agent_name: str :param body: Required. :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -453,12 +557,13 @@ async def update( body: Union[JSON, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any ) -> _models.AgentDetails: - """Updates the agent by adding a new version if there are any changes to the agent definition. - If no changes, returns the existing agent version. + """Updates the 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 agent to retrieve. Required. :type agent_name: str @@ -467,6 +572,9 @@ async def update( :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 foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :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. @@ -508,6 +616,7 @@ async def update( _request = build_agents_update_request( agent_name=agent_name, + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -556,6 +665,11 @@ async def create_from_manifest( name: str, manifest_id: str, parameter_values: dict[str, Any], + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] + ] + ] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, @@ -575,6 +689,12 @@ async def create_from_manifest( :keyword parameter_values: The inputs to the manifest that will result in a fully materialized Agent. Required. :paramtype parameter_values: dict[str, any] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is either a + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -594,12 +714,27 @@ async def create_from_manifest( @overload async def create_from_manifest( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + body: JSON, + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] + ] + ] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: """Creates an agent from a manifest. :param body: Required. :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is either a + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -610,12 +745,27 @@ async def create_from_manifest( @overload async def create_from_manifest( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + body: IO[bytes], + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] + ] + ] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: """Creates an agent from a manifest. :param body: Required. :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is either a + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -632,6 +782,11 @@ async def create_from_manifest( name: str = _Unset, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] + ] + ] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any @@ -652,6 +807,12 @@ async def create_from_manifest( :keyword parameter_values: The inputs to the manifest that will result in a fully materialized Agent. Required. :paramtype parameter_values: dict[str, any] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is either a + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 :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. @@ -702,6 +863,7 @@ async def create_from_manifest( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_agents_create_from_manifest_request( + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -750,14 +912,14 @@ async def update_from_manifest( *, manifest_id: str, parameter_values: dict[str, Any], + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any ) -> _models.AgentDetails: """Updates the agent from a manifest by adding a new version if there are any changes to the agent - definition. - If no changes, returns the existing agent version. + definition. If no changes, returns the existing agent version. :param agent_name: The name of the agent to update. Required. :type agent_name: str @@ -766,6 +928,9 @@ async def update_from_manifest( :keyword parameter_values: The inputs to the manifest that will result in a fully materialized Agent. Required. :paramtype parameter_values: dict[str, any] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -785,16 +950,24 @@ async def update_from_manifest( @overload async def update_from_manifest( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: JSON, + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: """Updates the agent from a manifest by adding a new version if there are any changes to the agent - definition. - If no changes, returns the existing agent version. + definition. If no changes, returns the existing agent version. :param agent_name: The name of the agent to update. Required. :type agent_name: str :param body: Required. :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -805,16 +978,24 @@ async def update_from_manifest( @overload async def update_from_manifest( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: IO[bytes], + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: """Updates the agent from a manifest by adding a new version if there are any changes to the agent - definition. - If no changes, returns the existing agent version. + definition. If no changes, returns the existing agent version. :param agent_name: The name of the agent to update. Required. :type agent_name: str :param body: Required. :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -831,13 +1012,13 @@ async def update_from_manifest( *, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any ) -> _models.AgentDetails: """Updates the agent from a manifest by adding a new version if there are any changes to the agent - definition. - If no changes, returns the existing agent version. + definition. If no changes, returns the existing agent version. :param agent_name: The name of the agent to update. Required. :type agent_name: str @@ -848,6 +1029,9 @@ async def update_from_manifest( :keyword parameter_values: The inputs to the manifest that will result in a fully materialized Agent. Required. :paramtype parameter_values: dict[str, any] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :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. @@ -896,6 +1080,7 @@ async def update_from_manifest( _request = build_agents_update_from_manifest_request( agent_name=agent_name, + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -938,11 +1123,27 @@ async def update_from_manifest( return deserialized # type: ignore @distributed_trace_async - async def delete(self, agent_name: str, **kwargs: Any) -> _models.DeleteAgentResponse: + async def delete( + self, + agent_name: str, + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] + ] + ] = None, + **kwargs: Any + ) -> _models.DeleteAgentResponse: """Deletes an agent. :param agent_name: The name of the agent to delete. Required. :type agent_name: str + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is either a + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 :return: DeleteAgentResponse. The DeleteAgentResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DeleteAgentResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -962,6 +1163,7 @@ async def delete(self, agent_name: str, **kwargs: Any) -> _models.DeleteAgentRes _request = build_agents_delete_request( agent_name=agent_name, + foundry_beta=foundry_beta, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1001,16 +1203,17 @@ async def delete(self, agent_name: str, **kwargs: Any) -> _models.DeleteAgentRes return deserialized # type: ignore - @distributed_trace - def list( + @distributed_trace_async + async def list( self, *, kind: Optional[Union[str, _models.AgentKind]] = None, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, + after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.AgentDetails"]: + ) -> _models.AgentsPagedResultAgentObject: """Returns the list of all agents. :keyword kind: Filter agents by kind. If not provided, all agents are returned. Known values @@ -1024,21 +1227,23 @@ 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: A cursor for use in pagination. ``after`` 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 after=obj_foo in order to fetch the next page of the list. Default + value is None. + :paramtype after: str :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.async_paging.AsyncItemPaged[~azure.ai.projects.models.AgentDetails] + :return: AgentsPagedResultAgentObject. The AgentsPagedResultAgentObject is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.AgentsPagedResultAgentObject :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, @@ -1047,51 +1252,55 @@ def list( } 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_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 + cls: ClsType[_models.AgentsPagedResultAgentObject] = kwargs.pop("cls", None) - async 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, AsyncList(list_of_elem) + _request = build_agents_list_request( + kind=kind, + limit=limit, + order=order, + after=after, + 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) - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + _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() + else: + deserialized = _deserialize(_models.AgentsPagedResultAgentObject, 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 create_version( @@ -1099,6 +1308,14 @@ async def create_version( agent_name: str, *, definition: _models.AgentDefinition, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, @@ -1116,6 +1333,16 @@ async def create_version( :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 foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or + ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1135,7 +1362,20 @@ 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: JSON, + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentVersionDetails: """Create a new agent version. @@ -1148,6 +1388,16 @@ async def create_version( :type agent_name: str :param body: Required. :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or + ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1158,7 +1408,20 @@ async def create_version( @overload async def create_version( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: IO[bytes], + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentVersionDetails: """Create a new agent version. @@ -1171,6 +1434,16 @@ async def create_version( :type agent_name: str :param body: Required. :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or + ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1186,6 +1459,14 @@ async def create_version( body: Union[JSON, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any @@ -1204,6 +1485,16 @@ async def create_version( :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 foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or + ~azure.ai.projects.models.MEMORY_STORES_V1 :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. @@ -1245,6 +1536,7 @@ async def create_version( _request = build_agents_create_version_request( agent_name=agent_name, + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -1561,7 +1853,16 @@ async def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) @distributed_trace_async async def delete_version( - self, agent_name: str, agent_version: str, **kwargs: Any + self, + agent_name: str, + agent_version: str, + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] + ] + ] = None, + **kwargs: Any ) -> _models.DeleteAgentVersionResponse: """Deletes a specific version of an agent. @@ -1569,6 +1870,12 @@ async def delete_version( :type agent_name: str :param agent_version: The version of the agent to delete. Required. :type agent_version: str + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is either a + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 :return: DeleteAgentVersionResponse. The DeleteAgentVersionResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DeleteAgentVersionResponse @@ -1590,6 +1897,7 @@ async def delete_version( _request = build_agents_delete_version_request( agent_name=agent_name, agent_version=agent_version, + foundry_beta=foundry_beta, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1726,6 +2034,7 @@ async def stream_agent_container_logs( agent_name: str, agent_version: str, *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1]] = None, kind: Optional[Union[str, _models.ContainerLogKind]] = None, replica_name: Optional[str] = None, tail: Optional[int] = None, @@ -1761,6 +2070,9 @@ async def stream_agent_container_logs( :type agent_name: str :param agent_version: The version of the agent. Required. :type agent_version: str + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. CONTAINER_AGENTS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 :keyword kind: console returns container stdout/stderr, system returns container app event stream. defaults to console. Known values are: "console" and "system". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.ContainerLogKind @@ -1790,6 +2102,7 @@ async def stream_agent_container_logs( _request = build_agents_stream_agent_container_logs_request( agent_name=agent_name, agent_version=agent_version, + foundry_beta=foundry_beta, kind=kind, replica_name=replica_name, tail=tail, @@ -1821,14 +2134,14 @@ async def stream_agent_container_logs( return cls(pipeline_response, None, {}) # type: ignore -class MemoryStoresOperations: +class ConnectionsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`memory_stores` attribute. + :attr:`connections` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -1838,94 +2151,14 @@ 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( - self, - *, - name: str, - definition: _models.MemoryStoreDefinition, - content_type: str = "application/json", - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - **kwargs: Any - ) -> _models.MemoryStoreDetails: - """Create a memory store. - - :keyword name: The name of the memory store. Required. - :paramtype name: str - :keyword definition: The memory store definition. Required. - :paramtype definition: ~azure.ai.projects.models.MemoryStoreDefinition - :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 memory store. Default value is None. - :paramtype description: str - :keyword metadata: Arbitrary key-value metadata to associate with the memory store. Default - value is None. - :paramtype metadata: dict[str, str] - :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreDetails: - """Create a memory store. - - :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: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreDetails: - """Create a memory store. - - :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: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def create( - self, - body: Union[JSON, IO[bytes]] = _Unset, - *, - name: str = _Unset, - definition: _models.MemoryStoreDefinition = _Unset, - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - **kwargs: Any - ) -> _models.MemoryStoreDetails: - """Create a memory store. + async def _get(self, name: str, **kwargs: Any) -> _models.Connection: + """Get a connection by name, without populating connection credentials. - :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. - :paramtype definition: ~azure.ai.projects.models.MemoryStoreDefinition - :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 - value is None. - :paramtype metadata: dict[str, str] - :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails + :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 = { @@ -1936,185 +2169,14 @@ async def create( } 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.MemoryStoreDetails] = 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 = {"definition": definition, "description": description, "metadata": metadata, "name": name} - 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_memory_stores_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) - - _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() - else: - deserialized = _deserialize(_models.MemoryStoreDetails, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, - name: str, - *, - content_type: str = "application/json", - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - **kwargs: Any - ) -> _models.MemoryStoreDetails: - """Update a memory store. - - :param name: The name of the memory store to update. Required. - :type name: 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: 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 - value is None. - :paramtype metadata: dict[str, str] - :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreDetails: - """Update a memory store. - - :param name: The name of the memory store 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: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreDetails: - """Update a memory store. - - :param name: The name of the memory store 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: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - name: str, - body: Union[JSON, IO[bytes]] = _Unset, - *, - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - **kwargs: Any - ) -> _models.MemoryStoreDetails: - """Update a memory store. - - :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] - :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 - value is None. - :paramtype metadata: dict[str, str] - :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails - :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.MemoryStoreDetails] = kwargs.pop("cls", None) - - if body is _Unset: - body = {"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_memory_stores_update_request( + _request = build_connections_get_request( name=name, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -2137,30 +2199,31 @@ async def update( 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() else: - deserialized = _deserialize(_models.MemoryStoreDetails, 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(self, name: str, **kwargs: Any) -> _models.MemoryStoreDetails: - """Retrieve a memory store. + async def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Connection: + """Get a connection by name, with its connection credentials. - :param name: The name of the memory store to retrieve. Required. + :param name: The friendly name of the connection, provided by the user. Required. :type name: str - :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Connection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2174,9 +2237,9 @@ async def get(self, name: str, **kwargs: Any) -> _models.MemoryStoreDetails: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.MemoryStoreDetails] = kwargs.pop("cls", None) + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) - _request = build_memory_stores_get_request( + _request = build_connections_get_with_credentials_request( name=name, api_version=self._config.api_version, headers=_headers, @@ -2201,19 +2264,20 @@ async def get(self, name: str, **kwargs: Any) -> _models.MemoryStoreDetails: 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() else: - deserialized = _deserialize(_models.MemoryStoreDetails, 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 @@ -2221,35 +2285,27 @@ async def get(self, name: str, **kwargs: Any) -> _models.MemoryStoreDetails: def list( self, *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, + connection_type: Optional[Union[str, _models.ConnectionType]] = None, + default_connection: Optional[bool] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.MemoryStoreDetails"]: - """List all memory stores. + ) -> AsyncItemPaged["_models.Connection"]: + """List all connections in the project, without populating connection credentials. - :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 MemoryStoreDetails - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.MemoryStoreDetails] + :keyword connection_type: List 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: List 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.MemoryStoreDetails]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Connection]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2259,32 +2315,54 @@ def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(_continuation_token=None): - - _request = build_memory_stores_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.MemoryStoreDetails], 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) + def prepare_request(next_link=None): + if not next_link: - async def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + _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), 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.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) + + 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 @@ -2294,24 +2372,208 @@ 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) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DatasetsOperations: + """ + .. 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. + """ + + 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 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, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + 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, ) - raise HttpResponseError(response=response, model=error) + path_format_arguments = { + "endpoint": 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), 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.DatasetVersion], 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) + + _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) + raise HttpResponseError(response=response) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.DatasetVersion"]: + """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, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + 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), 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.DatasetVersion], 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) + + _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) + raise HttpResponseError(response=response) return pipeline_response return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def delete(self, name: str, **kwargs: Any) -> _models.DeleteMemoryStoreResult: - """Delete a memory store. + async def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: + """Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the + DatasetVersion does not exist. - :param name: The name of the memory store to delete. Required. + :param name: The name of the resource. Required. :type name: str - :return: DeleteMemoryStoreResult. The DeleteMemoryStoreResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DeleteMemoryStoreResult + :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 = { @@ -2325,10 +2587,11 @@ async def delete(self, name: str, **kwargs: Any) -> _models.DeleteMemoryStoreRes _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeleteMemoryStoreResult] = kwargs.pop("cls", None) + cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) - _request = build_memory_stores_delete_request( + _request = build_datasets_get_request( name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2352,122 +2615,163 @@ async def delete(self, name: str, **kwargs: Any) -> _models.DeleteMemoryStoreRes 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() else: - deserialized = _deserialize(_models.DeleteMemoryStoreResult, response.json()) + deserialized = _deserialize(_models.DatasetVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @distributed_trace_async + async def delete(self, name: str, version: str, **kwargs: Any) -> None: + """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 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 = { + 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_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 = 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) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + @overload - async def search_memories( + async def create_or_update( self, name: str, + version: str, + dataset_version: _models.DatasetVersion, *, - scope: str, - content_type: str = "application/json", - items: Optional[List[_models.InputItem]] = None, - previous_search_id: Optional[str] = None, - options: Optional[_models.MemorySearchOptions] = None, + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> _models.MemoryStoreSearchResult: - """Search for relevant memories from a memory store based on conversation context. + ) -> _models.DatasetVersion: + """Create a new or update an existing DatasetVersion with the given version id. - :param name: The name of the memory store to search. Required. + :param name: The name of the resource. Required. :type name: str - :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. - Required. - :paramtype scope: 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 - :keyword items: Items for which to search for relevant memories. Default value is None. - :paramtype items: list[~azure.ai.projects.models.InputItem] - :keyword previous_search_id: The unique ID of the previous search request, enabling incremental - memory search from where the last operation left off. Default value is None. - :paramtype previous_search_id: str - :keyword options: Memory search options. Default value is None. - :paramtype options: ~azure.ai.projects.models.MemorySearchOptions - :return: MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreSearchResult + :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def search_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreSearchResult: - """Search for relevant memories from a memory store based on conversation context. + async def create_or_update( + self, + name: str, + version: str, + dataset_version: JSON, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.DatasetVersion: + """Create a new or update an existing DatasetVersion with the given version id. - :param name: The name of the memory store to search. Required. + :param name: The name of the resource. Required. :type name: str - :param body: Required. - :type body: JSON + :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: MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreSearchResult + :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def search_memories( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreSearchResult: - """Search for relevant memories from a memory store based on conversation context. + async 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 a new or update an existing DatasetVersion with the given version id. - :param name: The name of the memory store to search. Required. + :param name: The name of the resource. Required. :type name: str - :param body: Required. - :type body: IO[bytes] + :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: MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreSearchResult + :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def search_memories( - self, - name: str, - body: Union[JSON, IO[bytes]] = _Unset, - *, - scope: str = _Unset, - items: Optional[List[_models.InputItem]] = None, - previous_search_id: Optional[str] = None, - options: Optional[_models.MemorySearchOptions] = None, - **kwargs: Any - ) -> _models.MemoryStoreSearchResult: - """Search for relevant memories from a memory store based on conversation context. + async def create_or_update( + self, name: str, version: str, dataset_version: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any + ) -> _models.DatasetVersion: + """Create a new or update an existing DatasetVersion with the given version id. - :param name: The name of the memory store to search. Required. + :param name: The name of the resource. Required. :type name: str - :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 - :keyword items: Items for which to search for relevant memories. Default value is None. - :paramtype items: list[~azure.ai.projects.models.InputItem] - :keyword previous_search_id: The unique ID of the previous search request, enabling incremental - memory search from where the last operation left off. Default value is None. - :paramtype previous_search_id: str - :keyword options: Memory search options. Default value is None. - :paramtype options: ~azure.ai.projects.models.MemorySearchOptions - :return: MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreSearchResult + :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 = { @@ -2482,27 +2786,18 @@ async def search_memories( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.MemoryStoreSearchResult] = kwargs.pop("cls", None) + cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) - if body is _Unset: - if scope is _Unset: - raise TypeError("missing required argument: scope") - body = { - "items": items, - "options": options, - "previous_search_id": previous_search_id, - "scope": scope, - } - 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(dataset_version, (IOBase, bytes)): + _content = dataset_version else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(dataset_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_memory_stores_search_memories_request( + _request = build_datasets_create_or_update_request( name=name, + version=version, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -2521,73 +2816,149 @@ async def search_memories( 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() else: - deserialized = _deserialize(_models.MemoryStoreSearchResult, response.json()) + deserialized = _deserialize(_models.DatasetVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _update_memories_initial( + @overload + async def pending_upload( self, name: str, - body: Union[JSON, IO[bytes]] = _Unset, + version: str, + pending_upload_request: _models.PendingUploadRequest, *, - scope: str = _Unset, - items: Optional[List[_models.InputItem]] = None, - previous_update_id: Optional[str] = None, - update_delay: Optional[int] = None, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + ) -> _models.PendingUploadResponse: + """Start a new or get an existing pending upload of a dataset for a specific version. - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + :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: + """ - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = 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 new or get an existing pending upload of a dataset for a specific 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 new or get an existing pending upload of a dataset for a specific 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 new or get an existing pending upload of a dataset for a specific 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, + 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.PendingUploadResponse] = kwargs.pop("cls", None) - if body is _Unset: - if scope is _Unset: - raise TypeError("missing required argument: scope") - body = { - "items": items, - "previous_update_id": previous_update_id, - "scope": scope, - "update_delay": update_delay, - } - 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 + if isinstance(pending_upload_request, (IOBase, bytes)): + _content = pending_upload_request else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(pending_upload_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_memory_stores_update_memories_request( + _request = build_datasets_pending_upload_request( name=name, + version=version, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -2599,269 +2970,68 @@ async def _update_memories_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = 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]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + 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["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + raise HttpResponseError(response=response) - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.PendingUploadResponse, 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 - async def _begin_update_memories( - self, - name: str, - *, - scope: str, - content_type: str = "application/json", - items: Optional[List[_models.InputItem]] = None, - previous_update_id: Optional[str] = None, - update_delay: Optional[int] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... - @overload - async def _begin_update_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... - @overload - async def _begin_update_memories( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... - @distributed_trace_async - async def _begin_update_memories( - self, - name: str, - body: Union[JSON, IO[bytes]] = _Unset, - *, - scope: str = _Unset, - items: Optional[List[_models.InputItem]] = None, - previous_update_id: Optional[str] = None, - update_delay: Optional[int] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: - """Update memory store with conversation memories. + async def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.DatasetCredential: + """Get the SAS credential to access the storage account associated with a Dataset version. - :param name: The name of the memory store to update. Required. + :param name: The name of the resource. Required. :type name: str - :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 - :keyword items: Conversation items from which to extract memories. Default value is None. - :paramtype items: list[~azure.ai.projects.models.InputItem] - :keyword previous_update_id: The unique ID of the previous update request, enabling incremental - memory updates from where the last operation left off. Default value is None. - :paramtype previous_update_id: str - :keyword 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). Default value is None. - :paramtype update_delay: int - :return: An instance of AsyncLROPoller that returns MemoryStoreUpdateCompletedResult. The - MemoryStoreUpdateCompletedResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.MemoryStoreUpdateCompletedResult] + :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: """ - _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.MemoryStoreUpdateCompletedResult] = 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._update_memories_initial( - name=name, - body=body, - scope=scope, - items=items, - previous_update_id=previous_update_id, - update_delay=update_delay, - 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) + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - 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") - ) + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - deserialized = _deserialize(_models.MemoryStoreUpdateCompletedResult, response.json().get("result", {})) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + cls: ClsType[_models.DatasetCredential] = kwargs.pop("cls", None) + _request = build_datasets_get_credentials_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), } - - 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.MemoryStoreUpdateCompletedResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - async def delete_scope( - self, name: str, *, scope: str, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. - - :param name: The name of the memory store. Required. - :type name: str - :keyword scope: The namespace that logically groups and isolates memories to delete, such as a - user ID. Required. - :paramtype scope: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDeleteScopeResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def delete_scope( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. - - :param name: The name of the memory store. 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: MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDeleteScopeResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def delete_scope( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. - - :param name: The name of the memory store. 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: MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDeleteScopeResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def delete_scope( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, **kwargs: Any - ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. - - :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] - :keyword scope: The namespace that logically groups and isolates memories to delete, such as a - user ID. Required. - :paramtype scope: str - :return: MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDeleteScopeResult - :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.MemoryStoreDeleteScopeResult] = kwargs.pop("cls", 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} - 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_memory_stores_delete_scope_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) + _request.url = self._client.format_url(_request.url, **path_format_arguments) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access @@ -2877,16 +3047,12 @@ async def delete_scope( 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() else: - deserialized = _deserialize(_models.MemoryStoreDeleteScopeResult, response.json()) + deserialized = _deserialize(_models.DatasetCredential, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2894,14 +3060,14 @@ async def delete_scope( return deserialized # type: ignore -class ConnectionsOperations: +class DeploymentsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`connections` attribute. + :attr:`deployments` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -2912,78 +3078,13 @@ 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(self, name: str, **kwargs: Any) -> _models.Connection: - """Get a connection by name, without populating connection credentials. - - :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) - - _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) - - 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() - else: - deserialized = _deserialize(_models.Connection, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Connection: - """Get a connection by name, with its connection credentials. + async def get(self, name: str, **kwargs: Any) -> _models.Deployment: + """Get 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 = { @@ -2997,9 +3098,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, @@ -3034,7 +3135,7 @@ async def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Conne if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Connection, response.json()) + deserialized = _deserialize(_models.Deployment, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3045,27 +3146,29 @@ 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 all connections in the project, without populating connection credentials. + ) -> AsyncItemPaged["_models.Deployment"]: + """List all deployed models in the project. - :keyword connection_type: List connections of this specific type. Known values are: - "AzureOpenAI", "AzureBlob", "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", - "AppConfig", "AppInsights", "CustomKeys", and "RemoteTool". Default value is None. - :paramtype connection_type: str or ~azure.ai.projects.models.ConnectionType - :keyword default_connection: List 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, @@ -3078,9 +3181,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, @@ -3116,7 +3220,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], deserialized.get("value", [])) + 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) @@ -3139,14 +3243,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class DatasetsOperations: +class EvaluationTaxonomiesOperations: """ .. 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:`evaluation_taxonomies` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -3156,20 +3260,89 @@ 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") - @distributed_trace - def list_versions(self, name: str, **kwargs: Any) -> AsyncItemPaged["_models.DatasetVersion"]: - """List all versions of the given DatasetVersion. + @distributed_trace_async + async def get(self, name: str, **kwargs: Any) -> _models.EvaluationTaxonomy: + """Get an evaluation run by name. :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: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :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[List[_models.DatasetVersion]] = kwargs.pop("cls", None) + cls: ClsType[_models.EvaluationTaxonomy] = kwargs.pop("cls", None) + + _request = build_evaluation_taxonomies_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) + + _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) + + 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() + else: + deserialized = _deserialize(_models.EvaluationTaxonomy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, *, input_name: Optional[str] = None, input_type: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.EvaluationTaxonomy"]: + """List evaluation taxonomies. + + :keyword input_name: Filter by the evaluation input name. Default value is None. + :paramtype input_name: str + :keyword input_type: Filter by taxonomy input type. Default value is None. + :paramtype input_type: str + :return: An iterator like instance of EvaluationTaxonomy + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.EvaluationTaxonomy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EvaluationTaxonomy]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3182,8 +3355,9 @@ 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( - name=name, + _request = build_evaluation_taxonomies_list_request( + input_name=input_name, + input_type=input_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3219,7 +3393,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], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.EvaluationTaxonomy], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3241,19 +3415,163 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged["_models.DatasetVersion"]: - """List the latest version of each DatasetVersion. + @distributed_trace_async + async def delete(self, name: str, **kwargs: Any) -> None: + """Delete an evaluation taxonomy by name. - :return: An iterator like instance of DatasetVersion - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.DatasetVersion] + :param name: The name of the resource. 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[List[_models.DatasetVersion]] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_evaluation_taxonomies_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) + 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 cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def create( + self, + name: str, + body: _models.EvaluationTaxonomy, + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EvaluationTaxonomy: + """Create an evaluation taxonomy. + + :param name: The name of the evaluation taxonomy. Required. + :type name: str + :param body: The evaluation taxonomy. Required. + :type body: ~azure.ai.projects.models.EvaluationTaxonomy + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + name: str, + body: JSON, + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EvaluationTaxonomy: + """Create an evaluation taxonomy. + + :param name: The name of the evaluation taxonomy. Required. + :type name: str + :param body: The evaluation taxonomy. Required. + :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + name: str, + body: IO[bytes], + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EvaluationTaxonomy: + """Create an evaluation taxonomy. + + :param name: The name of the evaluation taxonomy. Required. + :type name: str + :param body: The evaluation taxonomy. Required. + :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create( + self, + name: str, + body: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + **kwargs: Any + ) -> _models.EvaluationTaxonomy: + """Create an evaluation taxonomy. + + :param name: The name of the evaluation taxonomy. Required. + :type name: str + :param body: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, JSON, + IO[bytes] Required. + :type body: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3262,78 +3580,161 @@ def list(self, **kwargs: Any) -> AsyncItemPaged["_models.DatasetVersion"]: } 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_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) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EvaluationTaxonomy] = 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), 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(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - return _request + _request = build_evaluation_taxonomies_create_request( + name=name, + foundry_beta=foundry_beta, + 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.DatasetVersion], deserialized.get("value", [])) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + _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 - ) - response = pipeline_response.http_response + 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 response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EvaluationTaxonomy, 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(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: - """Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the - DatasetVersion does not exist. + @overload + async def update( + self, + name: str, + body: _models.EvaluationTaxonomy, + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EvaluationTaxonomy: + """Update an evaluation taxonomy. + + :param name: The name of the evaluation taxonomy. Required. + :type name: str + :param body: The evaluation taxonomy. Required. + :type body: ~azure.ai.projects.models.EvaluationTaxonomy + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + name: str, + body: JSON, + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EvaluationTaxonomy: + """Update an evaluation taxonomy. + + :param name: The name of the evaluation taxonomy. Required. + :type name: str + :param body: The evaluation taxonomy. Required. + :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + name: str, + body: IO[bytes], + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EvaluationTaxonomy: + """Update an evaluation taxonomy. + + :param name: The name of the evaluation taxonomy. Required. + :type name: str + :param body: The evaluation taxonomy. Required. + :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :raises ~azure.core.exceptions.HttpResponseError: + """ - :param name: The name of the resource. Required. + @distributed_trace_async + async def update( + self, + name: str, + body: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + **kwargs: Any + ) -> _models.EvaluationTaxonomy: + """Update an evaluation taxonomy. + + :param name: The name of the evaluation taxonomy. 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 body: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, JSON, + IO[bytes] Required. + :type body: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3344,15 +3745,25 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVe } 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.DatasetVersion] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EvaluationTaxonomy] = kwargs.pop("cls", None) - _request = build_datasets_get_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_evaluation_taxonomies_update_request( name=name, - version=version, + foundry_beta=foundry_beta, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -3380,24 +3791,39 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVe if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DatasetVersion, response.json()) + deserialized = _deserialize(_models.EvaluationTaxonomy, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + +class EvaluationRulesOperations: + """ + .. 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(self, name: str, version: str, **kwargs: Any) -> None: - """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. + async def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: + """Get an evaluation rule. - :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 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 = { @@ -3411,11 +3837,10 @@ async def delete(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[_models.EvaluationRule] = kwargs.pop("cls", None) - _request = build_datasets_delete_request( - name=name, - version=version, + _request = build_evaluation_rules_get_request( + id=id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3425,113 +3850,45 @@ async def delete(self, name: str, version: str, **kwargs: Any) -> None: } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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) raise HttpResponseError(response=response) - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async 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 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/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 - async def create_or_update( - self, - name: str, - version: str, - dataset_version: JSON, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + response_headers = {} + response_headers["x-ms-client-request-id"] = self._deserialize( + "str", response.headers.get("x-ms-client-request-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: - """ + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EvaluationRule, response.json()) - @overload - async 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 a new or update an existing DatasetVersion with the given version id. + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - :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 deserialized # type: ignore @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: - """Create a new or update an existing DatasetVersion with the given version id. + async def delete(self, id: str, **kwargs: Any) -> None: + """Delete an evaluation rule. - :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 id: Unique identifier for the evaluation rule. Required. + :type id: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3542,25 +3899,14 @@ async 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[None] = kwargs.pop("cls", None) - _request = build_datasets_create_or_update_request( - name=name, - version=version, - content_type=content_type, + _request = build_evaluation_rules_delete_request( + id=id, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -3569,130 +3915,92 @@ async def create_or_update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _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, 201]: - 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) raise HttpResponseError(response=response) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.DatasetVersion, response.json()) + response_headers = {} + response_headers["x-ms-client-request-id"] = self._deserialize( + "str", response.headers.get("x-ms-client-request-id") + ) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, response_headers) # 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 new or get an existing pending upload of a dataset for a specific version. + 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. - :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 + :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: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationRule :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 new or get an existing pending upload of a dataset for a specific version. + 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. - :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 + :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: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationRule :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 new or get an existing pending upload of a dataset for a specific version. + 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. - :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] + :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: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :return: EvaluationRule. The EvaluationRule is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationRule :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 new or get an existing pending upload of a dataset for a specific version. + 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. - :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 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 = { @@ -3707,18 +4015,17 @@ async def pending_upload( _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) + cls: ClsType[_models.EvaluationRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(pending_upload_request, (IOBase, bytes)): - _content = pending_upload_request + if isinstance(evaluation_rule, (IOBase, bytes)): + _content = evaluation_rule else: - _content = json.dumps(pending_upload_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(evaluation_rule, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_datasets_pending_upload_request( - name=name, - version=version, + _request = build_evaluation_rules_create_or_update_request( + id=id, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -3737,7 +4044,7 @@ async def pending_upload( 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 @@ -3749,25 +4056,40 @@ async def pending_upload( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.PendingUploadResponse, response.json()) + deserialized = _deserialize(_models.EvaluationRule, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace_async - async def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with a Dataset version. + @distributed_trace + def list( + self, + *, + action_type: Optional[Union[str, _models.EvaluationRuleActionType]] = None, + agent_name: Optional[str] = None, + enabled: Optional[bool] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.EvaluationRule"]: + """List all evaluation rules. - :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 + :keyword action_type: Filter by the type of evaluation rule. Known values are: + "continuousEvaluation" and "humanEvaluation". 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[_models.EvaluationRule]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3776,58 +4098,79 @@ async def get_credentials(self, name: str, version: str, **kwargs: Any) -> _mode } 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[_models.DatasetCredential] = kwargs.pop("cls", None) + _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) - _request = build_datasets_get_credentials_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) + 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), 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 = kwargs.pop("stream", False) - 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.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) - 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) + async def get_next(next_link=None): + _request = prepare_request(next_link) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.DatasetCredential, response.json()) + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - if cls: - return cls(pipeline_response, 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) - return deserialized # type: ignore + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) -class IndexesOperations: +class EvaluatorsOperations: """ .. 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:`evaluators` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -3838,19 +4181,37 @@ 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 all versions of the given Index. + def list_versions( + self, + name: str, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, + limit: Optional[int] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.EvaluatorVersion"]: + """List all versions of the given evaluator. :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 foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one + of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default + value is None. + :paramtype type: str or str or str or 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 + :return: An iterator like instance of EvaluatorVersion + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.EvaluatorVersion] :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.EvaluatorVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3863,8 +4224,11 @@ def list_versions(self, name: str, **kwargs: Any) -> AsyncItemPaged["_models.Ind def prepare_request(next_link=None): if not next_link: - _request = build_indexes_list_versions_request( + _request = build_evaluators_list_versions_request( name=name, + foundry_beta=foundry_beta, + type=type, + limit=limit, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3900,7 +4264,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.Index], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.EvaluatorVersion], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3923,17 +4287,34 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Index"]: - """List the latest version of each Index. + def list_latest_versions( + self, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, + limit: Optional[int] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.EvaluatorVersion"]: + """List the latest version of each evaluator. - :return: An iterator like instance of Index - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Index] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one + of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default + value is None. + :paramtype type: str or str or str or 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 + :return: An iterator like instance of EvaluatorVersion + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.EvaluatorVersion] :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.EvaluatorVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3946,7 +4327,10 @@ def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Index"]: def prepare_request(next_link=None): if not next_link: - _request = build_indexes_list_request( + _request = build_evaluators_list_latest_versions_request( + foundry_beta=foundry_beta, + type=type, + limit=limit, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3982,7 +4366,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.Index], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.EvaluatorVersion], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4005,16 +4389,21 @@ 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.Index: - """Get the specific version of the Index. The service returns 404 Not Found error if the Index - does not exist. + async def get_version( + self, name: str, version: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], **kwargs: Any + ) -> _models.EvaluatorVersion: + """Get the specific version of the EvaluatorVersion. The service returns 404 Not Found error if + the EvaluatorVersion does not exist. :param name: The name of the resource. Required. :type name: str - :param version: The specific version id of the Index to retrieve. Required. + :param version: The specific version id of the EvaluatorVersion to retrieve. Required. :type version: str - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4028,11 +4417,12 @@ 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.EvaluatorVersion] = kwargs.pop("cls", None) - _request = build_indexes_get_request( + _request = build_evaluators_get_version_request( name=name, version=version, + foundry_beta=foundry_beta, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4061,7 +4451,7 @@ async def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Index, response.json()) + deserialized = _deserialize(_models.EvaluatorVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4069,14 +4459,19 @@ 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 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_version( + self, name: str, version: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], **kwargs: Any + ) -> None: + """Delete the specific version of the EvaluatorVersion. The service returns 204 No Content if the + EvaluatorVersion was deleted successfully or if the EvaluatorVersion does not exist. :param name: The name of the resource. Required. :type name: str - :param version: The version of the Index to delete. Required. + :param version: The version of the EvaluatorVersion to delete. Required. :type version: str + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -4094,9 +4489,10 @@ async def delete(self, name: str, version: str, **kwargs: Any) -> None: cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_indexes_delete_request( + _request = build_evaluators_delete_version_request( name=name, version=version, + foundry_beta=foundry_beta, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4121,92 +4517,107 @@ async def delete(self, name: str, version: str, **kwargs: Any) -> None: return cls(pipeline_response, None, {}) # type: ignore @overload - async def create_or_update( + async def create_version( self, name: str, - version: str, - index: _models.Index, + evaluator_version: _models.EvaluatorVersion, *, - content_type: str = "application/merge-patch+json", + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + content_type: str = "application/json", **kwargs: Any - ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + ) -> _models.EvaluatorVersion: + """Create a new EvaluatorVersion with auto incremented 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 evaluator_version: Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". + Default value is "application/json". :paramtype content_type: str - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion :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 a new or update an existing Index with the given version id. + async def create_version( + self, + name: str, + evaluator_version: JSON, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EvaluatorVersion: + """Create a new EvaluatorVersion with auto incremented 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 + :param evaluator_version: Required. + :type evaluator_version: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". + Default value is "application/json". :paramtype content_type: str - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_or_update( + async def create_version( self, name: str, - version: str, - index: IO[bytes], + evaluator_version: IO[bytes], *, - content_type: str = "application/merge-patch+json", + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + content_type: str = "application/json", **kwargs: Any - ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + ) -> _models.EvaluatorVersion: + """Create a new EvaluatorVersion with auto incremented 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] + :param evaluator_version: Required. + :type evaluator_version: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/merge-patch+json". + Default value is "application/json". :paramtype content_type: str - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion :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 a new or update an existing Index with the given version id. + async def create_version( + self, + name: str, + evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + **kwargs: Any + ) -> _models.EvaluatorVersion: + """Create a new EvaluatorVersion with auto incremented 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 + :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] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4221,18 +4632,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.Index] = kwargs.pop("cls", None) + cls: ClsType[_models.EvaluatorVersion] = kwargs.pop("cls", None) - content_type = content_type or "application/merge-patch+json" + content_type = content_type or "application/json" _content = None - if isinstance(index, (IOBase, bytes)): - _content = index + if isinstance(evaluator_version, (IOBase, bytes)): + _content = evaluator_version else: - _content = json.dumps(index, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(evaluator_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_indexes_create_or_update_request( + _request = build_evaluators_create_version_request( name=name, - version=version, + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -4251,7 +4662,7 @@ async def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [201]: if _stream: try: await response.read() # Load the body in memory and close the socket @@ -4263,39 +4674,127 @@ async def create_or_update( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Index, response.json()) + deserialized = _deserialize(_models.EvaluatorVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @overload + async def update_version( + self, + name: str, + version: str, + evaluator_version: _models.EvaluatorVersion, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EvaluatorVersion: + """Update an existing EvaluatorVersion with the given version id. -class DeploymentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. + :param name: The name of the resource. Required. + :type name: str + :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.models.EvaluatorVersion + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ - Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`deployments` attribute. - """ + @overload + async def update_version( + self, + name: str, + version: str, + evaluator_version: JSON, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EvaluatorVersion: + """Update an existing EvaluatorVersion with the given version id. - 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") + :param name: The name of the resource. Required. + :type name: str + :param version: The version of the EvaluatorVersion to update. Required. + :type version: str + :param evaluator_version: Evaluator resource. Required. + :type evaluator_version: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_version( + self, + name: str, + version: str, + evaluator_version: IO[bytes], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EvaluatorVersion: + """Update an existing EvaluatorVersion with the given version id. + + :param name: The name of the resource. Required. + :type name: str + :param version: The version of the EvaluatorVersion to update. Required. + :type version: str + :param evaluator_version: Evaluator resource. Required. + :type evaluator_version: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async - async def get(self, name: str, **kwargs: Any) -> _models.Deployment: - """Get a deployed model. + async def update_version( + self, + name: str, + version: str, + evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + **kwargs: Any + ) -> _models.EvaluatorVersion: + """Update an existing EvaluatorVersion with the given version id. - :param name: Name of the deployment. Required. + :param name: The name of the resource. Required. :type name: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Deployment + :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] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4306,14 +4805,26 @@ async def get(self, name: str, **kwargs: Any) -> _models.Deployment: } 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.Deployment] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EvaluatorVersion] = kwargs.pop("cls", None) - _request = build_deployments_get_request( + content_type = content_type or "application/json" + _content = None + if isinstance(evaluator_version, (IOBase, bytes)): + _content = evaluator_version + else: + _content = json.dumps(evaluator_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_evaluators_update_version_request( name=name, + version=version, + foundry_beta=foundry_beta, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -4338,48 +4849,48 @@ async def get(self, name: str, **kwargs: Any) -> _models.Deployment: 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() else: - deserialized = _deserialize(_models.Deployment, response.json()) + deserialized = _deserialize(_models.EvaluatorVersion, 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 IndexesOperations: + """ + .. 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. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AIProjectClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace - def list( - self, - *, - model_publisher: Optional[str] = None, - model_name: Optional[str] = None, - deployment_type: Optional[Union[str, _models.DeploymentType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.Deployment"]: - """List all deployed models in the project. + def list_versions(self, name: str, **kwargs: Any) -> AsyncItemPaged["_models.Index"]: + """List all versions of the given Index. - :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 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] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Deployment]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Index]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4392,10 +4903,8 @@ def list( 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, + _request = build_indexes_list_versions_request( + name=name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4431,7 +4940,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.Deployment], deserialized.get("value", [])) + 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) @@ -4453,101 +4962,18 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - -class RedTeamsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`red_teams` 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.RedTeam: - """Get a redteam by name. - - :param name: Identifier of the red team run. Required. - :type name: str - :return: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam - :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.RedTeam] = kwargs.pop("cls", None) - - _request = build_red_teams_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) - - _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) - - 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() - else: - deserialized = _deserialize(_models.RedTeam, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged["_models.RedTeam"]: - """List a redteam by name. + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Index"]: + """List the latest version of each Index. - :return: An iterator like instance of RedTeam - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.RedTeam] + :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.RedTeam]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Index]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4560,7 +4986,7 @@ def list(self, **kwargs: Any) -> AsyncItemPaged["_models.RedTeam"]: def prepare_request(next_link=None): if not next_link: - _request = build_red_teams_list_request( + _request = build_indexes_list_request( api_version=self._config.api_version, headers=_headers, params=_params, @@ -4596,7 +5022,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.RedTeam], deserialized.get("value", [])) + 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) @@ -4618,61 +5044,17 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - @overload - async def create( - self, red_team: _models.RedTeam, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RedTeam: - """Creates a redteam run. - - :param red_team: Redteam to be run. Required. - :type red_team: ~azure.ai.projects.models.RedTeam - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: - """Creates a redteam run. - - :param red_team: Redteam to be run. Required. - :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 - :return: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create( - self, red_team: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RedTeam: - """Creates a redteam run. - - :param red_team: Redteam to be run. Required. - :type red_team: 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: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models.RedTeam: - """Creates a redteam run. + async def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: + """Get the specific version of the Index. The service returns 404 Not Found error if the Index + does not exist. - :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 + :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 = { @@ -4683,23 +5065,15 @@ async def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwar } 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.RedTeam] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(red_team, (IOBase, bytes)): - _content = red_team - else: - _content = json.dumps(red_team, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.Index] = kwargs.pop("cls", None) - _request = build_red_teams_create_request( - content_type=content_type, + _request = build_indexes_get_request( + name=name, + version=version, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -4715,7 +5089,7 @@ async def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwar 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 @@ -4727,39 +5101,24 @@ async def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwar if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.RedTeam, response.json()) + deserialized = _deserialize(_models.Index, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - -class EvaluationRulesOperations: - """ - .. 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 get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: - """Get an evaluation rule. + async def delete(self, name: str, version: str, **kwargs: Any) -> None: + """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 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 version of the Index to delete. Required. + :type version: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4773,10 +5132,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[None] = kwargs.pop("cls", None) - _request = build_evaluation_rules_get_request( - id=id, + _request = build_indexes_delete_request( + name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4786,45 +5146,107 @@ async def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _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) 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 cls: + return cls(pipeline_response, None, {}) # type: ignore - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.EvaluationRule, response.json()) + @overload + async def create_or_update( + self, + name: str, + version: str, + index: _models.Index, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.Index: + """Create a new or update an existing Index with the given version id. - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + :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: + """ - return deserialized # type: ignore + @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 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 + :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: + """ + + @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 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] + :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_async - async def delete(self, id: str, **kwargs: Any) -> None: - """Delete an evaluation rule. + async def create_or_update( + self, name: str, version: str, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Index: + """Create a new or update an existing Index with the given version id. - :param id: Unique identifier for the evaluation rule. Required. - :type id: str - :return: None - :rtype: None + :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 = { @@ -4835,14 +5257,25 @@ async def delete(self, id: str, **kwargs: Any) -> None: } 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.Index] = kwargs.pop("cls", None) - _request = build_evaluation_rules_delete_request( - id=id, + 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_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, ) @@ -4851,92 +5284,143 @@ async def delete(self, id: str, **kwargs: Any) -> None: } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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, 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) - 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() + else: + deserialized = _deserialize(_models.Index, response.json()) if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class InsightsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`insights` 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_or_update( - self, id: str, evaluation_rule: _models.EvaluationRule, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationRule: - """Create or update an evaluation rule. + async def generate( + self, + insight: _models.Insight, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Insight: + """Generate Insights. - :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 + :param insight: Complete evaluation configuration including data source, evaluators, and result + settings. Required. + :type insight: ~azure.ai.projects.models.Insight + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 :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 + :paramtype content_type: str + :return: Insight. The Insight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Insight :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. + async def generate( + self, + insight: JSON, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Insight: + """Generate Insights. - :param id: Unique identifier for the evaluation rule. Required. - :type id: str - :param evaluation_rule: Evaluation rule resource. Required. - :type evaluation_rule: JSON + :param insight: Complete evaluation configuration including data source, evaluators, and result + settings. Required. + :type insight: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 :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 + :return: Insight. The Insight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Insight :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. + async def generate( + self, + insight: IO[bytes], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Insight: + """Generate Insights. - :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 insight: Complete evaluation configuration including data source, evaluators, and result + settings. Required. + :type insight: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 :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 + :return: Insight. The Insight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Insight :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. + async def generate( + self, + insight: Union[_models.Insight, JSON, IO[bytes]], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + **kwargs: Any + ) -> _models.Insight: + """Generate Insights. - :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 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] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 + :return: Insight. The Insight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4951,17 +5435,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.EvaluationRule] = kwargs.pop("cls", None) + cls: ClsType[_models.Insight] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(evaluation_rule, (IOBase, bytes)): - _content = evaluation_rule + if isinstance(insight, (IOBase, bytes)): + _content = insight else: - _content = json.dumps(evaluation_rule, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(insight, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_evaluation_rules_create_or_update_request( - id=id, + _request = build_insights_generate_request( + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -4980,7 +5464,7 @@ async def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [201]: if _stream: try: await response.read() # Load the body in memory and close the socket @@ -4992,138 +5476,24 @@ async def create_or_update( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.EvaluationRule, response.json()) + deserialized = _deserialize(_models.Insight, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def list( - self, - *, - action_type: Optional[Union[str, _models.EvaluationRuleActionType]] = None, - agent_name: Optional[str] = None, - enabled: Optional[bool] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.EvaluationRule"]: - """List all evaluation rules. - - :keyword action_type: Filter by the type of evaluation rule. Known values are: - "continuousEvaluation" and "humanEvaluation". 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[_models.EvaluationRule]] = 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_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), 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) - - _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) - raise HttpResponseError(response=response) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class EvaluationTaxonomiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`evaluation_taxonomies` 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.EvaluationTaxonomy: - """Get an evaluation run by name. + async def get(self, id: str, *, include_coordinates: Optional[bool] = None, **kwargs: Any) -> _models.Insight: + """Get a specific insight by Id. - :param name: The name of the resource. Required. - :type name: str - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :param id: The unique identifier for the insights report. Required. + :type id: str + :keyword include_coordinates: Whether to include coordinates for visualization in the response. + Defaults to false. Default value is None. + :paramtype include_coordinates: bool + :return: Insight. The Insight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5137,10 +5507,11 @@ async def get(self, name: str, **kwargs: Any) -> _models.EvaluationTaxonomy: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.EvaluationTaxonomy] = kwargs.pop("cls", None) + cls: ClsType[_models.Insight] = kwargs.pop("cls", None) - _request = build_evaluation_taxonomies_get_request( - name=name, + _request = build_insights_get_request( + id=id, + include_coordinates=include_coordinates, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5174,7 +5545,7 @@ async def get(self, name: str, **kwargs: Any) -> _models.EvaluationTaxonomy: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.EvaluationTaxonomy, response.json()) + deserialized = _deserialize(_models.Insight, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -5183,22 +5554,37 @@ async def get(self, name: str, **kwargs: Any) -> _models.EvaluationTaxonomy: @distributed_trace def list( - self, *, input_name: Optional[str] = None, input_type: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.EvaluationTaxonomy"]: - """List evaluation taxonomies. + self, + *, + 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 + ) -> AsyncItemPaged["_models.Insight"]: + """List all insights in reverse chronological order (newest first). - :keyword input_name: Filter by the evaluation input name. Default value is None. - :paramtype input_name: str - :keyword input_type: Filter by taxonomy input type. Default value is None. - :paramtype input_type: str - :return: An iterator like instance of EvaluationTaxonomy - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.EvaluationTaxonomy] + :keyword type: Filter by the type of analysis. Known values are: "EvaluationRunClusterInsight", + "AgentClusterInsight", and "EvaluationComparison". Default value is None. + :paramtype type: str or ~azure.ai.projects.models.InsightType + :keyword eval_id: Filter by the evaluation ID. Default value is None. + :paramtype eval_id: str + :keyword run_id: Filter by the evaluation run ID. Default value is None. + :paramtype run_id: str + :keyword agent_name: Filter by the agent name. Default value is None. + :paramtype agent_name: str + :keyword include_coordinates: Whether to include coordinates for visualization in the response. + Defaults to false. Default value is None. + :paramtype include_coordinates: bool + :return: An iterator like instance of Insight + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Insight] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.EvaluationTaxonomy]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Insight]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5211,9 +5597,12 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_evaluation_taxonomies_list_request( - input_name=input_name, - input_type=input_type, + _request = build_insights_list_request( + type=type, + eval_id=eval_id, + run_id=run_id, + agent_name=agent_name, + include_coordinates=include_coordinates, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5249,7 +5638,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.EvaluationTaxonomy], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.Insight], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -5271,126 +5660,136 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - @distributed_trace_async - async def delete(self, name: str, **kwargs: Any) -> None: - """Delete an evaluation taxonomy by name. - - :param name: The name of the resource. 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_evaluation_taxonomies_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) - raise HttpResponseError(response=response) +class MemoryStoresOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - response_headers = {} - response_headers["x-ms-client-request-id"] = self._deserialize( - "str", response.headers.get("x-ms-client-request-id") - ) + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`memory_stores` attribute. + """ - if cls: - return cls(pipeline_response, None, 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") @overload async def create( - self, name: str, body: _models.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationTaxonomy: - """Create an evaluation taxonomy. + self, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + name: str, + definition: _models.MemoryStoreDefinition, + content_type: str = "application/json", + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Create a memory store. - :param name: The name of the evaluation taxonomy. Required. - :type name: str - :param body: The evaluation taxonomy. Required. - :type body: ~azure.ai.projects.models.EvaluationTaxonomy + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword name: The name of the memory store. Required. + :paramtype name: str + :keyword definition: The memory store definition. Required. + :paramtype definition: ~azure.ai.projects.models.MemoryStoreDefinition :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :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 + value is None. + :paramtype metadata: dict[str, str] + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationTaxonomy: - """Create an evaluation taxonomy. + self, + body: JSON, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Create a memory store. - :param name: The name of the evaluation taxonomy. Required. - :type name: str - :param body: The evaluation taxonomy. Required. + :param body: Required. :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationTaxonomy: - """Create an evaluation taxonomy. + self, + body: IO[bytes], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Create a memory store. - :param name: The name of the evaluation taxonomy. Required. - :type name: str - :param body: The evaluation taxonomy. Required. + :param body: Required. :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create( - self, name: str, body: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any - ) -> _models.EvaluationTaxonomy: - """Create an evaluation taxonomy. + self, + body: Union[JSON, IO[bytes]] = _Unset, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + name: str = _Unset, + definition: _models.MemoryStoreDefinition = _Unset, + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Create a memory store. - :param name: The name of the evaluation taxonomy. Required. - :type name: str - :param body: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, JSON, - IO[bytes] Required. - :type body: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword name: The name of the memory store. Required. + :paramtype name: str + :keyword definition: The memory store definition. Required. + :paramtype definition: ~azure.ai.projects.models.MemoryStoreDefinition + :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 + value is None. + :paramtype metadata: dict[str, str] + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5405,8 +5804,15 @@ async def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EvaluationTaxonomy] = kwargs.pop("cls", None) + cls: ClsType[_models.MemoryStoreDetails] = 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 = {"definition": definition, "description": description, "metadata": metadata, "name": name} + 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)): @@ -5414,8 +5820,8 @@ async def create( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_evaluation_taxonomies_create_request( - name=name, + _request = build_memory_stores_create_request( + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -5434,19 +5840,23 @@ async def create( 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() else: - deserialized = _deserialize(_models.EvaluationTaxonomy, response.json()) + deserialized = _deserialize(_models.MemoryStoreDetails, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5455,71 +5865,116 @@ async def create( @overload async def update( - self, name: str, body: _models.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationTaxonomy: - """Update an evaluation taxonomy. + self, + name: str, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Update a memory store. - :param name: The name of the evaluation taxonomy. Required. + :param name: The name of the memory store to update. Required. :type name: str - :param body: The evaluation taxonomy. Required. - :type body: ~azure.ai.projects.models.EvaluationTaxonomy + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :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 + value is None. + :paramtype metadata: dict[str, str] + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationTaxonomy: - """Update an evaluation taxonomy. + self, + name: str, + body: JSON, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Update a memory store. - :param name: The name of the evaluation taxonomy. Required. + :param name: The name of the memory store to update. Required. :type name: str - :param body: The evaluation taxonomy. Required. + :param body: Required. :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def update( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationTaxonomy: - """Update an evaluation taxonomy. + self, + name: str, + body: IO[bytes], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Update a memory store. - :param name: The name of the evaluation taxonomy. Required. + :param name: The name of the memory store to update. Required. :type name: str - :param body: The evaluation taxonomy. Required. + :param body: Required. :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def update( - self, name: str, body: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any - ) -> _models.EvaluationTaxonomy: - """Update an evaluation taxonomy. + self, + name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Update a memory store. - :param name: The name of the evaluation taxonomy. Required. + :param name: The name of the memory store to update. Required. :type name: str - :param body: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, JSON, - IO[bytes] Required. - :type body: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :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 + value is None. + :paramtype metadata: dict[str, str] + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5534,8 +5989,11 @@ async def update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EvaluationTaxonomy] = kwargs.pop("cls", None) + cls: ClsType[_models.MemoryStoreDetails] = kwargs.pop("cls", None) + if body is _Unset: + body = {"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)): @@ -5543,8 +6001,9 @@ async def update( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_evaluation_taxonomies_update_request( + _request = build_memory_stores_update_request( name=name, + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -5570,65 +6029,37 @@ async def update( 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() else: - deserialized = _deserialize(_models.EvaluationTaxonomy, response.json()) + deserialized = _deserialize(_models.MemoryStoreDetails, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @distributed_trace_async + async def get( + self, name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Retrieve a memory store. -class EvaluatorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`evaluators` 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_versions( - self, - name: str, - *, - type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, - limit: Optional[int] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.EvaluatorVersion"]: - """List all versions of the given evaluator. - - :param name: The name of the resource. Required. + :param name: The name of the memory store to retrieve. Required. :type name: str - :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one - of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default - value is None. - :paramtype type: str or str or str or 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 - :return: An iterator like instance of EvaluatorVersion - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.EvaluatorVersion] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EvaluatorVersion]] = kwargs.pop("cls", None) - error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5637,152 +6068,126 @@ def list_versions( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_evaluators_list_versions_request( - name=name, - type=type, - limit=limit, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": 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), 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[_models.MemoryStoreDetails] = kwargs.pop("cls", None) - return _request + _request = build_memory_stores_get_request( + name=name, + foundry_beta=foundry_beta, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": 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.EvaluatorVersion], deserialized.get("value", [])) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + _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 [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) + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.MemoryStoreDetails, 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 - def list_latest_versions( + def list( self, *, - type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.EvaluatorVersion"]: - """List the latest version of each evaluator. + ) -> AsyncItemPaged["_models.MemoryStoreDetails"]: + """List all memory stores. - :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one - of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default - value is None. - :paramtype type: str or str or str or str + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :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. + 100, and the + default is 20. Default value is None. :paramtype limit: int - :return: An iterator like instance of EvaluatorVersion - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.EvaluatorVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EvaluatorVersion]] = 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_evaluators_list_latest_versions_request( - type=type, - limit=limit, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": 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), 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) + :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 MemoryStoreDetails + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.MemoryStoreDetails] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.MemoryStoreDetails]] = 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_memory_stores_list_request( + foundry_beta=foundry_beta, + 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.EvaluatorVersion], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.MemoryStoreDetails], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + return deserialized.get("last_id") or None, AsyncList(list_of_elem) - async def get_next(next_link=None): - _request = prepare_request(next_link) + 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 @@ -5792,23 +6197,29 @@ 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_async - async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.EvaluatorVersion: - """Get the specific version of the EvaluatorVersion. The service returns 404 Not Found error if - the EvaluatorVersion does not exist. + async def delete( + self, name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **kwargs: Any + ) -> _models.DeleteMemoryStoreResult: + """Delete a memory store. - :param name: The name of the resource. Required. + :param name: The name of the memory store to delete. Required. :type name: str - :param version: The specific version id of the EvaluatorVersion to retrieve. Required. - :type version: str - :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :return: DeleteMemoryStoreResult. The DeleteMemoryStoreResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DeleteMemoryStoreResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5822,11 +6233,11 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.E _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.EvaluatorVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.DeleteMemoryStoreResult] = kwargs.pop("cls", None) - _request = build_evaluators_get_version_request( + _request = build_memory_stores_delete_request( name=name, - version=version, + foundry_beta=foundry_beta, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5850,29 +6261,148 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.E 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() else: - deserialized = _deserialize(_models.EvaluatorVersion, response.json()) + deserialized = _deserialize(_models.DeleteMemoryStoreResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @overload + async def search_memories( + self, + name: str, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + scope: str, + content_type: str = "application/json", + items: Optional[List[_models.InputItem]] = None, + previous_search_id: Optional[str] = None, + options: Optional[_models.MemorySearchOptions] = None, + **kwargs: Any + ) -> _models.MemoryStoreSearchResult: + """Search for relevant memories from a memory store based on conversation context. + + :param name: The name of the memory store to search. Required. + :type name: str + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :paramtype scope: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword items: Items for which to search for relevant memories. Default value is None. + :paramtype items: list[~azure.ai.projects.models.InputItem] + :keyword previous_search_id: The unique ID of the previous search request, enabling incremental + memory search from where the last operation left off. Default value is None. + :paramtype previous_search_id: str + :keyword options: Memory search options. Default value is None. + :paramtype options: ~azure.ai.projects.models.MemorySearchOptions + :return: MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreSearchResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def search_memories( + self, + name: str, + body: JSON, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MemoryStoreSearchResult: + """Search for relevant memories from a memory store based on conversation context. + + :param name: The name of the memory store to search. Required. + :type name: str + :param body: Required. + :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreSearchResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def search_memories( + self, + name: str, + body: IO[bytes], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MemoryStoreSearchResult: + """Search for relevant memories from a memory store based on conversation context. + + :param name: The name of the memory store to search. Required. + :type name: str + :param body: Required. + :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreSearchResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async - async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: - """Delete the specific version of the EvaluatorVersion. The service returns 204 No Content if the - EvaluatorVersion was deleted successfully or if the EvaluatorVersion does not exist. + async def search_memories( + self, + name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + scope: str = _Unset, + items: Optional[List[_models.InputItem]] = None, + previous_search_id: Optional[str] = None, + options: Optional[_models.MemorySearchOptions] = None, + **kwargs: Any + ) -> _models.MemoryStoreSearchResult: + """Search for relevant memories from a memory store based on conversation context. - :param name: The name of the resource. Required. + :param name: The name of the memory store to search. Required. :type name: str - :param version: The version of the EvaluatorVersion to delete. Required. - :type version: str - :return: None - :rtype: None + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :paramtype scope: str + :keyword items: Items for which to search for relevant memories. Default value is None. + :paramtype items: list[~azure.ai.projects.models.InputItem] + :keyword previous_search_id: The unique ID of the previous search request, enabling incremental + memory search from where the last operation left off. Default value is None. + :paramtype previous_search_id: str + :keyword options: Memory search options. Default value is None. + :paramtype options: ~azure.ai.projects.models.MemorySearchOptions + :return: MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreSearchResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5883,15 +6413,122 @@ async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: } 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.MemoryStoreSearchResult] = kwargs.pop("cls", None) + + if body is _Unset: + if scope is _Unset: + raise TypeError("missing required argument: scope") + body = { + "items": items, + "options": options, + "previous_search_id": previous_search_id, + "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 + + _request = build_memory_stores_search_memories_request( + name=name, + foundry_beta=foundry_beta, + 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 = 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() + else: + deserialized = _deserialize(_models.MemoryStoreSearchResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _update_memories_initial( + self, + name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + scope: str = _Unset, + items: Optional[List[_models.InputItem]] = None, + previous_update_id: Optional[str] = None, + update_delay: Optional[int] = None, + **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 {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_evaluators_delete_version_request( + if body is _Unset: + if scope is _Unset: + raise TypeError("missing required argument: scope") + body = { + "items": items, + "previous_update_id": previous_update_id, + "scope": scope, + "update_delay": update_delay, + } + 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_memory_stores_update_memories_request( name=name, - version=version, + foundry_beta=foundry_beta, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -5900,386 +6537,283 @@ 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 + _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 [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) - raise HttpResponseError(response=response) + 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")) + + deserialized = response.iter_bytes() if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @overload - async def create_version( + async def _begin_update_memories( self, name: str, - evaluator_version: _models.EvaluatorVersion, *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + scope: str, content_type: str = "application/json", + items: Optional[List[_models.InputItem]] = None, + previous_update_id: Optional[str] = None, + update_delay: Optional[int] = None, **kwargs: Any - ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. - - :param name: The name of the resource. Required. - :type name: str - :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - + ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload - async def create_version( - self, name: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. - - :param name: The name of the resource. Required. - :type name: str - :param evaluator_version: Evaluator resource. Required. - :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 - :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - + async def _begin_update_memories( + self, + name: str, + body: JSON, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @overload - async def create_version( - self, name: str, evaluator_version: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. - - :param name: The name of the resource. Required. - :type name: str - :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: 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: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ + async def _begin_update_memories( + self, + name: str, + body: IO[bytes], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @distributed_trace_async - async def create_version( - self, name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any - ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + async def _begin_update_memories( + self, + name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + scope: str = _Unset, + items: Optional[List[_models.InputItem]] = None, + previous_update_id: Optional[str] = None, + update_delay: Optional[int] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: + """Update memory store with conversation memories. - :param name: The name of the resource. Required. + :param name: The name of the memory store to update. Required. :type name: 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] - :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :paramtype scope: str + :keyword items: Conversation items from which to extract memories. Default value is None. + :paramtype items: list[~azure.ai.projects.models.InputItem] + :keyword previous_update_id: The unique ID of the previous update request, enabling incremental + memory updates from where the last operation left off. Default value is None. + :paramtype previous_update_id: str + :keyword 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). Default value is None. + :paramtype update_delay: int + :return: An instance of AsyncLROPoller that returns MemoryStoreUpdateCompletedResult. The + MemoryStoreUpdateCompletedResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.ai.projects.models.MemoryStoreUpdateCompletedResult] :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.EvaluatorVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.MemoryStoreUpdateCompletedResult] = 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._update_memories_initial( + name=name, + body=body, + foundry_beta=foundry_beta, + scope=scope, + items=items, + previous_update_id=previous_update_id, + update_delay=update_delay, + 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) - content_type = content_type or "application/json" - _content = None - if isinstance(evaluator_version, (IOBase, bytes)): - _content = evaluator_version - else: - _content = json.dumps(evaluator_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + 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") + ) + + deserialized = _deserialize(_models.MemoryStoreUpdateCompletedResult, response.json().get("result", {})) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized - _request = build_evaluators_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) - _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) - raise HttpResponseError(response=response) - - if _stream: - deserialized = response.iter_bytes() + 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: - deserialized = _deserialize(_models.EvaluatorVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload - async def update_version( + async def delete_scope( self, name: str, - version: str, - evaluator_version: _models.EvaluatorVersion, *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + scope: str, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + ) -> _models.MemoryStoreDeleteScopeResult: + """Delete all memories associated with a specific scope from a memory store. - :param name: The name of the resource. Required. + :param name: The name of the memory store. Required. :type name: str - :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.models.EvaluatorVersion + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword scope: The namespace that logically groups and isolates memories to delete, such as a + user ID. Required. + :paramtype scope: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion + :return: MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDeleteScopeResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def update_version( - self, name: str, version: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + async def delete_scope( + self, + name: str, + body: JSON, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MemoryStoreDeleteScopeResult: + """Delete all memories associated with a specific scope from a memory store. - :param name: The name of the resource. Required. + :param name: The name of the memory store. Required. :type name: str - :param version: The version of the EvaluatorVersion to update. Required. - :type version: str - :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: JSON + :param body: Required. + :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion + :return: MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDeleteScopeResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def update_version( + async def delete_scope( self, name: str, - version: str, - evaluator_version: IO[bytes], + body: IO[bytes], *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + ) -> _models.MemoryStoreDeleteScopeResult: + """Delete all memories associated with a specific scope from a memory store. - :param name: The name of the resource. Required. + :param name: The name of the memory store. Required. :type name: str - :param version: The version of the EvaluatorVersion to update. Required. - :type version: str - :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: IO[bytes] + :param body: Required. + :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion + :return: MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDeleteScopeResult :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def update_version( + async def delete_scope( self, name: str, - version: str, - evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], + body: Union[JSON, IO[bytes]] = _Unset, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + scope: str = _Unset, **kwargs: Any - ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + ) -> _models.MemoryStoreDeleteScopeResult: + """Delete all memories associated with a specific scope from a memory store. - :param name: The name of the resource. Required. + :param name: The name of the memory store. Required. :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] - :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion - :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.EvaluatorVersion] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(evaluator_version, (IOBase, bytes)): - _content = evaluator_version - else: - _content = json.dumps(evaluator_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_evaluators_update_version_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 = 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) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.EvaluatorVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class InsightsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s - :attr:`insights` 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 generate( - self, insight: _models.Insight, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Insight: - """Generate Insights. - - :param insight: Complete evaluation configuration including data source, evaluators, and result - settings. Required. - :type insight: ~azure.ai.projects.models.Insight - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Insight. The Insight is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Insight - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def generate( - self, insight: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Insight: - """Generate Insights. - - :param insight: Complete evaluation configuration including data source, evaluators, and result - settings. Required. - :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 - :return: Insight. The Insight is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Insight - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def generate( - self, insight: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Insight: - """Generate Insights. - - :param insight: Complete evaluation configuration including data source, evaluators, and result - settings. Required. - :type insight: 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: Insight. The Insight is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Insight - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: Any) -> _models.Insight: - """Generate Insights. - - :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] - :return: Insight. The Insight is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Insight + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword scope: The namespace that logically groups and isolates memories to delete, such as a + user ID. Required. + :paramtype scope: str + :return: MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDeleteScopeResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6294,16 +6828,23 @@ async def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwa _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Insight] = kwargs.pop("cls", None) + cls: ClsType[_models.MemoryStoreDeleteScopeResult] = kwargs.pop("cls", 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} content_type = content_type or "application/json" _content = None - if isinstance(insight, (IOBase, bytes)): - _content = insight + if isinstance(body, (IOBase, bytes)): + _content = body else: - _content = json.dumps(insight, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_insights_generate_request( + _request = build_memory_stores_delete_scope_request( + name=name, + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -6322,36 +6863,55 @@ async def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwa 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 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() else: - deserialized = _deserialize(_models.Insight, response.json()) + deserialized = _deserialize(_models.MemoryStoreDeleteScopeResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + +class RedTeamsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.aio.AIProjectClient`'s + :attr:`red_teams` 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, id: str, *, include_coordinates: Optional[bool] = None, **kwargs: Any) -> _models.Insight: - """Get a specific insight by Id. + async def get(self, name: str, **kwargs: Any) -> _models.RedTeam: + """Get a redteam by name. - :param id: The unique identifier for the insights report. Required. - :type id: str - :keyword include_coordinates: Whether to include coordinates for visualization in the response. - Defaults to false. Default value is None. - :paramtype include_coordinates: bool - :return: Insight. The Insight is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Insight + :param name: Identifier of the red team run. Required. + :type name: str + :return: RedTeam. The RedTeam is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6365,11 +6925,10 @@ async def get(self, id: str, *, include_coordinates: Optional[bool] = None, **kw _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Insight] = kwargs.pop("cls", None) + cls: ClsType[_models.RedTeam] = kwargs.pop("cls", None) - _request = build_insights_get_request( - id=id, - include_coordinates=include_coordinates, + _request = build_red_teams_get_request( + name=name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6403,7 +6962,7 @@ async def get(self, id: str, *, include_coordinates: Optional[bool] = None, **kw if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Insight, response.json()) + deserialized = _deserialize(_models.RedTeam, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6411,38 +6970,17 @@ async def get(self, id: str, *, include_coordinates: Optional[bool] = None, **kw return deserialized # type: ignore @distributed_trace - def list( - self, - *, - 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 - ) -> AsyncItemPaged["_models.Insight"]: - """List all insights in reverse chronological order (newest first). + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.RedTeam"]: + """List a redteam by name. - :keyword type: Filter by the type of analysis. Known values are: "EvaluationRunClusterInsight", - "AgentClusterInsight", and "EvaluationComparison". Default value is None. - :paramtype type: str or ~azure.ai.projects.models.InsightType - :keyword eval_id: Filter by the evaluation ID. Default value is None. - :paramtype eval_id: str - :keyword run_id: Filter by the evaluation run ID. Default value is None. - :paramtype run_id: str - :keyword agent_name: Filter by the agent name. Default value is None. - :paramtype agent_name: str - :keyword include_coordinates: Whether to include coordinates for visualization in the response. - Defaults to false. Default value is None. - :paramtype include_coordinates: bool - :return: An iterator like instance of Insight - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Insight] + :return: An iterator like instance of RedTeam + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.RedTeam] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Insight]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RedTeam]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6455,12 +6993,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_insights_list_request( - type=type, - eval_id=eval_id, - run_id=run_id, - agent_name=agent_name, - include_coordinates=include_coordinates, + _request = build_red_teams_list_request( api_version=self._config.api_version, headers=_headers, params=_params, @@ -6496,7 +7029,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.Insight], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.RedTeam], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -6518,6 +7051,162 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) + @overload + async def create( + self, + red_team: _models.RedTeam, + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RedTeam: + """Creates a redteam run. + + :param red_team: Redteam to be run. Required. + :type red_team: ~azure.ai.projects.models.RedTeam + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. RED_TEAMS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.RED_TEAMS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RedTeam. The RedTeam is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.RedTeam + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + red_team: JSON, + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RedTeam: + """Creates a redteam run. + + :param red_team: Redteam to be run. Required. + :type red_team: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. RED_TEAMS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.RED_TEAMS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RedTeam. The RedTeam is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.RedTeam + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + red_team: IO[bytes], + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RedTeam: + """Creates a redteam run. + + :param red_team: Redteam to be run. Required. + :type red_team: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. RED_TEAMS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.RED_TEAMS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: RedTeam. The RedTeam is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.RedTeam + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create( + self, + red_team: Union[_models.RedTeam, JSON, IO[bytes]], + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, + **kwargs: Any + ) -> _models.RedTeam: + """Creates a redteam run. + + :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] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. RED_TEAMS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.RED_TEAMS_V1 + :return: RedTeam. The RedTeam is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.RedTeam + :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.RedTeam] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(red_team, (IOBase, bytes)): + _content = red_team + else: + _content = json.dumps(red_team, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_red_teams_create_request( + foundry_beta=foundry_beta, + 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 = 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() + else: + deserialized = _deserialize(_models.RedTeam, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + class SchedulesOperations: """ @@ -6738,16 +7427,16 @@ async def get_next(next_link=None): @overload async def create_or_update( - self, id: str, schedule: _models.Schedule, *, content_type: str = "application/json", **kwargs: Any + self, id: str, resource: _models.Schedule, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Schedule: - """Create or update a schedule by id. + """Create or update operation template. :param id: Identifier of the schedule. Required. :type id: str - :param schedule: Schedule resource. Required. - :type schedule: ~azure.ai.projects.models.Schedule + :param resource: The resource instance. Required. + :type resource: ~azure.ai.projects.models.Schedule :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: Schedule. The Schedule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Schedule @@ -6756,16 +7445,16 @@ async def create_or_update( @overload async def create_or_update( - self, id: str, schedule: JSON, *, content_type: str = "application/json", **kwargs: Any + self, id: str, resource: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Schedule: - """Create or update a schedule by id. + """Create or update operation template. :param id: Identifier of the schedule. Required. :type id: str - :param schedule: Schedule resource. Required. - :type schedule: JSON + :param resource: The resource instance. Required. + :type resource: 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: Schedule. The Schedule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Schedule @@ -6774,16 +7463,16 @@ async def create_or_update( @overload async def create_or_update( - self, id: str, schedule: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, id: str, resource: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Schedule: - """Create or update a schedule by id. + """Create or update operation template. :param id: Identifier of the schedule. Required. :type id: str - :param schedule: Schedule resource. Required. - :type schedule: IO[bytes] + :param resource: The resource instance. Required. + :type resource: 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: Schedule. The Schedule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Schedule @@ -6792,15 +7481,15 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any + self, id: str, resource: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any ) -> _models.Schedule: - """Create or update a schedule by id. + """Create or update operation template. :param id: Identifier of the schedule. Required. :type id: str - :param schedule: Schedule resource. Is one of the following types: Schedule, JSON, IO[bytes] - Required. - :type schedule: ~azure.ai.projects.models.Schedule or JSON or IO[bytes] + :param resource: The resource instance. Is one of the following types: Schedule, JSON, + IO[bytes] Required. + :type resource: ~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: @@ -6819,12 +7508,12 @@ async def create_or_update( content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/merge-patch+json" _content = None - if isinstance(schedule, (IOBase, bytes)): - _content = schedule + if isinstance(resource, (IOBase, bytes)): + _content = resource else: - _content = json.dumps(schedule, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_schedules_create_or_update_request( id=id, @@ -6855,24 +7544,39 @@ async def create_or_update( 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() else: deserialized = _deserialize(_models.Schedule, 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_run(self, schedule_id: str, run_id: str, **kwargs: Any) -> _models.ScheduleRun: + async def get_run( + self, + schedule_id: str, + run_id: str, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + **kwargs: Any + ) -> _models.ScheduleRun: """Get a schedule run by id. - :param schedule_id: Identifier of the schedule. Required. + :param schedule_id: The unique identifier of the schedule. Required. :type schedule_id: str - :param run_id: Identifier of the schedule run. Required. + :param run_id: The unique identifier of the schedule run. Required. :type run_id: str + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 :return: ScheduleRun. The ScheduleRun is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ScheduleRun :raises ~azure.core.exceptions.HttpResponseError: @@ -6893,6 +7597,7 @@ async def get_run(self, schedule_id: str, run_id: str, **kwargs: Any) -> _models _request = build_schedules_get_run_request( schedule_id=schedule_id, run_id=run_id, + foundry_beta=foundry_beta, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6916,7 +7621,11 @@ async def get_run(self, schedule_id: str, run_id: str, **kwargs: Any) -> _models 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() 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 2537d1bd8040..6e80777a20ed 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 @@ -16,16 +16,16 @@ from ._models import ( # type: ignore A2APreviewTool, AISearchIndexResource, + AgentClusterInsightRequest, AgentClusterInsightResult, - AgentClusterInsightsRequest, AgentDefinition, AgentDetails, - AgentId, AgentObjectVersions, AgentReference, AgentTaxonomyInput, AgentVersionDetails, - AgenticIdentityCredentials, + AgenticIdentityPreviewCredentials, + AgentsPagedResultAgentObject, Annotation, ApiErrorResponse, ApiKeyCredentials, @@ -40,6 +40,7 @@ ApplyPatchUpdateFileOperationParam, ApproximateLocation, AzureAIAgentTarget, + AzureAIModelTarget, AzureAISearchIndex, AzureAISearchTool, AzureAISearchToolResource, @@ -83,7 +84,6 @@ ContainerFileCitationBody, ContinuousEvaluationRuleAction, CosmosDBIndex, - CreatedBy, CronTrigger, CustomCredential, CustomGrammarFormatParam, @@ -104,18 +104,18 @@ EmbeddingConfiguration, EntraIDCredentials, Error, - EvalCompareReport, EvalResult, EvalRunResultCompareItem, EvalRunResultComparison, EvalRunResultSummary, - EvaluationComparisonRequest, + EvaluationComparisonInsightRequest, + EvaluationComparisonInsightResult, EvaluationResultSample, EvaluationRule, EvaluationRuleAction, EvaluationRuleFilter, + EvaluationRunClusterInsightRequest, EvaluationRunClusterInsightResult, - EvaluationRunClusterInsightsRequest, EvaluationScheduleTask, EvaluationTaxonomy, EvaluationTaxonomyInput, @@ -150,7 +150,6 @@ HourlyRecurrenceSchedule, HumanEvaluationRuleAction, HybridSearchOptions, - ImageBasedHostedAgentDefinition, ImageGenTool, ImageGenToolInputImageMask, Index, @@ -245,6 +244,7 @@ MicrosoftFabricPreviewTool, ModelDeployment, ModelDeploymentSku, + ModelSamplingParams, MonthlyRecurrenceSchedule, Move, NoAuthenticationCredentials, @@ -266,7 +266,7 @@ PendingUploadRequest, PendingUploadResponse, PromptAgentDefinition, - PromptAgentDefinitionText, + PromptAgentDefinitionTextOptions, PromptBasedEvaluatorDefinition, ProtocolVersionRecord, RaiConfig, @@ -286,6 +286,8 @@ Scroll, SharepointGroundingToolParameters, SharepointPreviewTool, + SpecificApplyPatchParam, + SpecificFunctionShellParam, StructuredInputDefinition, StructuredOutputDefinition, StructuredOutputsItemResource, @@ -299,6 +301,17 @@ TextResponseFormatConfigurationResponseFormatText, TextResponseFormatJsonSchema, Tool, + ToolChoiceAllowed, + ToolChoiceCodeInterpreter, + ToolChoiceComputerUsePreview, + ToolChoiceCustom, + ToolChoiceFileSearch, + ToolChoiceFunction, + ToolChoiceImageGeneration, + ToolChoiceMCP, + ToolChoiceParam, + ToolChoiceWebSearchPreview, + ToolChoiceWebSearchPreview20250311, ToolDescription, ToolProjectConnection, TopLogProb, @@ -318,8 +331,8 @@ WebSearchTool, WebSearchToolFilters, WeeklyRecurrenceSchedule, - WorkflowActionOutputItemResource, WorkflowAgentDefinition, + WorkflowPreviewActionOutputItemResource, ) from ._enums import ( # type: ignore @@ -354,6 +367,7 @@ EvaluatorMetricDirection, EvaluatorMetricType, EvaluatorType, + FoundryPreviewOptInKeys, FunctionAndCustomToolCallOutputType, FunctionCallItemStatus, FunctionShellCallItemStatus, @@ -387,6 +401,7 @@ ScheduleTaskType, SearchContextSize, TextResponseFormatConfigurationType, + ToolChoiceParamType, ToolType, TreatmentEffectType, TriggerType, @@ -398,16 +413,16 @@ __all__ = [ "A2APreviewTool", "AISearchIndexResource", + "AgentClusterInsightRequest", "AgentClusterInsightResult", - "AgentClusterInsightsRequest", "AgentDefinition", "AgentDetails", - "AgentId", "AgentObjectVersions", "AgentReference", "AgentTaxonomyInput", "AgentVersionDetails", - "AgenticIdentityCredentials", + "AgenticIdentityPreviewCredentials", + "AgentsPagedResultAgentObject", "Annotation", "ApiErrorResponse", "ApiKeyCredentials", @@ -422,6 +437,7 @@ "ApplyPatchUpdateFileOperationParam", "ApproximateLocation", "AzureAIAgentTarget", + "AzureAIModelTarget", "AzureAISearchIndex", "AzureAISearchTool", "AzureAISearchToolResource", @@ -465,7 +481,6 @@ "ContainerFileCitationBody", "ContinuousEvaluationRuleAction", "CosmosDBIndex", - "CreatedBy", "CronTrigger", "CustomCredential", "CustomGrammarFormatParam", @@ -486,18 +501,18 @@ "EmbeddingConfiguration", "EntraIDCredentials", "Error", - "EvalCompareReport", "EvalResult", "EvalRunResultCompareItem", "EvalRunResultComparison", "EvalRunResultSummary", - "EvaluationComparisonRequest", + "EvaluationComparisonInsightRequest", + "EvaluationComparisonInsightResult", "EvaluationResultSample", "EvaluationRule", "EvaluationRuleAction", "EvaluationRuleFilter", + "EvaluationRunClusterInsightRequest", "EvaluationRunClusterInsightResult", - "EvaluationRunClusterInsightsRequest", "EvaluationScheduleTask", "EvaluationTaxonomy", "EvaluationTaxonomyInput", @@ -532,7 +547,6 @@ "HourlyRecurrenceSchedule", "HumanEvaluationRuleAction", "HybridSearchOptions", - "ImageBasedHostedAgentDefinition", "ImageGenTool", "ImageGenToolInputImageMask", "Index", @@ -627,6 +641,7 @@ "MicrosoftFabricPreviewTool", "ModelDeployment", "ModelDeploymentSku", + "ModelSamplingParams", "MonthlyRecurrenceSchedule", "Move", "NoAuthenticationCredentials", @@ -648,7 +663,7 @@ "PendingUploadRequest", "PendingUploadResponse", "PromptAgentDefinition", - "PromptAgentDefinitionText", + "PromptAgentDefinitionTextOptions", "PromptBasedEvaluatorDefinition", "ProtocolVersionRecord", "RaiConfig", @@ -668,6 +683,8 @@ "Scroll", "SharepointGroundingToolParameters", "SharepointPreviewTool", + "SpecificApplyPatchParam", + "SpecificFunctionShellParam", "StructuredInputDefinition", "StructuredOutputDefinition", "StructuredOutputsItemResource", @@ -681,6 +698,17 @@ "TextResponseFormatConfigurationResponseFormatText", "TextResponseFormatJsonSchema", "Tool", + "ToolChoiceAllowed", + "ToolChoiceCodeInterpreter", + "ToolChoiceComputerUsePreview", + "ToolChoiceCustom", + "ToolChoiceFileSearch", + "ToolChoiceFunction", + "ToolChoiceImageGeneration", + "ToolChoiceMCP", + "ToolChoiceParam", + "ToolChoiceWebSearchPreview", + "ToolChoiceWebSearchPreview20250311", "ToolDescription", "ToolProjectConnection", "TopLogProb", @@ -700,8 +728,8 @@ "WebSearchTool", "WebSearchToolFilters", "WeeklyRecurrenceSchedule", - "WorkflowActionOutputItemResource", "WorkflowAgentDefinition", + "WorkflowPreviewActionOutputItemResource", "AgentKind", "AgentProtocol", "AnnotationType", @@ -733,6 +761,7 @@ "EvaluatorMetricDirection", "EvaluatorMetricType", "EvaluatorType", + "FoundryPreviewOptInKeys", "FunctionAndCustomToolCallOutputType", "FunctionCallItemStatus", "FunctionShellCallItemStatus", @@ -766,6 +795,7 @@ "ScheduleTaskType", "SearchContextSize", "TextResponseFormatConfigurationType", + "ToolChoiceParamType", "ToolType", "TreatmentEffectType", "TriggerType", 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 145ae30df168..46424a3df6fc 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -14,69 +15,93 @@ class AgentKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of AgentKind.""" PROMPT = "prompt" + """PROMPT.""" HOSTED = "hosted" + """HOSTED.""" CONTAINER_APP = "container_app" + """CONTAINER_APP.""" WORKFLOW = "workflow" + """WORKFLOW.""" class AgentProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of AgentProtocol.""" ACTIVITY_PROTOCOL = "activity_protocol" + """ACTIVITY_PROTOCOL.""" RESPONSES = "responses" + """RESPONSES.""" class AnnotationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of AnnotationType.""" FILE_CITATION = "file_citation" + """FILE_CITATION.""" URL_CITATION = "url_citation" + """URL_CITATION.""" CONTAINER_FILE_CITATION = "container_file_citation" + """CONTAINER_FILE_CITATION.""" FILE_PATH = "file_path" + """FILE_PATH.""" class ApplyPatchCallOutputStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of ApplyPatchCallOutputStatus.""" COMPLETED = "completed" + """COMPLETED.""" FAILED = "failed" + """FAILED.""" class ApplyPatchCallOutputStatusParam(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Apply patch call output status.""" COMPLETED = "completed" + """COMPLETED.""" FAILED = "failed" + """FAILED.""" class ApplyPatchCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of ApplyPatchCallStatus.""" IN_PROGRESS = "in_progress" + """IN_PROGRESS.""" COMPLETED = "completed" + """COMPLETED.""" class ApplyPatchCallStatusParam(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Apply patch call status.""" IN_PROGRESS = "in_progress" + """IN_PROGRESS.""" COMPLETED = "completed" + """COMPLETED.""" class ApplyPatchFileOperationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of ApplyPatchFileOperationType.""" CREATE_FILE = "create_file" + """CREATE_FILE.""" DELETE_FILE = "delete_file" + """DELETE_FILE.""" UPDATE_FILE = "update_file" + """UPDATE_FILE.""" class ApplyPatchOperationParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of ApplyPatchOperationParamType.""" CREATE_FILE = "create_file" + """CREATE_FILE.""" DELETE_FILE = "delete_file" + """DELETE_FILE.""" UPDATE_FILE = "update_file" + """UPDATE_FILE.""" class AttackStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -154,74 +179,93 @@ class AzureAISearchQueryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Available query types for Azure AI Search tool.""" SIMPLE = "simple" - """Query type ``simple``""" + """Query type ``simple``.""" SEMANTIC = "semantic" - """Query type ``semantic``""" + """Query type ``semantic``.""" VECTOR = "vector" - """Query type ``vector``""" + """Query type ``vector``.""" VECTOR_SIMPLE_HYBRID = "vector_simple_hybrid" - """Query type ``vector_simple_hybrid``""" + """Query type ``vector_simple_hybrid``.""" VECTOR_SEMANTIC_HYBRID = "vector_semantic_hybrid" - """Query type ``vector_semantic_hybrid``""" + """Query type ``vector_semantic_hybrid``.""" class ClickButtonType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of ClickButtonType.""" LEFT = "left" + """LEFT.""" RIGHT = "right" + """RIGHT.""" WHEEL = "wheel" + """WHEEL.""" BACK = "back" + """BACK.""" FORWARD = "forward" + """FORWARD.""" class ComputerActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of ComputerActionType.""" CLICK = "click" + """CLICK.""" DOUBLE_CLICK = "double_click" + """DOUBLE_CLICK.""" DRAG = "drag" + """DRAG.""" KEYPRESS = "keypress" + """KEYPRESS.""" MOVE = "move" + """MOVE.""" SCREENSHOT = "screenshot" + """SCREENSHOT.""" SCROLL = "scroll" + """SCROLL.""" TYPE = "type" + """TYPE.""" WAIT = "wait" + """WAIT.""" class ComputerEnvironment(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of ComputerEnvironment.""" WINDOWS = "windows" + """WINDOWS.""" MAC = "mac" + """MAC.""" LINUX = "linux" + """LINUX.""" UBUNTU = "ubuntu" + """UBUNTU.""" BROWSER = "browser" + """BROWSER.""" class ConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The Type (or category) of the connection.""" AZURE_OPEN_AI = "AzureOpenAI" - """Azure OpenAI Service""" + """Azure OpenAI Service.""" AZURE_BLOB_STORAGE = "AzureBlob" - """Azure Blob Storage, with specified container""" + """Azure Blob Storage, with specified container.""" AZURE_STORAGE_ACCOUNT = "AzureStorageAccount" - """Azure Blob Storage, with container not specified (used by Agents)""" + """Azure Blob Storage, with container not specified (used by Agents).""" AZURE_AI_SEARCH = "CognitiveSearch" - """Azure AI Search""" + """Azure AI Search.""" COSMOS_DB = "CosmosDB" - """CosmosDB""" + """CosmosDB.""" API_KEY = "ApiKey" - """Generic connection that uses API Key authentication""" + """Generic connection that uses API Key authentication.""" APPLICATION_CONFIGURATION = "AppConfig" - """Application Configuration""" + """Application Configuration.""" APPLICATION_INSIGHTS = "AppInsights" - """Application Insights""" + """Application Insights.""" CUSTOM = "CustomKeys" - """Custom Keys""" - REMOTE_TOOL = "RemoteTool" - """Remote tool""" + """Custom Keys.""" + REMOTE_TOOL = "RemoteTool_Preview" + """Remote tool.""" class ContainerLogKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -237,33 +281,39 @@ class ContainerMemoryLimit(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of ContainerMemoryLimit.""" ENUM_1_G = "1g" + """1_G.""" ENUM_4_G = "4g" + """4_G.""" ENUM_16_G = "16g" + """16_G.""" ENUM_64_G = "64g" + """64_G.""" class CredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The credential type used by the connection.""" API_KEY = "ApiKey" - """API Key credential""" + """API Key credential.""" ENTRA_ID = "AAD" - """Entra ID credential (formerly known as AAD)""" + """Entra ID credential (formerly known as AAD).""" SAS = "SAS" - """Shared Access Signature (SAS) credential""" + """Shared Access Signature (SAS) credential.""" CUSTOM = "CustomKeys" - """Custom credential""" + """Custom credential.""" NONE = "None" - """No credential""" - AGENTIC_IDENTITY = "AgenticIdentityToken" - """Agentic identity credential""" + """No credential.""" + AGENTIC_IDENTITY_PREVIEW = "AgenticIdentityToken_Preview" + """Agentic identity credential.""" class CustomToolParamFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of CustomToolParamFormatType.""" TEXT = "text" + """TEXT.""" GRAMMAR = "grammar" + """GRAMMAR.""" class DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -298,15 +348,18 @@ class DeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of DeploymentType.""" MODEL_DEPLOYMENT = "ModelDeployment" - """Model deployment""" + """Model deployment.""" class DetailEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of DetailEnum.""" LOW = "low" + """LOW.""" HIGH = "high" + """HIGH.""" AUTO = "auto" + """AUTO.""" class EvaluationRuleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -331,7 +384,7 @@ class EvaluationTaxonomyInputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of the evaluation taxonomy input.""" AGENT = "agent" - """Agent""" + """Agent.""" POLICY = "policy" """Policy.""" @@ -340,26 +393,26 @@ class EvaluatorCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The category of the evaluator.""" QUALITY = "quality" - """Quality""" + """Quality.""" SAFETY = "safety" - """Risk & Safety""" + """Risk & Safety.""" AGENTS = "agents" - """Agents""" + """Agents.""" class EvaluatorDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of evaluator definition.""" PROMPT = "prompt" - """Prompt-based definition""" + """Prompt-based definition.""" CODE = "code" - """Code-based definition""" + """Code-based definition.""" PROMPT_AND_CODE = "prompt_and_code" - """Prompt & Code Based definition""" + """Prompt & Code Based definition.""" SERVICE = "service" - """Service-based evaluator""" + """Service-based evaluator.""" OPENAI_GRADERS = "openai_graders" - """OpenAI graders""" + """OpenAI graders.""" class EvaluatorMetricDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -368,11 +421,11 @@ class EvaluatorMetricDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ INCREASE = "increase" - """It indicates a higher value is better for this metric""" + """It indicates a higher value is better for this metric.""" DECREASE = "decrease" - """It indicates a lower value is better for this metric""" + """It indicates a lower value is better for this metric.""" NEUTRAL = "neutral" - """It indicates no preference for this metric direction""" + """It indicates no preference for this metric direction.""" class EvaluatorMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -383,88 +436,128 @@ class EvaluatorMetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): CONTINUOUS = "continuous" """Continuous metric representing values in a continuous range.""" BOOLEAN = "boolean" - """Boolean metric representing true/false values""" + """Boolean metric representing true/false values.""" class EvaluatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of the evaluator.""" BUILT_IN = "builtin" - """Built-in evaluator (Microsoft provided)""" + """Built-in evaluator (Microsoft provided).""" CUSTOM = "custom" - """Custom evaluator""" + """Custom evaluator.""" + + +class FoundryPreviewOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of FoundryPreviewOptInKeys.""" + + CONTAINER_AGENTS_V1 = "ContainerAgents=v1" + """CONTAINER_AGENTS_V1.""" + HOSTED_AGENTS_V1 = "HostedAgents=v1" + """HOSTED_AGENTS_V1.""" + WORKFLOW_AGENTS_V1 = "WorkflowAgents=v1" + """WORKFLOW_AGENTS_V1.""" + EVALUATIONS_V1 = "Evaluations=v1" + """EVALUATIONS_V1.""" + RED_TEAMS_V1 = "RedTeams=v1" + """RED_TEAMS_V1.""" + INSIGHTS_V1 = "Insights=v1" + """INSIGHTS_V1.""" + MEMORY_STORES_V1 = "MemoryStores=v1" + """MEMORY_STORES_V1.""" class FunctionAndCustomToolCallOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of FunctionAndCustomToolCallOutputType.""" INPUT_TEXT = "input_text" + """INPUT_TEXT.""" INPUT_IMAGE = "input_image" + """INPUT_IMAGE.""" INPUT_FILE = "input_file" + """INPUT_FILE.""" class FunctionCallItemStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of FunctionCallItemStatus.""" IN_PROGRESS = "in_progress" + """IN_PROGRESS.""" COMPLETED = "completed" + """COMPLETED.""" INCOMPLETE = "incomplete" + """INCOMPLETE.""" class FunctionShellCallItemStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Shell call status.""" IN_PROGRESS = "in_progress" + """IN_PROGRESS.""" COMPLETED = "completed" + """COMPLETED.""" INCOMPLETE = "incomplete" + """INCOMPLETE.""" class FunctionShellCallOutputOutcomeParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of FunctionShellCallOutputOutcomeParamType.""" TIMEOUT = "timeout" + """TIMEOUT.""" EXIT = "exit" + """EXIT.""" class FunctionShellCallOutputOutcomeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of FunctionShellCallOutputOutcomeType.""" TIMEOUT = "timeout" + """TIMEOUT.""" EXIT = "exit" + """EXIT.""" class GrammarSyntax1(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of GrammarSyntax1.""" LARK = "lark" + """LARK.""" REGEX = "regex" + """REGEX.""" class ImageDetail(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of ImageDetail.""" LOW = "low" + """LOW.""" HIGH = "high" + """HIGH.""" AUTO = "auto" + """AUTO.""" class IndexType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of IndexType.""" AZURE_SEARCH = "AzureSearch" - """Azure search""" + """Azure search.""" COSMOS_DB = "CosmosDBNoSqlVectorStore" - """CosmosDB""" + """CosmosDB.""" MANAGED_AZURE_SEARCH = "ManagedAzureSearch" - """Managed Azure Search""" + """Managed Azure Search.""" class InputContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of InputContentType.""" INPUT_TEXT = "input_text" + """INPUT_TEXT.""" INPUT_IMAGE = "input_image" + """INPUT_IMAGE.""" INPUT_FILE = "input_file" + """INPUT_FILE.""" class InputFidelity(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -474,37 +567,64 @@ class InputFidelity(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ HIGH = "high" + """HIGH.""" LOW = "low" + """LOW.""" class InputItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of InputItemType.""" MESSAGE = "message" + """MESSAGE.""" OUTPUT_MESSAGE = "output_message" + """OUTPUT_MESSAGE.""" FILE_SEARCH_CALL = "file_search_call" + """FILE_SEARCH_CALL.""" COMPUTER_CALL = "computer_call" + """COMPUTER_CALL.""" COMPUTER_CALL_OUTPUT = "computer_call_output" + """COMPUTER_CALL_OUTPUT.""" WEB_SEARCH_CALL = "web_search_call" + """WEB_SEARCH_CALL.""" FUNCTION_CALL = "function_call" + """FUNCTION_CALL.""" FUNCTION_CALL_OUTPUT = "function_call_output" + """FUNCTION_CALL_OUTPUT.""" REASONING = "reasoning" + """REASONING.""" COMPACTION = "compaction" + """COMPACTION.""" IMAGE_GENERATION_CALL = "image_generation_call" + """IMAGE_GENERATION_CALL.""" CODE_INTERPRETER_CALL = "code_interpreter_call" + """CODE_INTERPRETER_CALL.""" LOCAL_SHELL_CALL = "local_shell_call" + """LOCAL_SHELL_CALL.""" LOCAL_SHELL_CALL_OUTPUT = "local_shell_call_output" + """LOCAL_SHELL_CALL_OUTPUT.""" SHELL_CALL = "shell_call" + """SHELL_CALL.""" SHELL_CALL_OUTPUT = "shell_call_output" + """SHELL_CALL_OUTPUT.""" APPLY_PATCH_CALL = "apply_patch_call" + """APPLY_PATCH_CALL.""" APPLY_PATCH_CALL_OUTPUT = "apply_patch_call_output" + """APPLY_PATCH_CALL_OUTPUT.""" MCP_LIST_TOOLS = "mcp_list_tools" + """MCP_LIST_TOOLS.""" MCP_APPROVAL_REQUEST = "mcp_approval_request" + """MCP_APPROVAL_REQUEST.""" MCP_APPROVAL_RESPONSE = "mcp_approval_response" + """MCP_APPROVAL_RESPONSE.""" MCP_CALL = "mcp_call" + """MCP_CALL.""" CUSTOM_TOOL_CALL_OUTPUT = "custom_tool_call_output" + """CUSTOM_TOOL_CALL_OUTPUT.""" CUSTOM_TOOL_CALL = "custom_tool_call" + """CUSTOM_TOOL_CALL.""" ITEM_REFERENCE = "item_reference" + """ITEM_REFERENCE.""" class InsightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -522,47 +642,79 @@ class ItemResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of ItemResourceType.""" MESSAGE = "message" + """MESSAGE.""" OUTPUT_MESSAGE = "output_message" + """OUTPUT_MESSAGE.""" FILE_SEARCH_CALL = "file_search_call" + """FILE_SEARCH_CALL.""" COMPUTER_CALL = "computer_call" + """COMPUTER_CALL.""" COMPUTER_CALL_OUTPUT = "computer_call_output" + """COMPUTER_CALL_OUTPUT.""" WEB_SEARCH_CALL = "web_search_call" + """WEB_SEARCH_CALL.""" FUNCTION_CALL = "function_call" + """FUNCTION_CALL.""" FUNCTION_CALL_OUTPUT = "function_call_output" + """FUNCTION_CALL_OUTPUT.""" IMAGE_GENERATION_CALL = "image_generation_call" + """IMAGE_GENERATION_CALL.""" CODE_INTERPRETER_CALL = "code_interpreter_call" + """CODE_INTERPRETER_CALL.""" LOCAL_SHELL_CALL = "local_shell_call" + """LOCAL_SHELL_CALL.""" LOCAL_SHELL_CALL_OUTPUT = "local_shell_call_output" + """LOCAL_SHELL_CALL_OUTPUT.""" SHELL_CALL = "shell_call" + """SHELL_CALL.""" SHELL_CALL_OUTPUT = "shell_call_output" + """SHELL_CALL_OUTPUT.""" APPLY_PATCH_CALL = "apply_patch_call" + """APPLY_PATCH_CALL.""" APPLY_PATCH_CALL_OUTPUT = "apply_patch_call_output" + """APPLY_PATCH_CALL_OUTPUT.""" MCP_LIST_TOOLS = "mcp_list_tools" + """MCP_LIST_TOOLS.""" MCP_APPROVAL_REQUEST = "mcp_approval_request" + """MCP_APPROVAL_REQUEST.""" MCP_APPROVAL_RESPONSE = "mcp_approval_response" + """MCP_APPROVAL_RESPONSE.""" MCP_CALL = "mcp_call" + """MCP_CALL.""" STRUCTURED_OUTPUTS = "structured_outputs" - WORKFLOW_ACTION = "workflow_action" - MEMORY_SEARCH_CALL = "memory_search_call" + """STRUCTURED_OUTPUTS.""" OAUTH_CONSENT_REQUEST = "oauth_consent_request" + """OAUTH_CONSENT_REQUEST.""" + MEMORY_SEARCH_PREVIEW_CALL = "memory_search_preview_call" + """MEMORY_SEARCH_PREVIEW_CALL.""" + WORKFLOW_PREVIEW_ACTION = "workflow_preview_action" + """WORKFLOW_PREVIEW_ACTION.""" class LocalShellCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of LocalShellCallStatus.""" IN_PROGRESS = "in_progress" + """IN_PROGRESS.""" COMPLETED = "completed" + """COMPLETED.""" INCOMPLETE = "incomplete" + """INCOMPLETE.""" class MCPToolCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of MCPToolCallStatus.""" IN_PROGRESS = "in_progress" + """IN_PROGRESS.""" COMPLETED = "completed" + """COMPLETED.""" INCOMPLETE = "incomplete" + """INCOMPLETE.""" CALLING = "calling" + """CALLING.""" FAILED = "failed" + """FAILED.""" class MemoryItemKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -596,10 +748,15 @@ class MemoryStoreUpdateStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Status of a memory store update operation.""" QUEUED = "queued" + """QUEUED.""" IN_PROGRESS = "in_progress" + """IN_PROGRESS.""" COMPLETED = "completed" + """COMPLETED.""" FAILED = "failed" + """FAILED.""" SUPERSEDED = "superseded" + """SUPERSEDED.""" class OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -611,8 +768,11 @@ class OpenApiAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ ANONYMOUS = "anonymous" + """ANONYMOUS.""" PROJECT_CONNECTION = "project_connection" + """PROJECT_CONNECTION.""" MANAGED_IDENTITY = "managed_identity" + """MANAGED_IDENTITY.""" class OperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -634,22 +794,29 @@ class OutputContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of OutputContentType.""" OUTPUT_TEXT = "output_text" + """OUTPUT_TEXT.""" REFUSAL = "refusal" + """REFUSAL.""" REASONING_TEXT = "reasoning_text" + """REASONING_TEXT.""" class OutputMessageContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of OutputMessageContentType.""" OUTPUT_TEXT = "output_text" + """OUTPUT_TEXT.""" REFUSAL = "refusal" + """REFUSAL.""" class PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of PageOrder.""" ASC = "asc" + """ASC.""" DESC = "desc" + """DESC.""" class PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -665,7 +832,9 @@ class RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of RankerVersionType.""" AUTO = "auto" + """AUTO.""" DEFAULT2024_11_15 = "default-2024-11-15" + """DEFAULT2024_11_15.""" class RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -741,44 +910,102 @@ class SearchContextSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of SearchContextSize.""" LOW = "low" + """LOW.""" MEDIUM = "medium" + """MEDIUM.""" HIGH = "high" + """HIGH.""" class TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of TextResponseFormatConfigurationType.""" TEXT = "text" + """TEXT.""" JSON_SCHEMA = "json_schema" + """JSON_SCHEMA.""" JSON_OBJECT = "json_object" + """JSON_OBJECT.""" + + +class ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ToolChoiceParamType.""" + + ALLOWED_TOOLS = "allowed_tools" + """ALLOWED_TOOLS.""" + FUNCTION = "function" + """FUNCTION.""" + MCP = "mcp" + """MCP.""" + CUSTOM = "custom" + """CUSTOM.""" + 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.""" class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of ToolType.""" FUNCTION = "function" + """FUNCTION.""" FILE_SEARCH = "file_search" + """FILE_SEARCH.""" COMPUTER_USE_PREVIEW = "computer_use_preview" + """COMPUTER_USE_PREVIEW.""" WEB_SEARCH = "web_search" + """WEB_SEARCH.""" MCP = "mcp" + """MCP.""" CODE_INTERPRETER = "code_interpreter" + """CODE_INTERPRETER.""" IMAGE_GENERATION = "image_generation" + """IMAGE_GENERATION.""" LOCAL_SHELL = "local_shell" + """LOCAL_SHELL.""" SHELL = "shell" + """SHELL.""" CUSTOM = "custom" + """CUSTOM.""" WEB_SEARCH_PREVIEW = "web_search_preview" + """WEB_SEARCH_PREVIEW.""" APPLY_PATCH = "apply_patch" + """APPLY_PATCH.""" A2A_PREVIEW = "a2a_preview" + """A2A_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.""" 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" - MEMORY_SEARCH = "memory_search" + """OPENAPI.""" class TreatmentEffectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index 148f0517a776..b9cf4ff29817 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 @@ SampleType, ScheduleTaskType, TextResponseFormatConfigurationType, + ToolChoiceParamType, ToolType, TriggerType, ) @@ -66,8 +67,8 @@ class Tool(_Model): "web_search", "mcp", "code_interpreter", "image_generation", "local_shell", "shell", "custom", "web_search_preview", "apply_patch", "a2a_preview", "bing_custom_search_preview", "browser_automation_preview", "fabric_dataagent_preview", "sharepoint_grounding_preview", - "azure_ai_search", "azure_function", "bing_grounding", "capture_structured_outputs", "openapi", - and "memory_search". + "memory_search_preview", "azure_ai_search", "azure_function", "bing_grounding", + "capture_structured_outputs", and "openapi". :vartype type: str or ~azure.ai.projects.models.ToolType """ @@ -77,8 +78,8 @@ class Tool(_Model): \"web_search\", \"mcp\", \"code_interpreter\", \"image_generation\", \"local_shell\", \"shell\", \"custom\", \"web_search_preview\", \"apply_patch\", \"a2a_preview\", \"bing_custom_search_preview\", \"browser_automation_preview\", \"fabric_dataagent_preview\", - \"sharepoint_grounding_preview\", \"azure_ai_search\", \"azure_function\", \"bing_grounding\", - \"capture_structured_outputs\", \"openapi\", and \"memory_search\".""" + \"sharepoint_grounding_preview\", \"memory_search_preview\", \"azure_ai_search\", + \"azure_function\", \"bing_grounding\", \"capture_structured_outputs\", and \"openapi\".""" @overload def __init__( @@ -101,30 +102,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class A2APreviewTool(Tool, discriminator="a2a_preview"): """An agent implementing the A2A protocol. - :ivar type: The type of the tool. Always ``"a2a_preview``. Required. + :ivar type: The type of the tool. Always ``"a2a_preview``. Required. A2A_PREVIEW. :vartype type: str or ~azure.ai.projects.models.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``. + :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 + :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 """ type: Literal[ToolType.A2A_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``\"a2a_preview``. Required.""" + """The type of the tool. Always ``\"a2a_preview``. Required. A2A_PREVIEW.""" base_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Base URL of the agent.""" agent_card_path: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The path to the agent card relative to the ``base_url``. - If not provided, defaults to ``/.well-known/agent-card.json``.""" + """The path to the agent card relative to the ``base_url``. If not provided, defaults to + ``/.well-known/agent-card.json``.""" project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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.""" + """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.""" @overload def __init__( @@ -147,20 +147,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.A2A_PREVIEW # type: ignore -class InsightResult(_Model): - """The result of the insights. +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: - AgentClusterInsightResult, EvalCompareReport, EvaluationRunClusterInsightResult + AgentClusterInsightRequest, EvaluationComparisonInsightRequest, + EvaluationRunClusterInsightRequest - :ivar type: The type of insights result. Required. Known values are: - "EvaluationRunClusterInsight", "AgentClusterInsight", and "EvaluationComparison". + :ivar type: The type of request. Required. Known values are: "EvaluationRunClusterInsight", + "AgentClusterInsight", and "EvaluationComparison". :vartype type: str or ~azure.ai.projects.models.InsightType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of insights result. Required. Known values are: \"EvaluationRunClusterInsight\", + """The type of request. Required. Known values are: \"EvaluationRunClusterInsight\", \"AgentClusterInsight\", and \"EvaluationComparison\".""" @overload @@ -181,27 +182,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentClusterInsightResult(InsightResult, discriminator="AgentClusterInsight"): - """Insights from the agent cluster analysis. +class AgentClusterInsightRequest(InsightRequest, discriminator="AgentClusterInsight"): + """Insights on set of Agent Evaluation Results. - :ivar type: The type of insights result. Required. Cluster Insight on an Agent. + :ivar type: The type of request. Required. Cluster Insight on an Agent. :vartype type: str or ~azure.ai.projects.models.AGENT_CLUSTER_INSIGHT - :ivar cluster_insight: Required. - :vartype cluster_insight: ~azure.ai.projects.models.ClusterInsightResult + :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: ~azure.ai.projects.models.InsightModelConfiguration """ type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of insights result. Required. Cluster Insight on an Agent.""" - cluster_insight: "_models.ClusterInsightResult" = rest_field( - name="clusterInsight", visibility=["read", "create", "update", "delete", "query"] + """The type of request. Required. Cluster Insight on an Agent.""" + agent_name: str = rest_field(name="agentName", visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the agent. Required.""" + model_configuration: Optional["_models.InsightModelConfiguration"] = rest_field( + name="modelConfiguration", visibility=["read", "create", "update", "delete", "query"] ) - """Required.""" + """Configuration of the model used in the insight generation.""" @overload def __init__( self, *, - cluster_insight: "_models.ClusterInsightResult", + agent_name: str, + model_configuration: Optional["_models.InsightModelConfiguration"] = None, ) -> None: ... @overload @@ -216,20 +222,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.AGENT_CLUSTER_INSIGHT # type: ignore -class InsightRequest(_Model): - """The request of the insights report. +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: - AgentClusterInsightsRequest, EvaluationComparisonRequest, EvaluationRunClusterInsightsRequest + AgentClusterInsightResult, EvaluationComparisonInsightResult, EvaluationRunClusterInsightResult - :ivar type: The type of request. Required. Known values are: "EvaluationRunClusterInsight", - "AgentClusterInsight", and "EvaluationComparison". + :ivar type: The type of insights result. Required. Known values are: + "EvaluationRunClusterInsight", "AgentClusterInsight", and "EvaluationComparison". :vartype type: str or ~azure.ai.projects.models.InsightType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of request. Required. Known values are: \"EvaluationRunClusterInsight\", + """The type of insights result. Required. Known values are: \"EvaluationRunClusterInsight\", \"AgentClusterInsight\", and \"EvaluationComparison\".""" @overload @@ -250,32 +256,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentClusterInsightsRequest(InsightRequest, discriminator="AgentClusterInsight"): - """Insights on set of Agent Evaluation Results. +class AgentClusterInsightResult(InsightResult, discriminator="AgentClusterInsight"): + """Insights from the agent cluster analysis. - :ivar type: The type of request. Required. Cluster Insight on an Agent. + :ivar type: The type of insights result. Required. Cluster Insight on an Agent. :vartype type: str or ~azure.ai.projects.models.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: ~azure.ai.projects.models.InsightModelConfiguration + :ivar cluster_insight: Required. + :vartype cluster_insight: ~azure.ai.projects.models.ClusterInsightResult """ type: Literal[InsightType.AGENT_CLUSTER_INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of request. Required. Cluster Insight on an Agent.""" - agent_name: str = rest_field(name="agentName", visibility=["read", "create", "update", "delete", "query"]) - """Identifier for the agent. Required.""" - model_configuration: Optional["_models.InsightModelConfiguration"] = rest_field( - name="modelConfiguration", visibility=["read", "create", "update", "delete", "query"] + """The type of insights result. Required. Cluster Insight on an Agent.""" + cluster_insight: "_models.ClusterInsightResult" = rest_field( + name="clusterInsight", visibility=["read", "create", "update", "delete", "query"] ) - """Configuration of the model used in the insight generation.""" + """Required.""" @overload def __init__( self, *, - agent_name: str, - model_configuration: Optional["_models.InsightModelConfiguration"] = None, + cluster_insight: "_models.ClusterInsightResult", ) -> None: ... @overload @@ -375,18 +376,18 @@ 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: - EntraIDCredentials, AgenticIdentityCredentials, ApiKeyCredentials, CustomCredential, + EntraIDCredentials, AgenticIdentityPreviewCredentials, ApiKeyCredentials, CustomCredential, NoAuthenticationCredentials, SASCredentials :ivar type: The type of credential used by the connection. Required. Known values are: - "ApiKey", "AAD", "SAS", "CustomKeys", "None", and "AgenticIdentityToken". + "ApiKey", "AAD", "SAS", "CustomKeys", "None", and "AgenticIdentityToken_Preview". :vartype type: str or ~azure.ai.projects.models.CredentialType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read"]) """The type of credential used by the connection. Required. Known values are: \"ApiKey\", \"AAD\", - \"SAS\", \"CustomKeys\", \"None\", and \"AgenticIdentityToken\".""" + \"SAS\", \"CustomKeys\", \"None\", and \"AgenticIdentityToken_Preview\".""" @overload def __init__( @@ -406,57 +407,19 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgenticIdentityCredentials(BaseCredentials, discriminator="AgenticIdentityToken"): +class AgenticIdentityPreviewCredentials(BaseCredentials, discriminator="AgenticIdentityToken_Preview"): """Agentic identity credential definition. - :ivar type: The credential type. Required. Agentic identity credential - :vartype type: str or ~azure.ai.projects.models.AGENTIC_IDENTITY - """ - - type: Literal[CredentialType.AGENTIC_IDENTITY] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. Agentic identity 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.AGENTIC_IDENTITY # type: ignore - - -class AgentId(_Model): - """AgentId. - - :ivar type: Required. Default value is "agent_id". - :vartype type: str - :ivar name: The name of the agent. Required. - :vartype name: str - :ivar version: The version identifier of the agent. Required. - :vartype version: str + :ivar type: The credential type. Required. Agentic identity credential. + :vartype type: str or ~azure.ai.projects.models.AGENTIC_IDENTITY_PREVIEW """ - type: Literal["agent_id"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"agent_id\".""" - 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.""" + type: Literal[CredentialType.AGENTIC_IDENTITY_PREVIEW] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. Agentic identity credential.""" @overload def __init__( self, - *, - name: str, - version: str, ) -> None: ... @overload @@ -468,7 +431,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["agent_id"] = "agent_id" + self.type = CredentialType.AGENTIC_IDENTITY_PREVIEW # type: ignore class AgentObjectVersions(_Model): @@ -537,6 +500,51 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["agent_reference"] = "agent_reference" +class AgentsPagedResultAgentObject(_Model): + """The response data for a requested list of items. + + :ivar data: The requested list of items. Required. + :vartype data: list[~azure.ai.projects.models.AgentDetails] + :ivar first_id: The first ID represented in this list. + :vartype first_id: str + :ivar last_id: The last ID represented in this list. + :vartype last_id: str + :ivar has_more: A value indicating whether there are additional values available not captured + in this list. Required. + :vartype has_more: bool + """ + + data: list["_models.AgentDetails"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The requested list of items. Required.""" + first_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The first ID represented in this list.""" + last_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The last ID represented in this list.""" + has_more: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A value indicating whether there are additional values available not captured in this list. + Required.""" + + @overload + def __init__( + self, + *, + data: list["_models.AgentDetails"], + has_more: bool, + first_id: Optional[str] = None, + last_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 EvaluationTaxonomyInput(_Model): """Input configuration for the evaluation taxonomy. @@ -573,17 +581,17 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: 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 + :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.AzureAIAgentTarget + :vartype target: ~azure.ai.projects.models.Target :ivar risk_categories: List of risk categories to evaluate against. Required. :vartype risk_categories: list[str or ~azure.ai.projects.models.RiskCategory] """ 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.AzureAIAgentTarget" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Input type of the evaluation taxonomy. Required. Agent.""" + target: "_models.Target" = 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"] @@ -594,7 +602,7 @@ class AgentTaxonomyInput(EvaluationTaxonomyInput, discriminator="agent"): def __init__( self, *, - target: "_models.AzureAIAgentTarget", + target: "_models.Target", risk_categories: list[Union[str, "_models.RiskCategory"]], ) -> None: ... @@ -813,14 +821,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ApiKeyCredentials(BaseCredentials, discriminator="ApiKey"): """API Key Credential definition. - :ivar type: The credential type. Required. API Key credential + :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 """ type: Literal[CredentialType.API_KEY] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. API Key credential""" + """The credential type. Required. API Key credential.""" api_key: Optional[str] = rest_field(name="key", visibility=["read"]) """API Key.""" @@ -876,7 +884,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ApplyPatchCreateFileOperation(ApplyPatchFileOperation, discriminator="create_file"): """Apply patch create file operation. - :ivar type: Create a new file with the provided diff. Required. + :ivar type: Create a new file with the provided diff. Required. CREATE_FILE. :vartype type: str or ~azure.ai.projects.models.CREATE_FILE :ivar path: Path of the file to create. Required. :vartype path: str @@ -885,7 +893,7 @@ class ApplyPatchCreateFileOperation(ApplyPatchFileOperation, discriminator="crea """ type: Literal[ApplyPatchFileOperationType.CREATE_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Create a new file with the provided diff. Required.""" + """Create a new file with the provided diff. Required. CREATE_FILE.""" path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Path of the file to create. Required.""" diff: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -947,7 +955,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ApplyPatchCreateFileOperationParam(ApplyPatchOperationParam, discriminator="create_file"): """Apply patch create file operation. - :ivar type: The operation type. Always ``create_file``. Required. + :ivar type: The operation type. Always ``create_file``. Required. CREATE_FILE. :vartype type: str or ~azure.ai.projects.models.CREATE_FILE :ivar path: Path of the file to create relative to the workspace root. Required. :vartype path: str @@ -956,7 +964,7 @@ class ApplyPatchCreateFileOperationParam(ApplyPatchOperationParam, discriminator """ type: Literal[ApplyPatchOperationParamType.CREATE_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The operation type. Always ``create_file``. Required.""" + """The operation type. Always ``create_file``. Required. CREATE_FILE.""" path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Path of the file to create relative to the workspace root. Required.""" diff: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -985,14 +993,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ApplyPatchDeleteFileOperation(ApplyPatchFileOperation, discriminator="delete_file"): """Apply patch delete file operation. - :ivar type: Delete the specified file. Required. + :ivar type: Delete the specified file. Required. DELETE_FILE. :vartype type: str or ~azure.ai.projects.models.DELETE_FILE :ivar path: Path of the file to delete. Required. :vartype path: str """ type: Literal[ApplyPatchFileOperationType.DELETE_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Delete the specified file. Required.""" + """Delete the specified file. Required. DELETE_FILE.""" path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Path of the file to delete. Required.""" @@ -1018,14 +1026,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ApplyPatchDeleteFileOperationParam(ApplyPatchOperationParam, discriminator="delete_file"): """Apply patch delete file operation. - :ivar type: The operation type. Always ``delete_file``. Required. + :ivar type: The operation type. Always ``delete_file``. Required. DELETE_FILE. :vartype type: str or ~azure.ai.projects.models.DELETE_FILE :ivar path: Path of the file to delete relative to the workspace root. Required. :vartype path: str """ type: Literal[ApplyPatchOperationParamType.DELETE_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The operation type. Always ``delete_file``. Required.""" + """The operation type. Always ``delete_file``. Required. DELETE_FILE.""" path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Path of the file to delete relative to the workspace root. Required.""" @@ -1051,12 +1059,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ApplyPatchToolParam(Tool, discriminator="apply_patch"): """Apply patch tool. - :ivar type: The type of the tool. Always ``apply_patch``. Required. + :ivar type: The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH. :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH """ 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.""" + """The type of the tool. Always ``apply_patch``. Required. APPLY_PATCH.""" @overload def __init__( @@ -1078,7 +1086,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ApplyPatchUpdateFileOperation(ApplyPatchFileOperation, discriminator="update_file"): """Apply patch update file operation. - :ivar type: Update an existing file with the provided diff. Required. + :ivar type: Update an existing file with the provided diff. Required. UPDATE_FILE. :vartype type: str or ~azure.ai.projects.models.UPDATE_FILE :ivar path: Path of the file to update. Required. :vartype path: str @@ -1087,7 +1095,7 @@ class ApplyPatchUpdateFileOperation(ApplyPatchFileOperation, discriminator="upda """ type: Literal[ApplyPatchFileOperationType.UPDATE_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Update an existing file with the provided diff. Required.""" + """Update an existing file with the provided diff. Required. UPDATE_FILE.""" path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Path of the file to update. Required.""" diff: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -1116,7 +1124,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ApplyPatchUpdateFileOperationParam(ApplyPatchOperationParam, discriminator="update_file"): """Apply patch update file operation. - :ivar type: The operation type. Always ``update_file``. Required. + :ivar type: The operation type. Always ``update_file``. Required. UPDATE_FILE. :vartype type: str or ~azure.ai.projects.models.UPDATE_FILE :ivar path: Path of the file to update relative to the workspace root. Required. :vartype path: str @@ -1125,7 +1133,7 @@ class ApplyPatchUpdateFileOperationParam(ApplyPatchOperationParam, discriminator """ type: Literal[ApplyPatchOperationParamType.UPDATE_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The operation type. Always ``update_file``. Required.""" + """The operation type. Always ``update_file``. Required. UPDATE_FILE.""" path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Path of the file to update relative to the workspace root. Required.""" diff: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -1276,6 +1284,48 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = "azure_ai_agent" # type: ignore +class AzureAIModelTarget(Target, 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 + "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["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 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: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = "azure_ai_model" # type: ignore + + class Index(_Model): """Index resource Definition. @@ -1345,7 +1395,7 @@ class AzureAISearchIndex(Index, discriminator="AzureSearch"): :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 + :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 @@ -1356,7 +1406,7 @@ class AzureAISearchIndex(Index, discriminator="AzureSearch"): """ type: Literal[IndexType.AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of index. Required. Azure search""" + """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"]) @@ -1390,14 +1440,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: 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. + :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 azure_ai_search: The azure ai search index resource. Required. :vartype azure_ai_search: ~azure.ai.projects.models.AzureAISearchToolResource """ 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.""" + """The object type, which is always 'azure_ai_search'. Required. AZURE_AI_SEARCH.""" azure_ai_search: "_models.AzureAISearchToolResource" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -1425,16 +1475,16 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: 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 attached to the agent. Required. + :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] """ 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.""" + """The indices attached to this agent. There can be a maximum of 1 index resource attached to the + agent. Required.""" @overload def __init__( @@ -1549,7 +1599,7 @@ class AzureFunctionDefinitionFunction(_Model): :vartype description: str :ivar parameters: The parameters the functions accepts, described as a JSON Schema object. Required. - :vartype parameters: any + :vartype parameters: dict[str, any] """ name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -1557,7 +1607,7 @@ class AzureFunctionDefinitionFunction(_Model): 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: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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 @@ -1565,7 +1615,7 @@ def __init__( self, *, name: str, - parameters: Any, + parameters: dict[str, Any], description: Optional[str] = None, ) -> None: ... @@ -1617,14 +1667,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: 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. + :ivar type: The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION. :vartype type: str or ~azure.ai.projects.models.AZURE_FUNCTION :ivar azure_function: The Azure Function Tool definition. Required. :vartype azure_function: ~azure.ai.projects.models.AzureFunctionDefinition """ 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.""" + """The object type, which is always 'browser_automation'. Required. AZURE_FUNCTION.""" azure_function: "_models.AzureFunctionDefinition" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -1779,13 +1829,15 @@ class BingCustomSearchPreviewTool(Tool, discriminator="bing_custom_search_previe """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: 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 """ 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.""" + """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"] ) @@ -1814,16 +1866,15 @@ class BingCustomSearchToolParameters(_Model): """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. + maximum of 1 connection resource attached to the tool. Required. :vartype search_configurations: list[~azure.ai.projects.models.BingCustomSearchConfiguration] """ 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.""" + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool. Required.""" @overload def __init__( @@ -1897,8 +1948,7 @@ class BingGroundingSearchToolParameters(_Model): """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. + maximum of 1 search configuration resource attached to the tool. Required. :vartype search_configurations: list[~azure.ai.projects.models.BingGroundingSearchConfiguration] """ @@ -1906,8 +1956,8 @@ class BingGroundingSearchToolParameters(_Model): search_configurations: list["_models.BingGroundingSearchConfiguration"] = 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 search configurations attached to this tool. There can be a maximum of 1 search + configuration resource attached to the tool. Required.""" @overload def __init__( @@ -1931,14 +1981,14 @@ class BingGroundingTool(Tool, discriminator="bing_grounding"): """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. + :ivar type: The object type, which is always 'bing_grounding'. Required. BING_GROUNDING. :vartype type: str or ~azure.ai.projects.models.BING_GROUNDING :ivar bing_grounding: The bing grounding search tool parameters. Required. :vartype bing_grounding: ~azure.ai.projects.models.BingGroundingSearchToolParameters """ 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.""" + """The object type, which is always 'bing_grounding'. Required. BING_GROUNDING.""" bing_grounding: "_models.BingGroundingSearchToolParameters" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -2030,13 +2080,15 @@ class BrowserAutomationPreviewTool(Tool, discriminator="browser_automation_previ """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 """ 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.""" + """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"] ) @@ -2125,13 +2177,15 @@ class CaptureStructuredOutputsTool(Tool, discriminator="capture_structured_outpu """A tool for capturing structured outputs. :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 outputs: The structured outputs to capture from the model. Required. :vartype outputs: ~azure.ai.projects.models.StructuredOutputDefinition """ 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.""" + """The type of the tool. Always ``capture_structured_outputs``. Required. + CAPTURE_STRUCTURED_OUTPUTS.""" outputs: "_models.StructuredOutputDefinition" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -2329,7 +2383,7 @@ class ClickParam(ComputerAction, discriminator="click"): """Click. :ivar type: Specifies the event type. For a click action, this property is always ``click``. - Required. + Required. CLICK. :vartype type: str or ~azure.ai.projects.models.CLICK :ivar button: Indicates which mouse button was pressed during the click. One of ``left``, ``right``, ``wheel``, ``back``, or ``forward``. Required. Known values are: "left", "right", @@ -2342,7 +2396,8 @@ class ClickParam(ComputerAction, discriminator="click"): """ type: Literal[ComputerActionType.CLICK] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Specifies the event type. For a click action, this property is always ``click``. Required.""" + """Specifies the event type. For a click action, this property is always ``click``. Required. + CLICK.""" button: Union[str, "_models.ClickButtonType"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -2507,10 +2562,10 @@ class EvaluatorDefinition(_Model): :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: any + :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: any + :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] """ @@ -2519,10 +2574,10 @@ class EvaluatorDefinition(_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\", and \"openai_graders\".""" - init_parameters: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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( @@ -2535,8 +2590,8 @@ def __init__( self, *, type: str, - init_parameters: Optional[Any] = None, - data_schema: Optional[Any] = None, + init_parameters: Optional[dict[str, Any]] = None, + data_schema: Optional[dict[str, Any]] = None, metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, ) -> None: ... @@ -2556,20 +2611,20 @@ class CodeBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="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: any + :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: any + :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 + :ivar type: Required. Code-based definition. :vartype type: str or ~azure.ai.projects.models.CODE :ivar code_text: Inline code text for the evaluator. Required. :vartype code_text: str """ type: Literal[EvaluatorDefinitionType.CODE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Code-based definition""" + """Required. Code-based definition.""" code_text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Inline code text for the evaluator. Required.""" @@ -2578,8 +2633,8 @@ def __init__( self, *, code_text: str, - init_parameters: Optional[Any] = None, - data_schema: Optional[Any] = None, + init_parameters: Optional[dict[str, Any]] = None, + data_schema: Optional[dict[str, Any]] = None, metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, ) -> None: ... @@ -2705,29 +2760,30 @@ class CodeInterpreterTool(Tool, discriminator="code_interpreter"): """Code interpreter. :ivar type: The type of the code interpreter tool. Always ``code_interpreter``. Required. + CODE_INTERPRETER. :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER :ivar 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. Required. Is either a str type or a + 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 CodeInterpreterContainerAuto type. :vartype container: str or ~azure.ai.projects.models.CodeInterpreterContainerAuto """ 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.""" - container: Union[str, "_models.CodeInterpreterContainerAuto"] = rest_field( + """The type of the code interpreter tool. Always ``code_interpreter``. Required. CODE_INTERPRETER.""" + container: Optional[Union[str, "_models.CodeInterpreterContainerAuto"]] = 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. Required. Is either a str type or a - CodeInterpreterContainerAuto type.""" + """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 CodeInterpreterContainerAuto + type.""" @overload def __init__( self, *, - container: Union[str, "_models.CodeInterpreterContainerAuto"], + container: Optional[Union[str, "_models.CodeInterpreterContainerAuto"]] = None, ) -> None: ... @overload @@ -2887,8 +2943,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ComputerScreenshotImage(_Model): """A computer screenshot image used with the computer use tool. - :ivar type: Specifies the event type. For a computer screenshot, this property is - always set to ``computer_screenshot``. Required. Default value is "computer_screenshot". + :ivar type: Specifies the event type. For a computer screenshot, this property is always set to + ``computer_screenshot``. Required. Default value is "computer_screenshot". :vartype type: str :ivar image_url: The URL of the screenshot image. :vartype image_url: str @@ -2897,8 +2953,8 @@ class ComputerScreenshotImage(_Model): """ type: Literal["computer_screenshot"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Specifies the event type. For a computer screenshot, this property is - always set to ``computer_screenshot``. Required. Default value is \"computer_screenshot\".""" + """Specifies the event type. For a computer screenshot, this property is always set to + ``computer_screenshot``. Required. Default value is \"computer_screenshot\".""" image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The URL of the screenshot image.""" file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -2928,6 +2984,7 @@ class ComputerUsePreviewTool(Tool, discriminator="computer_use_preview"): """Computer use preview. :ivar type: The type of the computer use tool. Always ``computer_use_preview``. Required. + COMPUTER_USE_PREVIEW. :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW :ivar environment: The type of computer environment to control. Required. Known values are: "windows", "mac", "linux", "ubuntu", and "browser". @@ -2939,7 +2996,8 @@ class ComputerUsePreviewTool(Tool, discriminator="computer_use_preview"): """ 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.""" + """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"] ) @@ -2980,7 +3038,7 @@ class Connection(_Model): :vartype id: str :ivar type: Category of the connection. Required. Known values are: "AzureOpenAI", "AzureBlob", "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", "AppConfig", "AppInsights", - "CustomKeys", and "RemoteTool". + "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 @@ -3000,7 +3058,7 @@ class Connection(_Model): 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\".""" + \"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"]) @@ -3016,7 +3074,7 @@ class ContainerAppAgentDefinition(AgentDefinition, discriminator="container_app" :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. :vartype rai_config: ~azure.ai.projects.models.RaiConfig - :ivar kind: Required. + :ivar kind: Required. CONTAINER_APP. :vartype kind: str or ~azure.ai.projects.models.CONTAINER_APP :ivar container_protocol_versions: The protocols that the agent supports for ingress communication of the containers. Required. @@ -3031,7 +3089,7 @@ class ContainerAppAgentDefinition(AgentDefinition, discriminator="container_app" """ kind: Literal[AgentKind.CONTAINER_APP] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" + """Required. CONTAINER_APP.""" container_protocol_versions: list["_models.ProtocolVersionRecord"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -3070,7 +3128,7 @@ class ContainerFileCitationBody(Annotation, discriminator="container_file_citati """Container file citation. :ivar type: The type of the container file citation. Always ``container_file_citation``. - Required. + Required. CONTAINER_FILE_CITATION. :vartype type: str or ~azure.ai.projects.models.CONTAINER_FILE_CITATION :ivar container_id: The ID of the container file. Required. :vartype container_id: str @@ -3087,7 +3145,8 @@ class ContainerFileCitationBody(Annotation, discriminator="container_file_citati """ type: Literal[AnnotationType.CONTAINER_FILE_CITATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the container file citation. Always ``container_file_citation``. Required.""" + """The type of the container file citation. Always ``container_file_citation``. Required. + CONTAINER_FILE_CITATION.""" container_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The ID of the container file. Required.""" file_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -3209,7 +3268,7 @@ class CosmosDBIndex(Index, discriminator="CosmosDBNoSqlVectorStore"): :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 + :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 @@ -3224,7 +3283,7 @@ class CosmosDBIndex(Index, discriminator="CosmosDBNoSqlVectorStore"): """ type: Literal[IndexType.COSMOS_DB] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of index. Required. CosmosDB""" + """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"]) @@ -3263,39 +3322,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = IndexType.COSMOS_DB # type: ignore -class CreatedBy(_Model): - """CreatedBy. - - :ivar agent: The agent that created the item. - :vartype agent: ~azure.ai.projects.models.AgentId - :ivar response_id: The response on which the item is created. - :vartype response_id: str - """ - - agent: Optional["_models.AgentId"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The agent that created the item.""" - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The response on which the item is created.""" - - @overload - def __init__( - self, - *, - agent: Optional["_models.AgentId"] = 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 Trigger(_Model): """Base model for Trigger of the schedule. @@ -3380,12 +3406,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class CustomCredential(BaseCredentials, discriminator="CustomKeys"): """Custom credential definition. - :ivar type: The credential type. Required. Custom credential + :ivar type: The credential type. Required. Custom credential. :vartype type: str or ~azure.ai.projects.models.CUSTOM """ type: Literal[CredentialType.CUSTOM] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. Custom credential""" + """The credential type. Required. Custom credential.""" @overload def __init__( @@ -3439,7 +3465,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class CustomGrammarFormatParam(CustomToolParamFormat, discriminator="grammar"): """Grammar format. - :ivar type: Grammar format. Always ``grammar``. Required. + :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". @@ -3449,7 +3475,7 @@ class CustomGrammarFormatParam(CustomToolParamFormat, discriminator="grammar"): """ type: Literal[CustomToolParamFormatType.GRAMMAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Grammar format. Always ``grammar``. Required.""" + """Grammar format. Always ``grammar``. Required. GRAMMAR.""" syntax: Union[str, "_models.GrammarSyntax1"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -3481,12 +3507,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class CustomTextFormatParam(CustomToolParamFormat, discriminator="text"): """Text format. - :ivar type: Unconstrained text format. Always ``text``. Required. + :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.""" + """Unconstrained text format. Always ``text``. Required. TEXT.""" @overload def __init__( @@ -3508,7 +3534,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class CustomToolParam(Tool, discriminator="custom"): """Custom tool. - :ivar type: The type of the custom tool. Always ``custom``. 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 @@ -3519,7 +3545,7 @@ class CustomToolParam(Tool, discriminator="custom"): """ 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.""" + """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"]) @@ -3885,7 +3911,7 @@ class DoubleClickAction(ComputerAction, discriminator="double_click"): """DoubleClick. :ivar type: Specifies the event type. For a double click action, this property is always set to - ``double_click``. Required. + ``double_click``. Required. DOUBLE_CLICK. :vartype type: str or ~azure.ai.projects.models.DOUBLE_CLICK :ivar x: The x-coordinate where the double click occurred. Required. :vartype x: int @@ -3895,7 +3921,7 @@ class DoubleClickAction(ComputerAction, discriminator="double_click"): type: Literal[ComputerActionType.DOUBLE_CLICK] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Specifies the event type. For a double click action, this property is always set to - ``double_click``. Required.""" + ``double_click``. Required. DOUBLE_CLICK.""" x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The x-coordinate where the double click occurred. Required.""" y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -3924,8 +3950,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Drag(ComputerAction, discriminator="drag"): """Drag. - :ivar type: Specifies the event type. For a drag action, this property is - always set to ``drag``. Required. + :ivar type: Specifies the event type. For a drag action, this property is always set to + ``drag``. Required. DRAG. :vartype type: str or ~azure.ai.projects.models.DRAG :ivar path: An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg @@ -3940,8 +3966,8 @@ class Drag(ComputerAction, discriminator="drag"): """ type: Literal[ComputerActionType.DRAG] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Specifies the event type. For a drag action, this property is - always set to ``drag``. Required.""" + """Specifies the event type. For a drag action, this property is always set to ``drag``. Required. + DRAG.""" path: list["_models.DragPoint"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg @@ -4006,9 +4032,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class InputItem(_Model): - """An item representing part of the context for the response to be - generated by the model. Can contain text, images, and audio inputs, - as well as previous assistant responses and tool call outputs. + """An item representing part of the context for the response to be generated by the model. Can + contain text, images, and audio inputs, as well as previous assistant responses and tool call + outputs. You probably want to use the sub-classes and not this class directly. Known sub-classes are: InputItemApplyPatchToolCallItemParam, InputItemApplyPatchToolCallOutputItemParam, @@ -4063,17 +4089,16 @@ class EasyInputMessage(InputItem, discriminator="message"): """Input message. :ivar role: The role of the message input. One of ``user``, ``assistant``, ``system``, or - ``developer``. Required. Is one of the following types: Literal["user"], - Literal["assistant"], Literal["system"], Literal["developer"] + ``developer``. Required. Is one of the following types: Literal["user"], Literal["assistant"], + Literal["system"], Literal["developer"] :vartype role: str or str or str or str - :ivar content: Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. Required. Is either a str type or a - [InputContent] type. + :ivar content: Text, image, or audio input to the model, used to generate a response. Can also + contain previous assistant responses. Required. Is either a str type or a [InputContent] type. :vartype content: str or list[~azure.ai.projects.models.InputContent] - :ivar type: The type of the message input. Always ``message``. Required. + :ivar type: The type of the message input. Always ``message``. Required. MESSAGE. :vartype type: str or ~azure.ai.projects.models.MESSAGE - :ivar status: The status of item. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when items are returned via API. Is one of the following types: + :ivar status: The status of item. One of ``in_progress``, ``completed``, or ``incomplete``. + Populated when items are returned via API. Is one of the following types: Literal["in_progress"], Literal["completed"], Literal["incomplete"] :vartype status: str or str or str """ @@ -4081,23 +4106,22 @@ class EasyInputMessage(InputItem, discriminator="message"): role: Literal["user", "assistant", "system", "developer"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The role of the message input. One of ``user``, ``assistant``, ``system``, or - ``developer``. Required. Is one of the following types: Literal[\"user\"], - Literal[\"assistant\"], Literal[\"system\"], Literal[\"developer\"]""" + """The role of the message input. One of ``user``, ``assistant``, ``system``, or ``developer``. + Required. Is one of the following types: Literal[\"user\"], Literal[\"assistant\"], + Literal[\"system\"], Literal[\"developer\"]""" content: Union[str, list["_models.InputContent"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. Required. Is either a str type or a - [InputContent] type.""" + """Text, image, or audio input to the model, used to generate a response. Can also contain + previous assistant responses. Required. Is either a str type or a [InputContent] type.""" type: Literal[InputItemType.MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the message input. Always ``message``. Required.""" + """The type of the message input. Always ``message``. Required. MESSAGE.""" status: Optional[Literal["in_progress", "completed", "incomplete"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of item. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when items are returned via API. Is one of the following types: - Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" + """The status of item. One of ``in_progress``, ``completed``, or ``incomplete``. Populated when + items are returned via API. Is one of the following types: Literal[\"in_progress\"], + Literal[\"completed\"], Literal[\"incomplete\"]""" @overload def __init__( @@ -4158,12 +4182,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class EntraIDCredentials(BaseCredentials, discriminator="AAD"): """Entra ID credential definition. - :ivar type: The credential type. Required. Entra ID credential (formerly known as AAD) + :ivar type: The credential type. Required. Entra ID credential (formerly known as AAD). :vartype type: str or ~azure.ai.projects.models.ENTRA_ID """ type: Literal[CredentialType.ENTRA_ID] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. Entra ID credential (formerly known as AAD)""" + """The credential type. Required. Entra ID credential (formerly known as AAD).""" @overload def __init__( @@ -4241,46 +4265,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvalCompareReport(InsightResult, discriminator="EvaluationComparison"): - """Insights from the evaluation comparison. - - :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: 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, - *, - comparisons: list["_models.EvalRunResultComparison"], - method: 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 = InsightType.EVALUATION_COMPARISON # type: ignore - - class EvalResult(_Model): """Result of the evaluation. @@ -4479,7 +4463,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationComparisonRequest(InsightRequest, discriminator="EvaluationComparison"): +class EvaluationComparisonInsightRequest(InsightRequest, discriminator="EvaluationComparison"): """Evaluation Comparison Request. :ivar type: The type of request. Required. Evaluation Comparison. @@ -4524,6 +4508,46 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.EVALUATION_COMPARISON # type: ignore +class EvaluationComparisonInsightResult(InsightResult, discriminator="EvaluationComparison"): + """Insights from the evaluation comparison. + + :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: 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, + *, + comparisons: list["_models.EvalRunResultComparison"], + method: 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 = InsightType.EVALUATION_COMPARISON # type: ignore + + class InsightSample(_Model): """A sample from the analysis. @@ -4714,27 +4738,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluationRunClusterInsightResult(InsightResult, discriminator="EvaluationRunClusterInsight"): - """Insights from the evaluation run cluster analysis. +class EvaluationRunClusterInsightRequest(InsightRequest, discriminator="EvaluationRunClusterInsight"): + """Insights on set of Evaluation Results. - :ivar type: The type of insights result. Required. Insights on an Evaluation run result. + :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 cluster_insight: Required. - :vartype cluster_insight: ~azure.ai.projects.models.ClusterInsightResult + :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[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"] + """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"] ) - """Required.""" + """Configuration of the model used in the insight generation.""" @overload def __init__( self, *, - cluster_insight: "_models.ClusterInsightResult", + eval_id: str, + run_ids: list[str], + model_configuration: Optional["_models.InsightModelConfiguration"] = None, ) -> None: ... @overload @@ -4749,37 +4783,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InsightType.EVALUATION_RUN_CLUSTER_INSIGHT # type: ignore -class EvaluationRunClusterInsightsRequest(InsightRequest, discriminator="EvaluationRunClusterInsight"): - """Insights on set of Evaluation Results. +class EvaluationRunClusterInsightResult(InsightResult, discriminator="EvaluationRunClusterInsight"): + """Insights from the evaluation run cluster analysis. - :ivar type: The type of insights request. Required. Insights on an Evaluation run result. + :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 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 cluster_insight: Required. + :vartype cluster_insight: ~azure.ai.projects.models.ClusterInsightResult """ 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"] + """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"] ) - """Configuration of the model used in the insight generation.""" + """Required.""" @overload def __init__( self, *, - eval_id: str, - run_ids: list[str], - model_configuration: Optional["_models.InsightModelConfiguration"] = None, + cluster_insight: "_models.ClusterInsightResult", ) -> None: ... @overload @@ -5008,9 +5032,9 @@ class EvaluatorVersion(_Model): :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: int + :vartype created_at: str :ivar modified_at: Last modified date/time of the evaluator. Required. - :vartype modified_at: int + :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. @@ -5038,9 +5062,9 @@ class EvaluatorVersion(_Model): """Definition of the evaluator. Required.""" created_by: str = rest_field(visibility=["read"]) """Creator of the evaluator. Required.""" - created_at: int = rest_field(visibility=["read"]) + created_at: str = rest_field(visibility=["read"]) """Creation date/time of the evaluator. Required.""" - modified_at: int = rest_field(visibility=["read"]) + modified_at: str = rest_field(visibility=["read"]) """Last modified date/time of the evaluator. Required.""" id: Optional[str] = rest_field(visibility=["read"]) """Asset ID, a unique identifier for the asset.""" @@ -5081,16 +5105,15 @@ class FabricDataAgentToolParameters(_Model): """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. + 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.""" + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool.""" @overload def __init__( @@ -5166,7 +5189,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FileCitationBody(Annotation, discriminator="file_citation"): """File citation. - :ivar type: The type of the file citation. Always ``file_citation``. Required. + :ivar type: The type of the file citation. Always ``file_citation``. Required. FILE_CITATION. :vartype type: str or ~azure.ai.projects.models.FILE_CITATION :ivar file_id: The ID of the file. Required. :vartype file_id: str @@ -5177,7 +5200,7 @@ class FileCitationBody(Annotation, discriminator="file_citation"): """ type: Literal[AnnotationType.FILE_CITATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the file citation. Always ``file_citation``. Required.""" + """The type of the file citation. Always ``file_citation``. Required. FILE_CITATION.""" file_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The ID of the file. Required.""" index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -5261,7 +5284,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FilePath(Annotation, discriminator="file_path"): """File path. - :ivar type: The type of the file path. Always ``file_path``. Required. + :ivar type: The type of the file path. Always ``file_path``. Required. FILE_PATH. :vartype type: str or ~azure.ai.projects.models.FILE_PATH :ivar file_id: The ID of the file. Required. :vartype file_id: str @@ -5270,7 +5293,7 @@ class FilePath(Annotation, discriminator="file_path"): """ type: Literal[AnnotationType.FILE_PATH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the file path. Always ``file_path``. Required.""" + """The type of the file path. Always ``file_path``. Required. FILE_PATH.""" file_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The ID of the file. Required.""" index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -5299,7 +5322,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FileSearchTool(Tool, discriminator="file_search"): """File search. - :ivar type: The type of the file search tool. Always ``file_search``. Required. + :ivar type: The type of the file search tool. Always ``file_search``. Required. FILE_SEARCH. :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH :ivar vector_store_ids: The IDs of the vector stores to search. Required. :vartype vector_store_ids: list[str] @@ -5314,7 +5337,7 @@ class FileSearchTool(Tool, discriminator="file_search"): """ 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.""" + """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"]) @@ -5323,9 +5346,7 @@ class FileSearchTool(Tool, discriminator="file_search"): visibility=["read", "create", "update", "delete", "query"] ) """Ranking options for search.""" - filters: Optional[Union["_models.ComparisonFilter", "_models.CompoundFilter"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + filters: Optional["_types.Filters"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Is either a ComparisonFilter type or a CompoundFilter type.""" @overload @@ -5335,7 +5356,7 @@ def __init__( vector_store_ids: list[str], max_num_results: Optional[int] = None, ranking_options: Optional["_models.RankingOptions"] = None, - filters: Optional[Union["_models.ComparisonFilter", "_models.CompoundFilter"]] = None, + filters: Optional["_types.Filters"] = None, ) -> None: ... @overload @@ -5486,7 +5507,7 @@ class FunctionAndCustomToolCallOutputInputFileContent( ): # pylint: disable=name-too-long """Input file. - :ivar type: The type of the input item. Always ``input_file``. Required. + :ivar type: The type of the input item. Always ``input_file``. Required. INPUT_FILE. :vartype type: str or ~azure.ai.projects.models.INPUT_FILE :ivar file_id: :vartype file_id: str @@ -5499,7 +5520,7 @@ class FunctionAndCustomToolCallOutputInputFileContent( """ type: Literal[FunctionAndCustomToolCallOutputType.INPUT_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the input item. Always ``input_file``. Required.""" + """The type of the input item. Always ``input_file``. Required. INPUT_FILE.""" file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) filename: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The name of the file to be sent to the model.""" @@ -5535,7 +5556,7 @@ class FunctionAndCustomToolCallOutputInputImageContent( ): # pylint: disable=name-too-long """Input image. - :ivar type: The type of the input item. Always ``input_image``. Required. + :ivar type: The type of the input item. Always ``input_image``. Required. INPUT_IMAGE. :vartype type: str or ~azure.ai.projects.models.INPUT_IMAGE :ivar image_url: :vartype image_url: str @@ -5547,7 +5568,7 @@ class FunctionAndCustomToolCallOutputInputImageContent( """ type: Literal[FunctionAndCustomToolCallOutputType.INPUT_IMAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the input item. Always ``input_image``. Required.""" + """The type of the input item. Always ``input_image``. Required. INPUT_IMAGE.""" image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) detail: Union[str, "_models.ImageDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -5580,14 +5601,14 @@ class FunctionAndCustomToolCallOutputInputTextContent( ): # pylint: disable=name-too-long """Input text. - :ivar type: The type of the input item. Always ``input_text``. Required. + :ivar type: The type of the input item. Always ``input_text``. Required. INPUT_TEXT. :vartype type: str or ~azure.ai.projects.models.INPUT_TEXT :ivar text: The text input to the model. Required. :vartype text: str """ type: Literal[FunctionAndCustomToolCallOutputType.INPUT_TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the input item. Always ``input_text``. Required.""" + """The type of the input item. Always ``input_text``. Required. INPUT_TEXT.""" text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The text input to the model. Required.""" @@ -5707,9 +5728,7 @@ class FunctionShellCallOutputContent(_Model): ) """Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. Required.""" - created_by: Optional[str] = rest_field( # pyright: ignore[reportIncompatibleVariableOverride] - visibility=["read", "create", "update", "delete", "query"] - ) + created_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The identifier of the actor that created the item.""" @overload @@ -5808,14 +5827,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FunctionShellCallOutputExitOutcome(FunctionShellCallOutputOutcome, discriminator="exit"): """Shell call exit outcome. - :ivar type: The outcome type. Always ``exit``. Required. + :ivar type: The outcome type. Always ``exit``. Required. EXIT. :vartype type: str or ~azure.ai.projects.models.EXIT :ivar exit_code: Exit code from the shell process. Required. :vartype exit_code: int """ type: Literal[FunctionShellCallOutputOutcomeType.EXIT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The outcome type. Always ``exit``. Required.""" + """The outcome type. Always ``exit``. Required. EXIT.""" exit_code: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Exit code from the shell process. Required.""" @@ -5873,14 +5892,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FunctionShellCallOutputExitOutcomeParam(FunctionShellCallOutputOutcomeParam, discriminator="exit"): """Shell call exit outcome. - :ivar type: The outcome type. Always ``exit``. Required. + :ivar type: The outcome type. Always ``exit``. Required. EXIT. :vartype type: str or ~azure.ai.projects.models.EXIT :ivar exit_code: The exit code returned by the shell process. Required. :vartype exit_code: int """ type: Literal[FunctionShellCallOutputOutcomeParamType.EXIT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The outcome type. Always ``exit``. Required.""" + """The outcome type. Always ``exit``. Required. EXIT.""" exit_code: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The exit code returned by the shell process. Required.""" @@ -5906,12 +5925,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FunctionShellCallOutputTimeoutOutcome(FunctionShellCallOutputOutcome, discriminator="timeout"): """Shell call timeout outcome. - :ivar type: The outcome type. Always ``timeout``. Required. + :ivar type: The outcome type. Always ``timeout``. Required. TIMEOUT. :vartype type: str or ~azure.ai.projects.models.TIMEOUT """ type: Literal[FunctionShellCallOutputOutcomeType.TIMEOUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The outcome type. Always ``timeout``. Required.""" + """The outcome type. Always ``timeout``. Required. TIMEOUT.""" @overload def __init__( @@ -5935,12 +5954,12 @@ class FunctionShellCallOutputTimeoutOutcomeParam( ): # pylint: disable=name-too-long """Shell call timeout outcome. - :ivar type: The outcome type. Always ``timeout``. Required. + :ivar type: The outcome type. Always ``timeout``. Required. TIMEOUT. :vartype type: str or ~azure.ai.projects.models.TIMEOUT """ type: Literal[FunctionShellCallOutputOutcomeParamType.TIMEOUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The outcome type. Always ``timeout``. Required.""" + """The outcome type. Always ``timeout``. Required. TIMEOUT.""" @overload def __init__( @@ -5962,12 +5981,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FunctionShellToolParam(Tool, discriminator="shell"): """Shell tool. - :ivar type: The type of the shell tool. Always ``shell``. Required. + :ivar type: The type of the shell tool. Always ``shell``. Required. SHELL. :vartype type: str or ~azure.ai.projects.models.SHELL """ 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.""" + """The type of the shell tool. Always ``shell``. Required. SHELL.""" @overload def __init__( @@ -5989,7 +6008,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class FunctionTool(Tool, discriminator="function"): """Function. - :ivar type: The type of the function tool. Always ``function``. Required. + :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 @@ -6002,7 +6021,7 @@ class FunctionTool(Tool, discriminator="function"): """ type: Literal[ToolType.FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the function tool. Always ``function``. Required.""" + """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"]) @@ -6036,16 +6055,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class HostedAgentDefinition(AgentDefinition, discriminator="hosted"): """The hosted agent definition. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ImageBasedHostedAgentDefinition - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. :vartype rai_config: ~azure.ai.projects.models.RaiConfig - :ivar kind: Required. + :ivar kind: Required. HOSTED. :vartype kind: str or ~azure.ai.projects.models.HOSTED :ivar tools: An array of tools the hosted agent's model may call while generating a response. - You - can specify which tool to use by setting the ``tool_choice`` parameter. + You can specify which tool to use by setting the ``tool_choice`` parameter. :vartype tools: list[~azure.ai.projects.models.Tool] :ivar container_protocol_versions: The protocols that the agent supports for ingress communication of the containers. Required. @@ -6056,14 +6071,15 @@ class HostedAgentDefinition(AgentDefinition, discriminator="hosted"): :vartype memory: str :ivar environment_variables: Environment variables to set in the hosted agent container. :vartype environment_variables: dict[str, str] + :ivar image: The image ID for the agent, applicable to image-based hosted agents. + :vartype image: str """ - __mapping__: dict[str, _Model] = {} kind: Literal[AgentKind.HOSTED] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" + """Required. HOSTED.""" tools: Optional[list["_models.Tool"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An array of tools the hosted agent's model may call while generating a response. You - can specify which tool to use by setting the ``tool_choice`` parameter.""" + """An array of tools the hosted agent's model may call while generating a response. You can + specify which tool to use by setting the ``tool_choice`` parameter.""" container_protocol_versions: list["_models.ProtocolVersionRecord"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -6076,6 +6092,8 @@ class HostedAgentDefinition(AgentDefinition, discriminator="hosted"): visibility=["read", "create", "update", "delete", "query"] ) """Environment variables to set in the hosted agent container.""" + image: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The image ID for the agent, applicable to image-based hosted agents.""" @overload def __init__( @@ -6087,6 +6105,7 @@ def __init__( rai_config: Optional["_models.RaiConfig"] = None, tools: Optional[list["_models.Tool"]] = None, environment_variables: Optional[dict[str, str]] = None, + image: Optional[str] = None, ) -> None: ... @overload @@ -6194,68 +6213,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ImageBasedHostedAgentDefinition(HostedAgentDefinition, discriminator="hosted"): - """The image-based deployment definition for a hosted agent. - - :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. - :vartype rai_config: ~azure.ai.projects.models.RaiConfig - :ivar tools: An array of tools the hosted agent's 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 container_protocol_versions: The protocols that the agent supports for ingress - communication of the containers. Required. - :vartype container_protocol_versions: list[~azure.ai.projects.models.ProtocolVersionRecord] - :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 kind: Required. - :vartype kind: str or ~azure.ai.projects.models.HOSTED - :ivar image: The image for the hosted agent. Required. - :vartype image: str - """ - - image: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The image for the hosted agent. Required.""" - - @overload - def __init__( - self, - *, - container_protocol_versions: list["_models.ProtocolVersionRecord"], - cpu: str, - memory: str, - image: str, - rai_config: Optional["_models.RaiConfig"] = None, - tools: Optional[list["_models.Tool"]] = None, - environment_variables: 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 ImageGenTool(Tool, discriminator="image_generation"): """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"], str :vartype model: 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"] + :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 image. One of ``1024x1024``, ``1024x1536``, ``1536x1024``, or ``auto``. Default: ``auto``. Is one of the following types: @@ -6270,14 +6239,14 @@ class ImageGenTool(Tool, discriminator="image_generation"): :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"] + :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). + :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. @@ -6285,7 +6254,7 @@ class ImageGenTool(Tool, discriminator="image_generation"): """ type: Literal[ToolType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the image generation tool. Always ``image_generation``. Required.""" + """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"], str]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -6293,21 +6262,20 @@ class ImageGenTool(Tool, discriminator="image_generation"): 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\"]""" + """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[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The size of the generated image. One of ``1024x1024``, ``1024x1536``, - ``1536x1024``, or ``auto``. Default: ``auto``. Is one of the following types: - Literal[\"1024x1024\"], Literal[\"1024x1536\"], Literal[\"1536x1024\"], Literal[\"auto\"]""" + """The size of the generated image. One of ``1024x1024``, ``1024x1536``, ``1536x1024``, or + ``auto``. Default: ``auto``. Is one of the following types: Literal[\"1024x1024\"], + Literal[\"1024x1536\"], Literal[\"1536x1024\"], Literal[\"auto\"]""" 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\"]""" + """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( @@ -6318,9 +6286,9 @@ class ImageGenTool(Tool, discriminator="image_generation"): 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\"]""" + """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"] ) @@ -6328,8 +6296,8 @@ class ImageGenTool(Tool, discriminator="image_generation"): 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).""" + """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.""" @@ -6427,7 +6395,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class InputContentInputFileContent(InputContent, discriminator="input_file"): """Input file. - :ivar type: The type of the input item. Always ``input_file``. Required. + :ivar type: The type of the input item. Always ``input_file``. Required. INPUT_FILE. :vartype type: str or ~azure.ai.projects.models.INPUT_FILE :ivar file_id: :vartype file_id: str @@ -6440,7 +6408,7 @@ class InputContentInputFileContent(InputContent, discriminator="input_file"): """ type: Literal[InputContentType.INPUT_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the input item. Always ``input_file``. Required.""" + """The type of the input item. Always ``input_file``. Required. INPUT_FILE.""" file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) filename: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The name of the file to be sent to the model.""" @@ -6474,7 +6442,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class InputContentInputImageContent(InputContent, discriminator="input_image"): """Input image. - :ivar type: The type of the input item. Always ``input_image``. Required. + :ivar type: The type of the input item. Always ``input_image``. Required. INPUT_IMAGE. :vartype type: str or ~azure.ai.projects.models.INPUT_IMAGE :ivar image_url: :vartype image_url: str @@ -6486,7 +6454,7 @@ class InputContentInputImageContent(InputContent, discriminator="input_image"): """ type: Literal[InputContentType.INPUT_IMAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the input item. Always ``input_image``. Required.""" + """The type of the input item. Always ``input_image``. Required. INPUT_IMAGE.""" image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) detail: Union[str, "_models.ImageDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -6517,14 +6485,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class InputContentInputTextContent(InputContent, discriminator="input_text"): """Input text. - :ivar type: The type of the input item. Always ``input_text``. Required. + :ivar type: The type of the input item. Always ``input_text``. Required. INPUT_TEXT. :vartype type: str or ~azure.ai.projects.models.INPUT_TEXT :ivar text: The text input to the model. Required. :vartype text: str """ type: Literal[InputContentType.INPUT_TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the input item. Always ``input_text``. Required.""" + """The type of the input item. Always ``input_text``. Required. INPUT_TEXT.""" text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The text input to the model. Required.""" @@ -6639,7 +6607,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class InputItemApplyPatchToolCallItemParam(InputItem, discriminator="apply_patch_call"): """Apply patch tool call. - :ivar type: The type of the item. Always ``apply_patch_call``. Required. + :ivar type: The type of the item. Always ``apply_patch_call``. Required. APPLY_PATCH_CALL. :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH_CALL :ivar id: :vartype id: str @@ -6654,7 +6622,7 @@ class InputItemApplyPatchToolCallItemParam(InputItem, discriminator="apply_patch """ type: Literal[InputItemType.APPLY_PATCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``apply_patch_call``. Required.""" + """The type of the item. Always ``apply_patch_call``. Required. APPLY_PATCH_CALL.""" id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the apply patch tool call generated by the model. Required.""" @@ -6696,6 +6664,7 @@ class InputItemApplyPatchToolCallOutputItemParam( """Apply patch tool call output. :ivar type: The type of the item. Always ``apply_patch_call_output``. Required. + APPLY_PATCH_CALL_OUTPUT. :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH_CALL_OUTPUT :ivar id: :vartype id: str @@ -6709,7 +6678,7 @@ class InputItemApplyPatchToolCallOutputItemParam( """ type: Literal[InputItemType.APPLY_PATCH_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``apply_patch_call_output``. Required.""" + """The type of the item. Always ``apply_patch_call_output``. Required. APPLY_PATCH_CALL_OUTPUT.""" id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the apply patch tool call generated by the model. Required.""" @@ -6746,7 +6715,7 @@ class InputItemCodeInterpreterToolCall(InputItem, discriminator="code_interprete """Code interpreter tool call. :ivar type: The type of the code interpreter tool call. Always ``code_interpreter_call``. - Required. + Required. CODE_INTERPRETER_CALL. :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER_CALL :ivar id: The unique ID of the code interpreter tool call. Required. :vartype id: str @@ -6765,7 +6734,8 @@ class InputItemCodeInterpreterToolCall(InputItem, discriminator="code_interprete """ type: Literal[InputItemType.CODE_INTERPRETER_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the code interpreter tool call. Always ``code_interpreter_call``. Required.""" + """The type of the code interpreter tool call. Always ``code_interpreter_call``. Required. + CODE_INTERPRETER_CALL.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the code interpreter tool call. Required.""" status: Literal["in_progress", "completed", "incomplete", "interpreting", "failed"] = rest_field( @@ -6812,7 +6782,7 @@ class InputItemCompactionSummaryItemParam(InputItem, discriminator="compaction") :ivar id: :vartype id: str - :ivar type: The type of the item. Always ``compaction``. Required. + :ivar type: The type of the item. Always ``compaction``. Required. COMPACTION. :vartype type: str or ~azure.ai.projects.models.COMPACTION :ivar encrypted_content: The encrypted content of the compaction summary. Required. :vartype encrypted_content: str @@ -6820,7 +6790,7 @@ class InputItemCompactionSummaryItemParam(InputItem, discriminator="compaction") id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) type: Literal[InputItemType.COMPACTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``compaction``. Required.""" + """The type of the item. Always ``compaction``. Required. COMPACTION.""" encrypted_content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The encrypted content of the compaction summary. Required.""" @@ -6852,7 +6822,7 @@ class InputItemComputerCallOutputItemParam(InputItem, discriminator="computer_ca :ivar call_id: The ID of the computer tool call that produced the output. Required. :vartype call_id: str :ivar type: The type of the computer tool call output. Always ``computer_call_output``. - Required. + Required. COMPUTER_CALL_OUTPUT. :vartype type: str or ~azure.ai.projects.models.COMPUTER_CALL_OUTPUT :ivar output: Required. :vartype output: ~azure.ai.projects.models.ComputerScreenshotImage @@ -6867,7 +6837,8 @@ class InputItemComputerCallOutputItemParam(InputItem, discriminator="computer_ca call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The ID of the computer tool call that produced the output. Required.""" type: Literal[InputItemType.COMPUTER_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the computer tool call output. Always ``computer_call_output``. Required.""" + """The type of the computer tool call output. Always ``computer_call_output``. Required. + COMPUTER_CALL_OUTPUT.""" output: "_models.ComputerScreenshotImage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" acknowledged_safety_checks: Optional[list["_models.ComputerCallSafetyCheckParam"]] = rest_field( @@ -6904,7 +6875,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class InputItemComputerToolCall(InputItem, discriminator="computer_call"): """Computer tool call. - :ivar type: The type of the computer call. Always ``computer_call``. Required. + :ivar type: The type of the computer call. Always ``computer_call``. Required. COMPUTER_CALL. :vartype type: str or ~azure.ai.projects.models.COMPUTER_CALL :ivar id: The unique ID of the computer call. Required. :vartype id: str @@ -6914,14 +6885,14 @@ class InputItemComputerToolCall(InputItem, discriminator="computer_call"): :vartype action: ~azure.ai.projects.models.ComputerAction :ivar pending_safety_checks: The pending safety checks for the computer call. Required. :vartype pending_safety_checks: list[~azure.ai.projects.models.ComputerCallSafetyCheckParam] - :ivar status: The status of the item. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when items are returned via API. Required. Is one of the following - types: Literal["in_progress"], Literal["completed"], Literal["incomplete"] + :ivar status: The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. + Populated when items are returned via API. Required. Is one of the following types: + Literal["in_progress"], Literal["completed"], Literal["incomplete"] :vartype status: str or str or str """ type: Literal[InputItemType.COMPUTER_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the computer call. Always ``computer_call``. Required.""" + """The type of the computer call. Always ``computer_call``. Required. COMPUTER_CALL.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the computer call. Required.""" call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -6935,9 +6906,9 @@ class InputItemComputerToolCall(InputItem, discriminator="computer_call"): status: Literal["in_progress", "completed", "incomplete"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of the item. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when items are returned via API. Required. Is one of the following - types: Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" + """The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. Populated + when items are returned via API. Required. Is one of the following types: + Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" @overload def __init__( @@ -6966,6 +6937,7 @@ class InputItemCustomToolCall(InputItem, discriminator="custom_tool_call"): """Custom tool call. :ivar type: The type of the custom tool call. Always ``custom_tool_call``. Required. + CUSTOM_TOOL_CALL. :vartype type: str or ~azure.ai.projects.models.CUSTOM_TOOL_CALL :ivar id: The unique ID of the custom tool call in the OpenAI platform. :vartype id: str @@ -6978,7 +6950,7 @@ class InputItemCustomToolCall(InputItem, discriminator="custom_tool_call"): """ type: Literal[InputItemType.CUSTOM_TOOL_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the custom tool call. Always ``custom_tool_call``. Required.""" + """The type of the custom tool call. Always ``custom_tool_call``. Required. CUSTOM_TOOL_CALL.""" id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the custom tool call in the OpenAI platform.""" call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -7014,21 +6986,22 @@ class InputItemCustomToolCallOutput(InputItem, discriminator="custom_tool_call_o """Custom tool call output. :ivar type: The type of the custom tool call output. Always ``custom_tool_call_output``. - Required. + Required. CUSTOM_TOOL_CALL_OUTPUT. :vartype type: str or ~azure.ai.projects.models.CUSTOM_TOOL_CALL_OUTPUT :ivar id: The unique ID of the custom tool call output in the OpenAI platform. :vartype id: str :ivar call_id: The call ID, used to map this custom tool call output to a custom tool call. Required. :vartype call_id: str - :ivar output: The output from the custom tool call generated by your code. - Can be a string or an list of output content. Required. Is either a str type or a + :ivar output: The output from the custom tool call generated by your code. Can be a string or + an list of output content. Required. Is either a str type or a [FunctionAndCustomToolCallOutput] type. :vartype output: str or list[~azure.ai.projects.models.FunctionAndCustomToolCallOutput] """ type: Literal[InputItemType.CUSTOM_TOOL_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the custom tool call output. Always ``custom_tool_call_output``. Required.""" + """The type of the custom tool call output. Always ``custom_tool_call_output``. Required. + CUSTOM_TOOL_CALL_OUTPUT.""" id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the custom tool call output in the OpenAI platform.""" call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -7036,9 +7009,8 @@ class InputItemCustomToolCallOutput(InputItem, discriminator="custom_tool_call_o output: Union[str, list["_models.FunctionAndCustomToolCallOutput"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The output from the custom tool call generated by your code. - Can be a string or an list of output content. Required. Is either a str type or a - [FunctionAndCustomToolCallOutput] type.""" + """The output from the custom tool call generated by your code. Can be a string or an list of + output content. Required. Is either a str type or a [FunctionAndCustomToolCallOutput] type.""" @overload def __init__( @@ -7067,11 +7039,11 @@ class InputItemFileSearchToolCall(InputItem, discriminator="file_search_call"): :ivar id: The unique ID of the file search tool call. Required. :vartype id: str :ivar type: The type of the file search tool call. Always ``file_search_call``. Required. + FILE_SEARCH_CALL. :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH_CALL - :ivar status: The status of the file search tool call. One of ``in_progress``, - ``searching``, ``incomplete`` or ``failed``,. Required. Is one of the following types: - Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["incomplete"], - Literal["failed"] + :ivar status: The status of the file search tool call. One of ``in_progress``, ``searching``, + ``incomplete`` or ``failed``,. Required. Is one of the following types: Literal["in_progress"], + Literal["searching"], Literal["completed"], Literal["incomplete"], Literal["failed"] :vartype status: str or str or str or str or str :ivar queries: The queries used to search for files. Required. :vartype queries: list[str] @@ -7082,14 +7054,13 @@ class InputItemFileSearchToolCall(InputItem, discriminator="file_search_call"): id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the file search tool call. Required.""" type: Literal[InputItemType.FILE_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the file search tool call. Always ``file_search_call``. Required.""" + """The type of the file search tool call. Always ``file_search_call``. Required. FILE_SEARCH_CALL.""" status: Literal["in_progress", "searching", "completed", "incomplete", "failed"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of the file search tool call. One of ``in_progress``, - ``searching``, ``incomplete`` or ``failed``,. Required. Is one of the following types: - Literal[\"in_progress\"], Literal[\"searching\"], Literal[\"completed\"], - Literal[\"incomplete\"], Literal[\"failed\"]""" + """The status of the file search tool call. One of ``in_progress``, ``searching``, ``incomplete`` + or ``failed``,. Required. Is one of the following types: Literal[\"in_progress\"], + Literal[\"searching\"], Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"failed\"]""" queries: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The queries used to search for files. Required.""" results: Optional[list["_models.FileSearchToolCallResults"]] = rest_field( @@ -7126,7 +7097,7 @@ class InputItemFunctionCallOutputItemParam(InputItem, discriminator="function_ca :ivar call_id: The unique ID of the function tool call generated by the model. Required. :vartype call_id: str :ivar type: The type of the function tool call output. Always ``function_call_output``. - Required. + Required. FUNCTION_CALL_OUTPUT. :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL_OUTPUT :ivar output: Text, image, or file output of the function tool call. Required. Is either a str type or a [Union["_models.InputTextContentParam", "_models.InputImageContentParamAutoParam", @@ -7142,7 +7113,8 @@ class InputItemFunctionCallOutputItemParam(InputItem, discriminator="function_ca call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the function tool call generated by the model. Required.""" type: Literal[InputItemType.FUNCTION_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the function tool call output. Always ``function_call_output``. Required.""" + """The type of the function tool call output. Always ``function_call_output``. Required. + FUNCTION_CALL_OUTPUT.""" output: Union[ str, list[ @@ -7199,7 +7171,7 @@ class InputItemFunctionShellCallItemParam(InputItem, discriminator="shell_call") :vartype id: str :ivar call_id: The unique ID of the shell tool call generated by the model. Required. :vartype call_id: str - :ivar type: The type of the item. Always ``shell_call``. Required. + :ivar type: The type of the item. Always ``shell_call``. Required. SHELL_CALL. :vartype type: str or ~azure.ai.projects.models.SHELL_CALL :ivar action: The shell commands and limits that describe how to run the tool call. Required. :vartype action: ~azure.ai.projects.models.FunctionShellActionParam @@ -7211,7 +7183,7 @@ class InputItemFunctionShellCallItemParam(InputItem, discriminator="shell_call") call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the shell tool call generated by the model. Required.""" type: Literal[InputItemType.SHELL_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``shell_call``. Required.""" + """The type of the item. Always ``shell_call``. Required. SHELL_CALL.""" action: "_models.FunctionShellActionParam" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The shell commands and limits that describe how to run the tool call. Required.""" status: Optional[Union[str, "_models.FunctionShellCallItemStatus"]] = rest_field( @@ -7250,7 +7222,7 @@ class InputItemFunctionShellCallOutputItemParam( :vartype id: str :ivar call_id: The unique ID of the shell tool call generated by the model. Required. :vartype call_id: str - :ivar type: The type of the item. Always ``shell_call_output``. Required. + :ivar type: The type of the item. Always ``shell_call_output``. Required. SHELL_CALL_OUTPUT. :vartype type: str or ~azure.ai.projects.models.SHELL_CALL_OUTPUT :ivar output: Captured chunks of stdout and stderr output, along with their associated outcomes. Required. @@ -7263,7 +7235,7 @@ class InputItemFunctionShellCallOutputItemParam( call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the shell tool call generated by the model. Required.""" type: Literal[InputItemType.SHELL_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``shell_call_output``. Required.""" + """The type of the item. Always ``shell_call_output``. Required. SHELL_CALL_OUTPUT.""" output: list["_models.FunctionShellCallOutputContentParam"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -7298,6 +7270,7 @@ class InputItemFunctionToolCall(InputItem, discriminator="function_call"): :ivar id: The unique ID of the function tool call. :vartype id: str :ivar type: The type of the function tool call. Always ``function_call``. Required. + FUNCTION_CALL. :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL :ivar call_id: The unique ID of the function tool call generated by the model. Required. :vartype call_id: str @@ -7305,8 +7278,8 @@ class InputItemFunctionToolCall(InputItem, discriminator="function_call"): :vartype name: str :ivar arguments: A JSON string of the arguments to pass to the function. Required. :vartype arguments: str - :ivar status: The status of the item. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when items are returned via API. Is one of the following types: + :ivar status: The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. + Populated when items are returned via API. Is one of the following types: Literal["in_progress"], Literal["completed"], Literal["incomplete"] :vartype status: str or str or str """ @@ -7314,7 +7287,7 @@ class InputItemFunctionToolCall(InputItem, discriminator="function_call"): id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the function tool call.""" type: Literal[InputItemType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the function tool call. Always ``function_call``. Required.""" + """The type of the function tool call. Always ``function_call``. Required. FUNCTION_CALL.""" call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the function tool call generated by the model. Required.""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -7324,9 +7297,9 @@ class InputItemFunctionToolCall(InputItem, discriminator="function_call"): status: Optional[Literal["in_progress", "completed", "incomplete"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of the item. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when items are returned via API. Is one of the following types: - Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" + """The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. Populated + when items are returned via API. Is one of the following types: Literal[\"in_progress\"], + Literal[\"completed\"], Literal[\"incomplete\"]""" @overload def __init__( @@ -7355,6 +7328,7 @@ class InputItemImageGenToolCall(InputItem, discriminator="image_generation_call" """Image generation call. :ivar type: The type of the image generation call. Always ``image_generation_call``. Required. + IMAGE_GENERATION_CALL. :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION_CALL :ivar id: The unique ID of the image generation call. Required. :vartype id: str @@ -7366,7 +7340,8 @@ class InputItemImageGenToolCall(InputItem, discriminator="image_generation_call" """ type: Literal[InputItemType.IMAGE_GENERATION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the image generation call. Always ``image_generation_call``. Required.""" + """The type of the image generation call. Always ``image_generation_call``. Required. + IMAGE_GENERATION_CALL.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the image generation call. Required.""" status: Literal["in_progress", "completed", "generating", "failed"] = rest_field( @@ -7402,6 +7377,7 @@ class InputItemLocalShellToolCall(InputItem, discriminator="local_shell_call"): """Local shell call. :ivar type: The type of the local shell call. Always ``local_shell_call``. Required. + LOCAL_SHELL_CALL. :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL_CALL :ivar id: The unique ID of the local shell call. Required. :vartype id: str @@ -7415,7 +7391,7 @@ class InputItemLocalShellToolCall(InputItem, discriminator="local_shell_call"): """ type: Literal[InputItemType.LOCAL_SHELL_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the local shell call. Always ``local_shell_call``. Required.""" + """The type of the local shell call. Always ``local_shell_call``. Required. LOCAL_SHELL_CALL.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the local shell call. Required.""" call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -7454,7 +7430,7 @@ class InputItemLocalShellToolCallOutput(InputItem, discriminator="local_shell_ca """Local shell call output. :ivar type: The type of the local shell tool call output. Always ``local_shell_call_output``. - Required. + Required. LOCAL_SHELL_CALL_OUTPUT. :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL_CALL_OUTPUT :ivar id: The unique ID of the local shell tool call generated by the model. Required. :vartype id: str @@ -7466,7 +7442,8 @@ class InputItemLocalShellToolCallOutput(InputItem, discriminator="local_shell_ca """ type: Literal[InputItemType.LOCAL_SHELL_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the local shell tool call output. Always ``local_shell_call_output``. Required.""" + """The type of the local shell tool call output. Always ``local_shell_call_output``. Required. + LOCAL_SHELL_CALL_OUTPUT.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the local shell tool call generated by the model. Required.""" output: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -7502,6 +7479,7 @@ class InputItemMcpApprovalRequest(InputItem, discriminator="mcp_approval_request """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 @@ -7514,7 +7492,7 @@ class InputItemMcpApprovalRequest(InputItem, discriminator="mcp_approval_request """ type: Literal[InputItemType.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.""" + """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"]) @@ -7550,6 +7528,7 @@ class InputItemMcpApprovalResponse(InputItem, discriminator="mcp_approval_respon """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: :vartype id: str @@ -7562,7 +7541,7 @@ class InputItemMcpApprovalResponse(InputItem, discriminator="mcp_approval_respon """ type: Literal[InputItemType.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.""" + """The type of the item. Always ``mcp_approval_response``. Required. MCP_APPROVAL_RESPONSE.""" id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) approval_request_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The ID of the approval request being answered. Required.""" @@ -7595,7 +7574,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class InputItemMcpListTools(InputItem, discriminator="mcp_list_tools"): """MCP list tools. - :ivar type: The type of the item. Always ``mcp_list_tools``. Required. + :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS :ivar id: The unique ID of the list. Required. :vartype id: str @@ -7608,7 +7587,7 @@ class InputItemMcpListTools(InputItem, discriminator="mcp_list_tools"): """ type: Literal[InputItemType.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.""" + """The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the list. Required.""" server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -7642,7 +7621,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class InputItemMcpToolCall(InputItem, discriminator="mcp_call"): """MCP tool call. - :ivar type: The type of the item. Always ``mcp_call``. Required. + :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 @@ -7665,7 +7644,7 @@ class InputItemMcpToolCall(InputItem, discriminator="mcp_call"): """ type: Literal[InputItemType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``mcp_call``. Required.""" + """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"]) @@ -7715,7 +7694,7 @@ class InputItemOutputMessage(InputItem, discriminator="output_message"): :ivar id: The unique ID of the output message. Required. :vartype id: str - :ivar type: The type of the output message. Always ``message``. Required. + :ivar type: The type of the output message. Always ``message``. Required. OUTPUT_MESSAGE. :vartype type: str or ~azure.ai.projects.models.OUTPUT_MESSAGE :ivar role: The role of the output message. Always ``assistant``. Required. Default value is "assistant". @@ -7731,7 +7710,7 @@ class InputItemOutputMessage(InputItem, discriminator="output_message"): id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the output message. Required.""" type: Literal[InputItemType.OUTPUT_MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the output message. Always ``message``. Required.""" + """The type of the output message. Always ``message``. Required. OUTPUT_MESSAGE.""" role: Literal["assistant"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The role of the output message. Always ``assistant``. Required. Default value is \"assistant\".""" content: list["_models.OutputMessageContent"] = rest_field( @@ -7741,9 +7720,9 @@ class InputItemOutputMessage(InputItem, discriminator="output_message"): status: Literal["in_progress", "completed", "incomplete"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of the message input. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when input items are returned via API. Required. Is one of the - following types: Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" + """The status of the message input. One of ``in_progress``, ``completed``, or ``incomplete``. + Populated when input items are returned via API. Required. Is one of the following types: + Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" @overload def __init__( @@ -7770,7 +7749,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class InputItemReasoningItem(InputItem, discriminator="reasoning"): """Reasoning. - :ivar type: The type of the object. Always ``reasoning``. Required. + :ivar type: The type of the object. Always ``reasoning``. Required. REASONING. :vartype type: str or ~azure.ai.projects.models.REASONING :ivar id: The unique identifier of the reasoning content. Required. :vartype id: str @@ -7780,14 +7759,14 @@ class InputItemReasoningItem(InputItem, discriminator="reasoning"): :vartype summary: list[~azure.ai.projects.models.Summary] :ivar content: Reasoning text content. :vartype content: list[~azure.ai.projects.models.ReasoningTextContent] - :ivar status: The status of the item. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when items are returned via API. Is one of the following types: + :ivar status: The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. + Populated when items are returned via API. Is one of the following types: Literal["in_progress"], Literal["completed"], Literal["incomplete"] :vartype status: str or str or str """ type: Literal[InputItemType.REASONING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the object. Always ``reasoning``. Required.""" + """The type of the object. Always ``reasoning``. Required. REASONING.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique identifier of the reasoning content. Required.""" encrypted_content: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -7800,9 +7779,9 @@ class InputItemReasoningItem(InputItem, discriminator="reasoning"): status: Optional[Literal["in_progress", "completed", "incomplete"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of the item. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when items are returned via API. Is one of the following types: - Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" + """The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. Populated + when items are returned via API. Is one of the following types: Literal[\"in_progress\"], + Literal[\"completed\"], Literal[\"incomplete\"]""" @overload def __init__( @@ -7833,13 +7812,14 @@ class InputItemWebSearchToolCall(InputItem, discriminator="web_search_call"): :ivar id: The unique ID of the web search tool call. Required. :vartype id: str :ivar type: The type of the web search tool call. Always ``web_search_call``. Required. + WEB_SEARCH_CALL. :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_CALL :ivar status: The status of the web search tool call. Required. Is one of the following types: Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["failed"] :vartype status: str or str or str or str - :ivar action: An object describing the specific action taken in this web search call. - Includes details on how the model used the web (search, open_page, find). Required. Is one of - the following types: WebSearchActionSearch, WebSearchActionOpenPage, WebSearchActionFind + :ivar action: An object describing the specific action taken in this web search call. Includes + details on how the model used the web (search, open_page, find). Required. Is one of the + following types: WebSearchActionSearch, WebSearchActionOpenPage, WebSearchActionFind :vartype action: ~azure.ai.projects.models.WebSearchActionSearch or ~azure.ai.projects.models.WebSearchActionOpenPage or ~azure.ai.projects.models.WebSearchActionFind @@ -7848,7 +7828,7 @@ class InputItemWebSearchToolCall(InputItem, discriminator="web_search_call"): id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the web search tool call. Required.""" type: Literal[InputItemType.WEB_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the web search tool call. Always ``web_search_call``. Required.""" + """The type of the web search tool call. Always ``web_search_call``. Required. WEB_SEARCH_CALL.""" status: Literal["in_progress", "searching", "completed", "failed"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -7857,9 +7837,9 @@ class InputItemWebSearchToolCall(InputItem, discriminator="web_search_call"): action: Union["_models.WebSearchActionSearch", "_models.WebSearchActionOpenPage", "_models.WebSearchActionFind"] = ( rest_field(visibility=["read", "create", "update", "delete", "query"]) ) - """An object describing the specific action taken in this web search call. - Includes details on how the model used the web (search, open_page, find). Required. Is one of - the following types: WebSearchActionSearch, WebSearchActionOpenPage, WebSearchActionFind""" + """An object describing the specific action taken in this web search call. Includes details on how + the model used the web (search, open_page, find). Required. Is one of the following types: + WebSearchActionSearch, WebSearchActionOpenPage, WebSearchActionFind""" @overload def __init__( @@ -7897,19 +7877,21 @@ class ItemResource(_Model): ItemResourceMcpApprovalResponseResource, ItemResourceMcpToolCall, ItemResourceMcpListTools, MemorySearchToolCallItemResource, InputMessageResource, OAuthConsentRequestItemResource, ItemResourceOutputMessage, ItemResourceFunctionShellCall, ItemResourceFunctionShellCallOutput, - StructuredOutputsItemResource, ItemResourceWebSearchToolCall, WorkflowActionOutputItemResource + StructuredOutputsItemResource, ItemResourceWebSearchToolCall, + WorkflowPreviewActionOutputItemResource :ivar type: Required. Known values are: "message", "output_message", "file_search_call", "computer_call", "computer_call_output", "web_search_call", "function_call", "function_call_output", "image_generation_call", "code_interpreter_call", "local_shell_call", "local_shell_call_output", "shell_call", "shell_call_output", "apply_patch_call", "apply_patch_call_output", "mcp_list_tools", "mcp_approval_request", "mcp_approval_response", - "mcp_call", "structured_outputs", "workflow_action", "memory_search_call", and - "oauth_consent_request". + "mcp_call", "structured_outputs", "oauth_consent_request", "memory_search_preview_call", and + "workflow_preview_action". :vartype type: str or ~azure.ai.projects.models.ItemResourceType - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str """ __mapping__: dict[str, _Model] = {} @@ -7920,18 +7902,21 @@ class ItemResource(_Model): \"local_shell_call\", \"local_shell_call_output\", \"shell_call\", \"shell_call_output\", \"apply_patch_call\", \"apply_patch_call_output\", \"mcp_list_tools\", \"mcp_approval_request\", \"mcp_approval_response\", \"mcp_call\", \"structured_outputs\", - \"workflow_action\", \"memory_search_call\", and \"oauth_consent_request\".""" - created_by: Optional[Union["_models.CreatedBy", str]] = rest_field( + \"oauth_consent_request\", \"memory_search_preview_call\", and \"workflow_preview_action\".""" + agent_reference: Optional["_models.AgentReference"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The information about the creator of the item. Is either a CreatedBy type or a str type.""" + """The agent that created the item.""" + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The response on which the item is created.""" @overload def __init__( self, *, type: str, - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -7948,17 +7933,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class InputMessageResource(ItemResource, discriminator="message"): """InputMessageResource. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str - :ivar type: The type of the message input. Always set to ``message``. Required. + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: The type of the message input. Always set to ``message``. Required. MESSAGE. :vartype type: str or ~azure.ai.projects.models.MESSAGE :ivar role: The role of the message input. One of ``user``, ``system``, or ``developer``. Required. Is one of the following types: Literal["user"], Literal["system"], Literal["developer"] :vartype role: str or str or str - :ivar status: The status of item. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when items are returned via API. Is one of the following types: + :ivar status: The status of item. One of ``in_progress``, ``completed``, or ``incomplete``. + Populated when items are returned via API. Is one of the following types: Literal["in_progress"], Literal["completed"], Literal["incomplete"] :vartype status: str or str or str :ivar content: Required. @@ -7968,7 +7954,7 @@ class InputMessageResource(ItemResource, discriminator="message"): """ type: Literal[ItemResourceType.MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the message input. Always set to ``message``. Required.""" + """The type of the message input. Always set to ``message``. Required. MESSAGE.""" role: Literal["user", "system", "developer"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -7977,9 +7963,9 @@ class InputMessageResource(ItemResource, discriminator="message"): status: Optional[Literal["in_progress", "completed", "incomplete"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of item. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when items are returned via API. Is one of the following types: - Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" + """The status of item. One of ``in_progress``, ``completed``, or ``incomplete``. Populated when + items are returned via API. Is one of the following types: Literal[\"in_progress\"], + Literal[\"completed\"], Literal[\"incomplete\"]""" content: list["_models.InputContent"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -7992,7 +7978,8 @@ def __init__( role: Literal["user", "system", "developer"], content: list["_models.InputContent"], id: str, # pylint: disable=redefined-builtin - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, ) -> None: ... @@ -8325,14 +8312,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemReferenceParam(InputItem, discriminator="item_reference"): """Item reference. - :ivar type: The type of item to reference. Always ``item_reference``. Required. + :ivar type: The type of item to reference. Always ``item_reference``. Required. ITEM_REFERENCE. :vartype type: str or ~azure.ai.projects.models.ITEM_REFERENCE :ivar id: The ID of the item to reference. Required. :vartype id: str """ type: Literal[InputItemType.ITEM_REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of item to reference. Always ``item_reference``. Required.""" + """The type of item to reference. Always ``item_reference``. Required. ITEM_REFERENCE.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The ID of the item to reference. Required.""" @@ -8358,7 +8345,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceApplyPatchToolCall(ItemResource, discriminator="apply_patch_call"): """Apply patch tool call. - :ivar type: The type of the item. Always ``apply_patch_call``. Required. + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: The type of the item. Always ``apply_patch_call``. Required. APPLY_PATCH_CALL. :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH_CALL :ivar id: The unique ID of the apply patch tool call. Populated when this item is returned via API. Required. @@ -8376,7 +8367,7 @@ class ItemResourceApplyPatchToolCall(ItemResource, discriminator="apply_patch_ca """ type: Literal[ItemResourceType.APPLY_PATCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``apply_patch_call``. Required.""" + """The type of the item. Always ``apply_patch_call``. Required. APPLY_PATCH_CALL.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the apply patch tool call. Populated when this item is returned via API. Required.""" @@ -8392,9 +8383,7 @@ class ItemResourceApplyPatchToolCall(ItemResource, discriminator="apply_patch_ca ) """One of the create_file, delete_file, or update_file operations applied via apply_patch. Required.""" - created_by: Optional[str] = rest_field( # pyright: ignore[reportIncompatibleVariableOverride] - visibility=["read", "create", "update", "delete", "query"] - ) + created_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The ID of the entity that created this tool call.""" @overload @@ -8405,6 +8394,8 @@ def __init__( call_id: str, status: Union[str, "_models.ApplyPatchCallStatus"], operation: "_models.ApplyPatchFileOperation", + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, created_by: Optional[str] = None, ) -> None: ... @@ -8423,7 +8414,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceApplyPatchToolCallOutput(ItemResource, discriminator="apply_patch_call_output"): """Apply patch tool call output. + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str :ivar type: The type of the item. Always ``apply_patch_call_output``. Required. + APPLY_PATCH_CALL_OUTPUT. :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH_CALL_OUTPUT :ivar id: The unique ID of the apply patch tool call output. Populated when this item is returned via API. Required. @@ -8440,7 +8436,7 @@ class ItemResourceApplyPatchToolCallOutput(ItemResource, discriminator="apply_pa """ type: Literal[ItemResourceType.APPLY_PATCH_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``apply_patch_call_output``. Required.""" + """The type of the item. Always ``apply_patch_call_output``. Required. APPLY_PATCH_CALL_OUTPUT.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the apply patch tool call output. Populated when this item is returned via API. Required.""" @@ -8452,9 +8448,7 @@ class ItemResourceApplyPatchToolCallOutput(ItemResource, discriminator="apply_pa """The status of the apply patch tool call output. One of ``completed`` or ``failed``. Required. Known values are: \"completed\" and \"failed\".""" output: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - created_by: Optional[str] = rest_field( # pyright: ignore[reportIncompatibleVariableOverride] - visibility=["read", "create", "update", "delete", "query"] - ) + created_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The ID of the entity that created this tool call output.""" @overload @@ -8464,6 +8458,8 @@ def __init__( id: str, # pylint: disable=redefined-builtin call_id: str, status: Union[str, "_models.ApplyPatchCallOutputStatus"], + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, output: Optional[str] = None, created_by: Optional[str] = None, ) -> None: ... @@ -8483,11 +8479,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceCodeInterpreterToolCall(ItemResource, discriminator="code_interpreter_call"): """Code interpreter tool call. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str :ivar type: The type of the code interpreter tool call. Always ``code_interpreter_call``. - Required. + Required. CODE_INTERPRETER_CALL. :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER_CALL :ivar id: The unique ID of the code interpreter tool call. Required. :vartype id: str @@ -8506,7 +8503,8 @@ class ItemResourceCodeInterpreterToolCall(ItemResource, discriminator="code_inte """ type: Literal[ItemResourceType.CODE_INTERPRETER_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the code interpreter tool call. Always ``code_interpreter_call``. Required.""" + """The type of the code interpreter tool call. Always ``code_interpreter_call``. Required. + CODE_INTERPRETER_CALL.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the code interpreter tool call. Required.""" status: Literal["in_progress", "completed", "incomplete", "interpreting", "failed"] = rest_field( @@ -8534,7 +8532,8 @@ def __init__( container_id: str, code: str, outputs: list[Union["_models.CodeInterpreterOutputLogs", "_models.CodeInterpreterOutputImage"]], - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -8552,10 +8551,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceComputerToolCall(ItemResource, discriminator="computer_call"): """Computer tool call. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str - :ivar type: The type of the computer call. Always ``computer_call``. Required. + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: The type of the computer call. Always ``computer_call``. Required. COMPUTER_CALL. :vartype type: str or ~azure.ai.projects.models.COMPUTER_CALL :ivar id: The unique ID of the computer call. Required. :vartype id: str @@ -8565,14 +8565,14 @@ class ItemResourceComputerToolCall(ItemResource, discriminator="computer_call"): :vartype action: ~azure.ai.projects.models.ComputerAction :ivar pending_safety_checks: The pending safety checks for the computer call. Required. :vartype pending_safety_checks: list[~azure.ai.projects.models.ComputerCallSafetyCheckParam] - :ivar status: The status of the item. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when items are returned via API. Required. Is one of the following - types: Literal["in_progress"], Literal["completed"], Literal["incomplete"] + :ivar status: The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. + Populated when items are returned via API. Required. Is one of the following types: + Literal["in_progress"], Literal["completed"], Literal["incomplete"] :vartype status: str or str or str """ type: Literal[ItemResourceType.COMPUTER_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the computer call. Always ``computer_call``. Required.""" + """The type of the computer call. Always ``computer_call``. Required. COMPUTER_CALL.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the computer call. Required.""" call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -8586,9 +8586,9 @@ class ItemResourceComputerToolCall(ItemResource, discriminator="computer_call"): status: Literal["in_progress", "completed", "incomplete"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of the item. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when items are returned via API. Required. Is one of the following - types: Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" + """The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. Populated + when items are returned via API. Required. Is one of the following types: + Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" @overload def __init__( @@ -8599,7 +8599,8 @@ def __init__( action: "_models.ComputerAction", pending_safety_checks: list["_models.ComputerCallSafetyCheckParam"], status: Literal["in_progress", "completed", "incomplete"], - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -8619,11 +8620,12 @@ class ItemResourceComputerToolCallOutputResource( ): # pylint: disable=name-too-long """ItemResourceComputerToolCallOutputResource. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str :ivar type: The type of the computer tool call output. Always ``computer_call_output``. - Required. + Required. COMPUTER_CALL_OUTPUT. :vartype type: str or ~azure.ai.projects.models.COMPUTER_CALL_OUTPUT :ivar id: The ID of the computer tool call output. :vartype id: str @@ -8636,13 +8638,14 @@ class ItemResourceComputerToolCallOutputResource( :ivar output: Required. :vartype output: ~azure.ai.projects.models.ComputerScreenshotImage :ivar status: The status of the message input. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when input items are returned via API. Is one of the following - types: Literal["in_progress"], Literal["completed"], Literal["incomplete"] + ``incomplete``. Populated when input items are returned via API. Is one of the following types: + Literal["in_progress"], Literal["completed"], Literal["incomplete"] :vartype status: str or str or str """ type: Literal[ItemResourceType.COMPUTER_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the computer tool call output. Always ``computer_call_output``. Required.""" + """The type of the computer tool call output. Always ``computer_call_output``. Required. + COMPUTER_CALL_OUTPUT.""" id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The ID of the computer tool call output.""" call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -8650,16 +8653,15 @@ class ItemResourceComputerToolCallOutputResource( acknowledged_safety_checks: Optional[list["_models.ComputerCallSafetyCheckParam"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The safety checks reported by the API that have been acknowledged by the - developer.""" + """The safety checks reported by the API that have been acknowledged by the developer.""" output: "_models.ComputerScreenshotImage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" status: Optional[Literal["in_progress", "completed", "incomplete"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of the message input. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when input items are returned via API. Is one of the following - types: Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" + """The status of the message input. One of ``in_progress``, ``completed``, or ``incomplete``. + Populated when input items are returned via API. Is one of the following types: + Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" @overload def __init__( @@ -8667,7 +8669,8 @@ def __init__( *, call_id: str, output: "_models.ComputerScreenshotImage", - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, id: Optional[str] = None, # pylint: disable=redefined-builtin acknowledged_safety_checks: Optional[list["_models.ComputerCallSafetyCheckParam"]] = None, status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, @@ -8688,17 +8691,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceFileSearchToolCall(ItemResource, discriminator="file_search_call"): """File search tool call. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str :ivar id: The unique ID of the file search tool call. Required. :vartype id: str :ivar type: The type of the file search tool call. Always ``file_search_call``. Required. + FILE_SEARCH_CALL. :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH_CALL - :ivar status: The status of the file search tool call. One of ``in_progress``, - ``searching``, ``incomplete`` or ``failed``,. Required. Is one of the following types: - Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["incomplete"], - Literal["failed"] + :ivar status: The status of the file search tool call. One of ``in_progress``, ``searching``, + ``incomplete`` or ``failed``,. Required. Is one of the following types: Literal["in_progress"], + Literal["searching"], Literal["completed"], Literal["incomplete"], Literal["failed"] :vartype status: str or str or str or str or str :ivar queries: The queries used to search for files. Required. :vartype queries: list[str] @@ -8709,14 +8713,13 @@ class ItemResourceFileSearchToolCall(ItemResource, discriminator="file_search_ca id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the file search tool call. Required.""" type: Literal[ItemResourceType.FILE_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the file search tool call. Always ``file_search_call``. Required.""" + """The type of the file search tool call. Always ``file_search_call``. Required. FILE_SEARCH_CALL.""" status: Literal["in_progress", "searching", "completed", "incomplete", "failed"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of the file search tool call. One of ``in_progress``, - ``searching``, ``incomplete`` or ``failed``,. Required. Is one of the following types: - Literal[\"in_progress\"], Literal[\"searching\"], Literal[\"completed\"], - Literal[\"incomplete\"], Literal[\"failed\"]""" + """The status of the file search tool call. One of ``in_progress``, ``searching``, ``incomplete`` + or ``failed``,. Required. Is one of the following types: Literal[\"in_progress\"], + Literal[\"searching\"], Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"failed\"]""" queries: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The queries used to search for files. Required.""" results: Optional[list["_models.FileSearchToolCallResults"]] = rest_field( @@ -8730,7 +8733,8 @@ def __init__( id: str, # pylint: disable=redefined-builtin status: Literal["in_progress", "searching", "completed", "incomplete", "failed"], queries: list[str], - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, results: Optional[list["_models.FileSearchToolCallResults"]] = None, ) -> None: ... @@ -8749,7 +8753,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceFunctionShellCall(ItemResource, discriminator="shell_call"): """Shell tool call. - :ivar type: The type of the item. Always ``shell_call``. Required. + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: The type of the item. Always ``shell_call``. Required. SHELL_CALL. :vartype type: str or ~azure.ai.projects.models.SHELL_CALL :ivar id: The unique ID of the shell tool call. Populated when this item is returned via API. Required. @@ -8766,7 +8774,7 @@ class ItemResourceFunctionShellCall(ItemResource, discriminator="shell_call"): """ type: Literal[ItemResourceType.SHELL_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``shell_call``. Required.""" + """The type of the item. Always ``shell_call``. Required. SHELL_CALL.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the shell tool call. Populated when this item is returned via API. Required.""" call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -8778,9 +8786,7 @@ class ItemResourceFunctionShellCall(ItemResource, discriminator="shell_call"): ) """The status of the shell call. One of ``in_progress``, ``completed``, or ``incomplete``. Required. Known values are: \"in_progress\", \"completed\", and \"incomplete\".""" - created_by: Optional[str] = rest_field( # pyright: ignore[reportIncompatibleVariableOverride] - visibility=["read", "create", "update", "delete", "query"] - ) + created_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The ID of the entity that created this tool call.""" @overload @@ -8791,6 +8797,8 @@ def __init__( call_id: str, action: "_models.FunctionShellAction", status: Union[str, "_models.LocalShellCallStatus"], + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, created_by: Optional[str] = None, ) -> None: ... @@ -8809,7 +8817,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceFunctionShellCallOutput(ItemResource, discriminator="shell_call_output"): """Shell call output. + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str :ivar type: The type of the shell call output. Always ``shell_call_output``. Required. + SHELL_CALL_OUTPUT. :vartype type: str or ~azure.ai.projects.models.SHELL_CALL_OUTPUT :ivar id: The unique ID of the shell call output. Populated when this item is returned via API. Required. @@ -8825,7 +8838,7 @@ class ItemResourceFunctionShellCallOutput(ItemResource, discriminator="shell_cal """ type: Literal[ItemResourceType.SHELL_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the shell call output. Always ``shell_call_output``. Required.""" + """The type of the shell call output. Always ``shell_call_output``. Required. SHELL_CALL_OUTPUT.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the shell call output. Populated when this item is returned via API. Required.""" call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -8836,9 +8849,7 @@ class ItemResourceFunctionShellCallOutput(ItemResource, discriminator="shell_cal """An array of shell call output contents. Required.""" max_output_length: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" - created_by: Optional[str] = rest_field( # pyright: ignore[reportIncompatibleVariableOverride] - visibility=["read", "create", "update", "delete", "query"] - ) + created_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The identifier of the actor that created the item.""" @overload @@ -8849,6 +8860,8 @@ def __init__( call_id: str, output: list["_models.FunctionShellCallOutputContent"], max_output_length: int, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, created_by: Optional[str] = None, ) -> None: ... @@ -8869,46 +8882,46 @@ class ItemResourceFunctionToolCallOutputResource( ): # pylint: disable=name-too-long """ItemResourceFunctionToolCallOutputResource. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str - :ivar id: The unique ID of the function tool call output. Populated when this item - is returned via API. + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar id: The unique ID of the function tool call output. Populated when this item is returned + via API. :vartype id: str :ivar type: The type of the function tool call output. Always ``function_call_output``. - Required. + Required. FUNCTION_CALL_OUTPUT. :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL_OUTPUT :ivar call_id: The unique ID of the function tool call generated by the model. Required. :vartype call_id: str - :ivar output: The output from the function call generated by your code. - Can be a string or an list of output content. Required. Is either a str type or a - [FunctionAndCustomToolCallOutput] type. + :ivar output: The output from the function call generated by your code. Can be a string or an + list of output content. Required. Is either a str type or a [FunctionAndCustomToolCallOutput] + type. :vartype output: str or list[~azure.ai.projects.models.FunctionAndCustomToolCallOutput] - :ivar status: The status of the item. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when items are returned via API. Is one of the following types: + :ivar status: The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. + Populated when items are returned via API. Is one of the following types: Literal["in_progress"], Literal["completed"], Literal["incomplete"] :vartype status: str or str or str """ id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the function tool call output. Populated when this item - is returned via API.""" + """The unique ID of the function tool call output. Populated when this item is returned via API.""" type: Literal[ItemResourceType.FUNCTION_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the function tool call output. Always ``function_call_output``. Required.""" + """The type of the function tool call output. Always ``function_call_output``. Required. + FUNCTION_CALL_OUTPUT.""" call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the function tool call generated by the model. Required.""" output: Union[str, list["_models.FunctionAndCustomToolCallOutput"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The output from the function call generated by your code. - Can be a string or an list of output content. Required. Is either a str type or a - [FunctionAndCustomToolCallOutput] type.""" + """The output from the function call generated by your code. Can be a string or an list of output + content. Required. Is either a str type or a [FunctionAndCustomToolCallOutput] type.""" status: Optional[Literal["in_progress", "completed", "incomplete"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of the item. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when items are returned via API. Is one of the following types: - Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" + """The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. Populated + when items are returned via API. Is one of the following types: Literal[\"in_progress\"], + Literal[\"completed\"], Literal[\"incomplete\"]""" @overload def __init__( @@ -8916,7 +8929,8 @@ def __init__( *, call_id: str, output: Union[str, list["_models.FunctionAndCustomToolCallOutput"]], - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, id: Optional[str] = None, # pylint: disable=redefined-builtin status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, ) -> None: ... @@ -8936,12 +8950,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceFunctionToolCallResource(ItemResource, discriminator="function_call"): """ItemResourceFunctionToolCallResource. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str :ivar id: The unique ID of the function tool call. :vartype id: str :ivar type: The type of the function tool call. Always ``function_call``. Required. + FUNCTION_CALL. :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL :ivar call_id: The unique ID of the function tool call generated by the model. Required. :vartype call_id: str @@ -8949,8 +8965,8 @@ class ItemResourceFunctionToolCallResource(ItemResource, discriminator="function :vartype name: str :ivar arguments: A JSON string of the arguments to pass to the function. Required. :vartype arguments: str - :ivar status: The status of the item. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when items are returned via API. Is one of the following types: + :ivar status: The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. + Populated when items are returned via API. Is one of the following types: Literal["in_progress"], Literal["completed"], Literal["incomplete"] :vartype status: str or str or str """ @@ -8958,7 +8974,7 @@ class ItemResourceFunctionToolCallResource(ItemResource, discriminator="function id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the function tool call.""" type: Literal[ItemResourceType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the function tool call. Always ``function_call``. Required.""" + """The type of the function tool call. Always ``function_call``. Required. FUNCTION_CALL.""" call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the function tool call generated by the model. Required.""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -8968,9 +8984,9 @@ class ItemResourceFunctionToolCallResource(ItemResource, discriminator="function status: Optional[Literal["in_progress", "completed", "incomplete"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of the item. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when items are returned via API. Is one of the following types: - Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" + """The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. Populated + when items are returned via API. Is one of the following types: Literal[\"in_progress\"], + Literal[\"completed\"], Literal[\"incomplete\"]""" @overload def __init__( @@ -8979,7 +8995,8 @@ def __init__( call_id: str, name: str, arguments: str, - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, id: Optional[str] = None, # pylint: disable=redefined-builtin status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, ) -> None: ... @@ -8999,10 +9016,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceImageGenToolCall(ItemResource, discriminator="image_generation_call"): """Image generation call. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str :ivar type: The type of the image generation call. Always ``image_generation_call``. Required. + IMAGE_GENERATION_CALL. :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION_CALL :ivar id: The unique ID of the image generation call. Required. :vartype id: str @@ -9014,7 +9033,8 @@ class ItemResourceImageGenToolCall(ItemResource, discriminator="image_generation """ type: Literal[ItemResourceType.IMAGE_GENERATION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the image generation call. Always ``image_generation_call``. Required.""" + """The type of the image generation call. Always ``image_generation_call``. Required. + IMAGE_GENERATION_CALL.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the image generation call. Required.""" status: Literal["in_progress", "completed", "generating", "failed"] = rest_field( @@ -9032,7 +9052,8 @@ def __init__( id: str, # pylint: disable=redefined-builtin status: Literal["in_progress", "completed", "generating", "failed"], result: str, - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -9050,10 +9071,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceLocalShellToolCall(ItemResource, discriminator="local_shell_call"): """Local shell call. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str :ivar type: The type of the local shell call. Always ``local_shell_call``. Required. + LOCAL_SHELL_CALL. :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL_CALL :ivar id: The unique ID of the local shell call. Required. :vartype id: str @@ -9067,7 +9090,7 @@ class ItemResourceLocalShellToolCall(ItemResource, discriminator="local_shell_ca """ type: Literal[ItemResourceType.LOCAL_SHELL_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the local shell call. Always ``local_shell_call``. Required.""" + """The type of the local shell call. Always ``local_shell_call``. Required. LOCAL_SHELL_CALL.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the local shell call. Required.""" call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -9088,7 +9111,8 @@ def __init__( call_id: str, action: "_models.LocalShellExecAction", status: Literal["in_progress", "completed", "incomplete"], - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -9106,11 +9130,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceLocalShellToolCallOutput(ItemResource, discriminator="local_shell_call_output"): """Local shell call output. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str :ivar type: The type of the local shell tool call output. Always ``local_shell_call_output``. - Required. + Required. LOCAL_SHELL_CALL_OUTPUT. :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL_CALL_OUTPUT :ivar id: The unique ID of the local shell tool call generated by the model. Required. :vartype id: str @@ -9122,7 +9147,8 @@ class ItemResourceLocalShellToolCallOutput(ItemResource, discriminator="local_sh """ type: Literal[ItemResourceType.LOCAL_SHELL_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the local shell tool call output. Always ``local_shell_call_output``. Required.""" + """The type of the local shell tool call output. Always ``local_shell_call_output``. Required. + LOCAL_SHELL_CALL_OUTPUT.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the local shell tool call generated by the model. Required.""" output: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -9139,7 +9165,8 @@ def __init__( *, id: str, # pylint: disable=redefined-builtin output: str, - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, ) -> None: ... @@ -9158,10 +9185,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceMcpApprovalRequest(ItemResource, discriminator="mcp_approval_request"): """MCP approval request. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :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 @@ -9174,7 +9203,7 @@ class ItemResourceMcpApprovalRequest(ItemResource, discriminator="mcp_approval_r """ type: Literal[ItemResourceType.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.""" + """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"]) @@ -9192,7 +9221,8 @@ def __init__( server_label: str, name: str, arguments: str, - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -9210,10 +9240,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceMcpApprovalResponseResource(ItemResource, discriminator="mcp_approval_response"): """MCP approval response. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :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 @@ -9226,7 +9258,7 @@ class ItemResourceMcpApprovalResponseResource(ItemResource, discriminator="mcp_a """ type: Literal[ItemResourceType.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.""" + """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"]) @@ -9242,7 +9274,8 @@ def __init__( id: str, # pylint: disable=redefined-builtin approval_request_id: str, approve: bool, - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, reason: Optional[str] = None, ) -> None: ... @@ -9261,10 +9294,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceMcpListTools(ItemResource, discriminator="mcp_list_tools"): """MCP list tools. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str - :ivar type: The type of the item. Always ``mcp_list_tools``. Required. + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :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. Required. :vartype id: str @@ -9277,7 +9311,7 @@ class ItemResourceMcpListTools(ItemResource, discriminator="mcp_list_tools"): """ type: Literal[ItemResourceType.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.""" + """The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS.""" id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the list. Required.""" server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -9293,7 +9327,8 @@ def __init__( id: str, # pylint: disable=redefined-builtin server_label: str, tools: list["_models.MCPListToolsTool"], - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, error: Optional[str] = None, ) -> None: ... @@ -9312,10 +9347,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceMcpToolCall(ItemResource, discriminator="mcp_call"): """MCP tool call. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str - :ivar type: The type of the item. Always ``mcp_call``. Required. + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :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 @@ -9338,7 +9374,7 @@ class ItemResourceMcpToolCall(ItemResource, discriminator="mcp_call"): """ type: Literal[ItemResourceType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always ``mcp_call``. Required.""" + """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"]) @@ -9365,7 +9401,8 @@ def __init__( server_label: str, name: str, arguments: str, - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, output: Optional[str] = None, error: Optional[str] = None, status: Optional[Union[str, "_models.MCPToolCallStatus"]] = None, @@ -9387,12 +9424,13 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceOutputMessage(ItemResource, discriminator="output_message"): """Output message. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str :ivar id: The unique ID of the output message. Required. :vartype id: str - :ivar type: The type of the output message. Always ``message``. Required. + :ivar type: The type of the output message. Always ``message``. Required. OUTPUT_MESSAGE. :vartype type: str or ~azure.ai.projects.models.OUTPUT_MESSAGE :ivar role: The role of the output message. Always ``assistant``. Required. Default value is "assistant". @@ -9408,7 +9446,7 @@ class ItemResourceOutputMessage(ItemResource, discriminator="output_message"): id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the output message. Required.""" type: Literal[ItemResourceType.OUTPUT_MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the output message. Always ``message``. Required.""" + """The type of the output message. Always ``message``. Required. OUTPUT_MESSAGE.""" role: Literal["assistant"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The role of the output message. Always ``assistant``. Required. Default value is \"assistant\".""" content: list["_models.OutputMessageContent"] = rest_field( @@ -9418,9 +9456,9 @@ class ItemResourceOutputMessage(ItemResource, discriminator="output_message"): status: Literal["in_progress", "completed", "incomplete"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of the message input. One of ``in_progress``, ``completed``, or - ``incomplete``. Populated when input items are returned via API. Required. Is one of the - following types: Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" + """The status of the message input. One of ``in_progress``, ``completed``, or ``incomplete``. + Populated when input items are returned via API. Required. Is one of the following types: + Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" @overload def __init__( @@ -9429,7 +9467,8 @@ def __init__( id: str, # pylint: disable=redefined-builtin content: list["_models.OutputMessageContent"], status: Literal["in_progress", "completed", "incomplete"], - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -9448,19 +9487,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceWebSearchToolCall(ItemResource, discriminator="web_search_call"): """Web search tool call. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str :ivar id: The unique ID of the web search tool call. Required. :vartype id: str :ivar type: The type of the web search tool call. Always ``web_search_call``. Required. + WEB_SEARCH_CALL. :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_CALL :ivar status: The status of the web search tool call. Required. Is one of the following types: Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["failed"] :vartype status: str or str or str or str - :ivar action: An object describing the specific action taken in this web search call. - Includes details on how the model used the web (search, open_page, find). Required. Is one of - the following types: WebSearchActionSearch, WebSearchActionOpenPage, WebSearchActionFind + :ivar action: An object describing the specific action taken in this web search call. Includes + details on how the model used the web (search, open_page, find). Required. Is one of the + following types: WebSearchActionSearch, WebSearchActionOpenPage, WebSearchActionFind :vartype action: ~azure.ai.projects.models.WebSearchActionSearch or ~azure.ai.projects.models.WebSearchActionOpenPage or ~azure.ai.projects.models.WebSearchActionFind @@ -9469,7 +9510,7 @@ class ItemResourceWebSearchToolCall(ItemResource, discriminator="web_search_call id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique ID of the web search tool call. Required.""" type: Literal[ItemResourceType.WEB_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the web search tool call. Always ``web_search_call``. Required.""" + """The type of the web search tool call. Always ``web_search_call``. Required. WEB_SEARCH_CALL.""" status: Literal["in_progress", "searching", "completed", "failed"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -9478,9 +9519,9 @@ class ItemResourceWebSearchToolCall(ItemResource, discriminator="web_search_call action: Union["_models.WebSearchActionSearch", "_models.WebSearchActionOpenPage", "_models.WebSearchActionFind"] = ( rest_field(visibility=["read", "create", "update", "delete", "query"]) ) - """An object describing the specific action taken in this web search call. - Includes details on how the model used the web (search, open_page, find). Required. Is one of - the following types: WebSearchActionSearch, WebSearchActionOpenPage, WebSearchActionFind""" + """An object describing the specific action taken in this web search call. Includes details on how + the model used the web (search, open_page, find). Required. Is one of the following types: + WebSearchActionSearch, WebSearchActionOpenPage, WebSearchActionFind""" @overload def __init__( @@ -9491,7 +9532,8 @@ def __init__( action: Union[ "_models.WebSearchActionSearch", "_models.WebSearchActionOpenPage", "_models.WebSearchActionFind" ], - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -9510,7 +9552,7 @@ class KeyPressAction(ComputerAction, discriminator="keypress"): """KeyPress. :ivar type: Specifies the event type. For a keypress action, this property is always set to - ``keypress``. Required. + ``keypress``. Required. KEYPRESS. :vartype type: str or ~azure.ai.projects.models.KEYPRESS :ivar keys_property: The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. Required. @@ -9519,7 +9561,7 @@ class KeyPressAction(ComputerAction, discriminator="keypress"): type: Literal[ComputerActionType.KEYPRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Specifies the event type. For a keypress action, this property is always set to ``keypress``. - Required.""" + Required. KEYPRESS.""" keys_property: list[str] = rest_field( name="keys", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="keys" ) @@ -9599,12 +9641,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class LocalShellToolParam(Tool, discriminator="local_shell"): """Local shell tool. - :ivar type: The type of the local shell tool. Always ``local_shell``. Required. + :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 """ 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.""" + """The type of the local shell tool. Always ``local_shell``. Required. LOCAL_SHELL.""" @overload def __init__( @@ -9679,14 +9721,14 @@ class ManagedAzureAISearchIndex(Index, discriminator="ManagedAzureSearch"): :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 + :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""" + """Type of index. Required. Managed Azure Search.""" vector_store_id: str = rest_field(name="vectorStoreId", visibility=["create"]) """Vector store id of managed index. Required.""" @@ -9767,7 +9809,7 @@ class MCPListToolsToolInputSchema(_Model): class MCPTool(Tool, discriminator="mcp"): """MCP tool. - :ivar type: The type of the MCP tool. Always ``mcp``. Required. + :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 @@ -9775,10 +9817,9 @@ class MCPTool(Tool, discriminator="mcp"): 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: + ``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` @@ -9794,8 +9835,8 @@ class MCPTool(Tool, discriminator="mcp"): 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. + 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 @@ -9813,12 +9854,11 @@ class MCPTool(Tool, discriminator="mcp"): """ 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.""" + """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.""" + """The URL for the MCP server. One of ``server_url`` or ``connector_id`` must be provided.""" connector_id: Optional[ Literal[ "connector_dropbox", @@ -9831,11 +9871,10 @@ class MCPTool(Tool, discriminator="mcp"): "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: + """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` @@ -9850,9 +9889,9 @@ class MCPTool(Tool, discriminator="mcp"): 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.""" + """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"]) @@ -9911,20 +9950,20 @@ class MCPToolFilter(_Model): :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` + :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. + 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` + """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.""" + it will match this filter.""" @overload def __init__( @@ -10069,16 +10108,17 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemorySearchPreviewTool(Tool, discriminator="memory_search"): +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``. Required. - :vartype type: str or ~azure.ai.projects.models.MEMORY_SEARCH + :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. + :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 @@ -10087,14 +10127,14 @@ class MemorySearchPreviewTool(Tool, discriminator="memory_search"): :vartype update_delay: int """ - type: Literal[ToolType.MEMORY_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the tool. Always ``memory_search``. Required.""" + 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.""" + """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"] ) @@ -10121,34 +10161,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 # type: ignore + self.type = ToolType.MEMORY_SEARCH_PREVIEW # type: ignore class MemorySearchToolCallItemResource(ItemResource, discriminator="memory_search_call"): """MemorySearchToolCallItemResource. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.MEMORY_SEARCH_CALL - :ivar status: The status of the memory search tool call. One of ``in_progress``, - ``searching``, ``completed``, ``incomplete`` or ``failed``,. Required. Is one of the following - types: Literal["in_progress"], Literal["searching"], Literal["completed"], - Literal["incomplete"], Literal["failed"] + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: Required. Default value is "memory_search_call". + :vartype type: str + :ivar status: The status of the memory search tool call. One of ``in_progress``, ``searching``, + ``completed``, ``incomplete`` or ``failed``,. Required. Is one of the following types: + Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["incomplete"], + Literal["failed"] :vartype status: str or str or str or str or str :ivar results: The results returned from the memory search. :vartype results: list[~azure.ai.projects.models.MemorySearchItem] """ - type: Literal[ItemResourceType.MEMORY_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" + type: Literal["memory_search_call"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"memory_search_call\".""" status: Literal["in_progress", "searching", "completed", "incomplete", "failed"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of the memory search tool call. One of ``in_progress``, - ``searching``, ``completed``, ``incomplete`` or ``failed``,. Required. Is one of the following - types: Literal[\"in_progress\"], Literal[\"searching\"], Literal[\"completed\"], + """The status of the memory search tool call. One of ``in_progress``, ``searching``, + ``completed``, ``incomplete`` or ``failed``,. Required. Is one of the following types: + Literal[\"in_progress\"], Literal[\"searching\"], Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"failed\"]""" results: Optional[list["_models.MemorySearchItem"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -10160,7 +10201,8 @@ def __init__( self, *, status: Literal["in_progress", "searching", "completed", "incomplete", "failed"], - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, results: Optional[list["_models.MemorySearchItem"]] = None, ) -> None: ... @@ -10173,7 +10215,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemResourceType.MEMORY_SEARCH_CALL # type: ignore + self.type = "memory_search_call" # type: ignore class MemoryStoreDefinition(_Model): @@ -10606,13 +10648,15 @@ 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. + 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.""" + """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"] ) @@ -10642,7 +10686,7 @@ class ModelDeployment(Deployment, discriminator="ModelDeployment"): :ivar name: Name of the deployment. Required. :vartype name: str - :ivar type: The type of the deployment. Required. Model deployment + :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 @@ -10659,7 +10703,7 @@ class ModelDeployment(Deployment, discriminator="ModelDeployment"): """ 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""" + """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"]) @@ -10738,6 +10782,50 @@ 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. + + :ivar temperature: The temperature parameter for sampling. Required. + :vartype temperature: float + :ivar top_p: The top-p parameter for nucleus sampling. Required. + :vartype top_p: float + :ivar seed: The random seed for reproducibility. Required. + :vartype seed: int + :ivar max_completion_tokens: The maximum number of tokens allowed in the completion. Required. + :vartype max_completion_tokens: int + """ + + temperature: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The temperature parameter for sampling. Required.""" + top_p: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The top-p parameter for nucleus sampling. Required.""" + seed: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The random seed for reproducibility. Required.""" + max_completion_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum number of tokens allowed in the completion. Required.""" + + @overload + def __init__( + self, + *, + temperature: float, + top_p: float, + seed: int, + max_completion_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 MonthlyRecurrenceSchedule(RecurrenceSchedule, discriminator="Monthly"): """Monthly recurrence schedule. @@ -10776,8 +10864,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Move(ComputerAction, discriminator="move"): """Move. - :ivar type: Specifies the event type. For a move action, this property is - always set to ``move``. Required. + :ivar type: Specifies the event type. For a move action, this property is always set to + ``move``. Required. MOVE. :vartype type: str or ~azure.ai.projects.models.MOVE :ivar x: The x-coordinate to move to. Required. :vartype x: int @@ -10786,8 +10874,8 @@ class Move(ComputerAction, discriminator="move"): """ type: Literal[ComputerActionType.MOVE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Specifies the event type. For a move action, this property is - always set to ``move``. Required.""" + """Specifies the event type. For a move action, this property is always set to ``move``. Required. + MOVE.""" x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The x-coordinate to move to. Required.""" y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -10816,12 +10904,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class NoAuthenticationCredentials(BaseCredentials, discriminator="None"): """Credentials that do not require authentication. - :ivar type: The credential type. Required. No credential + :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""" + """The credential type. Required. No credential.""" @overload def __init__( @@ -10843,12 +10931,13 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class OAuthConsentRequestItemResource(ItemResource, discriminator="oauth_consent_request"): """Request from the service for the user to perform OAuth consent. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str :ivar id: Required. :vartype id: str - :ivar type: Required. + :ivar type: Required. OAUTH_CONSENT_REQUEST. :vartype type: str or ~azure.ai.projects.models.OAUTH_CONSENT_REQUEST :ivar consent_link: The link the user can use to perform OAuth consent. Required. :vartype consent_link: str @@ -10859,7 +10948,7 @@ class OAuthConsentRequestItemResource(ItemResource, discriminator="oauth_consent id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" type: Literal[ItemResourceType.OAUTH_CONSENT_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" + """Required. OAUTH_CONSENT_REQUEST.""" consent_link: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The link the user can use to perform OAuth consent. Required.""" server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -10872,7 +10961,8 @@ def __init__( id: str, # pylint: disable=redefined-builtin consent_link: str, server_label: str, - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -10962,12 +11052,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator="anonymous"): """Security details for OpenApi anonymous authentication. - :ivar type: The object type, which is always 'anonymous'. Required. + :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.""" + """The object type, which is always 'anonymous'. Required. ANONYMOUS.""" @overload def __init__( @@ -10995,7 +11085,7 @@ class OpenApiFunctionDefinition(_Model): and how to call the function. :vartype description: str :ivar spec: The openapi function shape, described as a JSON Schema object. Required. - :vartype spec: any + :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. @@ -11009,7 +11099,7 @@ class OpenApiFunctionDefinition(_Model): 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: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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.""" @@ -11023,7 +11113,7 @@ def __init__( self, *, name: str, - spec: Any, + spec: dict[str, Any], auth: "_models.OpenApiAuthDetails", description: Optional[str] = None, default_params: Optional[list[str]] = None, @@ -11050,7 +11140,7 @@ class OpenApiFunctionDefinitionFunction(_Model): :vartype description: str :ivar parameters: The parameters the functions accepts, described as a JSON Schema object. Required. - :vartype parameters: any + :vartype parameters: dict[str, any] """ name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -11058,7 +11148,7 @@ class OpenApiFunctionDefinitionFunction(_Model): 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: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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 @@ -11066,7 +11156,7 @@ def __init__( self, *, name: str, - parameters: Any, + parameters: dict[str, Any], description: Optional[str] = None, ) -> None: ... @@ -11084,14 +11174,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class OpenApiManagedAuthDetails(OpenApiAuthDetails, discriminator="managed_identity"): """Security details for OpenApi managed_identity authentication. - :ivar type: The object type, which is always 'managed_identity'. Required. + :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.""" + """The object type, which is always 'managed_identity'. Required. MANAGED_IDENTITY.""" security_scheme: "_models.OpenApiManagedSecurityScheme" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -11148,13 +11238,14 @@ class OpenApiProjectConnectionAuthDetails(OpenApiAuthDetails, discriminator="pro """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.""" + """The object type, which is always 'project_connection'. Required. PROJECT_CONNECTION.""" security_scheme: "_models.OpenApiProjectConnectionSecurityScheme" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -11210,14 +11301,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: 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. + :ivar type: The object type, which is always 'openapi'. 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[ToolType.OPENAPI] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'openapi'. Required.""" + """The object type, which is always 'openapi'. Required. OPENAPI.""" openapi: "_models.OpenApiFunctionDefinition" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -11309,7 +11400,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class OutputMessageContentOutputTextContent(OutputMessageContent, discriminator="output_text"): """Output text. - :ivar type: The type of the output text. Always ``output_text``. Required. + :ivar type: The type of the output text. Always ``output_text``. Required. OUTPUT_TEXT. :vartype type: str or ~azure.ai.projects.models.OUTPUT_TEXT :ivar text: The text output from the model. Required. :vartype text: str @@ -11320,7 +11411,7 @@ class OutputMessageContentOutputTextContent(OutputMessageContent, discriminator= """ type: Literal[OutputMessageContentType.OUTPUT_TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the output text. Always ``output_text``. Required.""" + """The type of the output text. Always ``output_text``. Required. OUTPUT_TEXT.""" text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The text output from the model. Required.""" annotations: list["_models.Annotation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -11351,14 +11442,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class OutputMessageContentRefusalContent(OutputMessageContent, discriminator="refusal"): """Refusal. - :ivar type: The type of the refusal. Always ``refusal``. Required. + :ivar type: The type of the refusal. Always ``refusal``. Required. REFUSAL. :vartype type: str or ~azure.ai.projects.models.REFUSAL :ivar refusal: The refusal explanation from the model. Required. :vartype refusal: str """ type: Literal[OutputMessageContentType.REFUSAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the refusal. Always ``refusal``. Required.""" + """The type of the refusal. Always ``refusal``. Required. REFUSAL.""" refusal: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The refusal explanation from the model. Required.""" @@ -11483,7 +11574,7 @@ class PromptAgentDefinition(AgentDefinition, discriminator="prompt"): :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. :vartype rai_config: ~azure.ai.projects.models.RaiConfig - :ivar kind: Required. + :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 @@ -11491,8 +11582,7 @@ class PromptAgentDefinition(AgentDefinition, discriminator="prompt"): :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. + deterministic. We generally recommend altering this or ``top_p`` but not both. :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 @@ -11503,27 +11593,31 @@ class PromptAgentDefinition(AgentDefinition, discriminator="prompt"): :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. + :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.PromptAgentDefinitionText + :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.""" + """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.""" + 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.""" 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 @@ -11533,9 +11627,15 @@ class PromptAgentDefinition(AgentDefinition, discriminator="prompt"): We generally recommend altering this or ``temperature`` but not both.""" 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.""" - text: Optional["_models.PromptAgentDefinitionText"] = rest_field( + """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 @@ -11557,7 +11657,8 @@ def __init__( top_p: Optional[float] = None, reasoning: Optional["_models.Reasoning"] = None, tools: Optional[list["_models.Tool"]] = None, - text: Optional["_models.PromptAgentDefinitionText"] = None, + tool_choice: Optional[Union[str, "_models.ToolChoiceParam"]] = None, + text: Optional["_models.PromptAgentDefinitionTextOptions"] = None, structured_inputs: Optional[dict[str, "_models.StructuredInputDefinition"]] = None, ) -> None: ... @@ -11573,8 +11674,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = AgentKind.PROMPT # type: ignore -class PromptAgentDefinitionText(_Model): - """PromptAgentDefinitionText. +class PromptAgentDefinitionTextOptions(_Model): + """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.TextResponseFormatConfiguration @@ -11607,20 +11709,20 @@ class PromptBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="prompt" :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: any + :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: any + :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 + :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""" + """Required. Prompt-based definition.""" prompt_text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The prompt text used for evaluation. Required.""" @@ -11629,8 +11731,8 @@ def __init__( self, *, prompt_text: str, - init_parameters: Optional[Any] = None, - data_schema: Optional[Any] = None, + init_parameters: Optional[dict[str, Any]] = None, + data_schema: Optional[dict[str, Any]] = None, metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, ) -> None: ... @@ -11810,13 +11912,14 @@ class ReasoningTextContent(OutputContent, discriminator="reasoning_text"): """ReasoningTextContent. :ivar type: The type of the reasoning text. Always ``reasoning_text``. Required. + REASONING_TEXT. :vartype type: str or ~azure.ai.projects.models.REASONING_TEXT :ivar text: The reasoning text from the model. Required. :vartype text: str """ type: Literal[OutputContentType.REASONING_TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the reasoning text. Always ``reasoning_text``. Required.""" + """The type of the reasoning text. Always ``reasoning_text``. Required. REASONING_TEXT.""" text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The reasoning text from the model. Required.""" @@ -12042,14 +12145,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SASCredentials(BaseCredentials, discriminator="SAS"): """Shared Access Signature (SAS) credential definition. - :ivar type: The credential type. Required. Shared Access Signature (SAS) credential + :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""" + """The credential type. Required. Shared Access Signature (SAS) credential.""" sas_token: Optional[str] = rest_field(name="SAS", visibility=["read"]) """SAS token.""" @@ -12202,14 +12305,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Screenshot(ComputerAction, discriminator="screenshot"): """Screenshot. - :ivar type: Specifies the event type. For a screenshot action, this property is - always set to ``screenshot``. Required. + :ivar type: Specifies the event type. For a screenshot action, this property is always set to + ``screenshot``. Required. SCREENSHOT. :vartype type: str or ~azure.ai.projects.models.SCREENSHOT """ type: Literal[ComputerActionType.SCREENSHOT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Specifies the event type. For a screenshot action, this property is - always set to ``screenshot``. Required.""" + """Specifies the event type. For a screenshot action, this property is always set to + ``screenshot``. Required. SCREENSHOT.""" @overload def __init__( @@ -12231,8 +12334,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Scroll(ComputerAction, discriminator="scroll"): """Scroll. - :ivar type: Specifies the event type. For a scroll action, this property is - always set to ``scroll``. Required. + :ivar type: Specifies the event type. For a scroll action, this property is always set to + ``scroll``. Required. SCROLL. :vartype type: str or ~azure.ai.projects.models.SCROLL :ivar x: The x-coordinate where the scroll occurred. Required. :vartype x: int @@ -12245,8 +12348,8 @@ class Scroll(ComputerAction, discriminator="scroll"): """ type: Literal[ComputerActionType.SCROLL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Specifies the event type. For a scroll action, this property is - always set to ``scroll``. Required.""" + """Specifies the event type. For a scroll action, this property is always set to ``scroll``. + Required. SCROLL.""" x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The x-coordinate where the scroll occurred. Required.""" y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -12282,16 +12385,15 @@ 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. + 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.""" + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool.""" @overload def __init__( @@ -12315,6 +12417,7 @@ 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: @@ -12322,7 +12425,8 @@ class SharepointPreviewTool(Tool, discriminator="sharepoint_grounding_preview"): """ 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.""" + """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"] ) @@ -12347,6 +12451,100 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.SHAREPOINT_GROUNDING_PREVIEW # type: ignore +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, + 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", and "code_interpreter". + :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\", + \"apply_patch\", \"shell\", \"file_search\", \"web_search_preview\", \"computer_use_preview\", + \"web_search_preview_2025_03_11\", \"image_generation\", and \"code_interpreter\".""" + + @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 StructuredInputDefinition(_Model): """An structured input that can participate in prompt template substitutions and tool argument binding. @@ -12356,7 +12554,7 @@ class StructuredInputDefinition(_Model): :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: any + :vartype schema: dict[str, any] :ivar required: Whether the input property is required when the agent is invoked. :vartype required: bool """ @@ -12365,7 +12563,7 @@ class StructuredInputDefinition(_Model): """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[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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.""" @@ -12376,7 +12574,7 @@ def __init__( *, description: Optional[str] = None, default_value: Optional[Any] = None, - schema: Optional[Any] = None, + schema: Optional[dict[str, Any]] = None, required: Optional[bool] = None, ) -> None: ... @@ -12400,7 +12598,7 @@ class StructuredOutputDefinition(_Model): emit the output. Required. :vartype description: str :ivar schema: The JSON schema for the structured output. Required. - :vartype schema: any + :vartype schema: dict[str, any] :ivar strict: Whether to enforce strict validation. Default ``true``. Required. :vartype strict: bool """ @@ -12410,7 +12608,7 @@ class StructuredOutputDefinition(_Model): 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: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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.""" @@ -12421,7 +12619,7 @@ def __init__( *, name: str, description: str, - schema: Any, + schema: dict[str, Any], strict: bool, ) -> None: ... @@ -12439,17 +12637,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class StructuredOutputsItemResource(ItemResource, discriminator="structured_outputs"): """StructuredOutputsItemResource. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str - :ivar type: Required. + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: Required. STRUCTURED_OUTPUTS. :vartype type: str or ~azure.ai.projects.models.STRUCTURED_OUTPUTS :ivar output: The structured output captured during the response. Required. :vartype output: any """ type: Literal[ItemResourceType.STRUCTURED_OUTPUTS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" + """Required. STRUCTURED_OUTPUTS.""" output: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The structured output captured during the response. Required.""" @@ -12458,7 +12657,8 @@ def __init__( self, *, output: Any, - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -12619,15 +12819,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class TextResponseFormatConfiguration(_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. + """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: TextResponseFormatConfigurationResponseFormatJsonObject, TextResponseFormatJsonSchema, @@ -12665,11 +12864,12 @@ class TextResponseFormatConfigurationResponseFormatJsonObject( """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.""" + """The type of response format being defined. Always ``json_object``. Required. JSON_OBJECT.""" @overload def __init__( @@ -12693,12 +12893,12 @@ class TextResponseFormatConfigurationResponseFormatText( ): # pylint: disable=name-too-long """Text. - :ivar type: The type of response format being defined. Always ``text``. Required. + :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.""" + """The type of response format being defined. Always ``text``. Required. TEXT.""" @overload def __init__( @@ -12721,12 +12921,13 @@ class TextResponseFormatJsonSchema(TextResponseFormatConfiguration, discriminato """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. + determine how to respond in the format. :vartype description: str - :ivar name: The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. Required. + :ivar 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] @@ -12735,13 +12936,13 @@ class TextResponseFormatJsonSchema(TextResponseFormatConfiguration, discriminato """ 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.""" + """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.""" + """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.""" + """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"]) @@ -12768,6 +12969,339 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = TextResponseFormatConfigurationType.JSON_SCHEMA # type: ignore +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: 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" } + ]. Required. + :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"]) + """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\" } + ]. Required.""" + + @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 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_PREVIEW2025_03_11. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW2025_03_11 + """ + + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW2025_03_11] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. WEB_SEARCH_PREVIEW2025_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_PREVIEW2025_03_11 # type: ignore + + class ToolDescription(_Model): """Description of a tool that can be used by an agent. @@ -12871,16 +13405,16 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Type(ComputerAction, discriminator="type"): """Type. - :ivar type: Specifies the event type. For a type action, this property is - always set to ``type``. Required. + :ivar type: Specifies the event type. For a type action, this property is always set to + ``type``. Required. TYPE. :vartype type: str or ~azure.ai.projects.models.TYPE :ivar text: The text to type. Required. :vartype text: str """ type: Literal[ComputerActionType.TYPE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Specifies the event type. For a type action, this property is - always set to ``type``. Required.""" + """Specifies the event type. For a type action, this property is always set to ``type``. Required. + TYPE.""" text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The text to type. Required.""" @@ -12906,7 +13440,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class UrlCitationBody(Annotation, discriminator="url_citation"): """URL citation. - :ivar type: The type of the URL citation. Always ``url_citation``. Required. + :ivar type: The type of the URL citation. Always ``url_citation``. Required. URL_CITATION. :vartype type: str or ~azure.ai.projects.models.URL_CITATION :ivar url: The URL of the web resource. Required. :vartype url: str @@ -12920,7 +13454,7 @@ class UrlCitationBody(Annotation, discriminator="url_citation"): """ type: Literal[AnnotationType.URL_CITATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the URL citation. Always ``url_citation``. Required.""" + """The type of the URL citation. Always ``url_citation``. Required. URL_CITATION.""" url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The URL of the web resource. Required.""" start_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -12996,11 +13530,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class VectorStoreFileAttributes(_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, booleans, or numbers. + """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, booleans, or numbers. """ @@ -13008,14 +13541,14 @@ class VectorStoreFileAttributes(_Model): class Wait(ComputerAction, discriminator="wait"): """Wait. - :ivar type: Specifies the event type. For a wait action, this property is - always set to ``wait``. Required. + :ivar type: Specifies the event type. For a wait action, this property is always set to + ``wait``. Required. WAIT. :vartype type: str or ~azure.ai.projects.models.WAIT """ type: Literal[ComputerActionType.WAIT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Specifies the event type. For a wait action, this property is - always set to ``wait``. Required.""" + """Specifies the event type. For a wait action, this property is always set to ``wait``. Required. + WAIT.""" @overload def __init__( @@ -13266,7 +13799,7 @@ 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 - ``web_search_preview_2025_03_11``. Required. + ``web_search_preview_2025_03_11``. Required. WEB_SEARCH_PREVIEW. :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW :ivar user_location: :vartype user_location: ~azure.ai.projects.models.ApproximateLocation @@ -13278,7 +13811,7 @@ class WebSearchPreviewTool(Tool, discriminator="web_search_preview"): type: Literal[ToolType.WEB_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The type of the web search tool. One of ``web_search_preview`` or - ``web_search_preview_2025_03_11``. Required.""" + ``web_search_preview_2025_03_11``. Required. WEB_SEARCH_PREVIEW.""" user_location: Optional["_models.ApproximateLocation"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -13313,7 +13846,7 @@ class WebSearchTool(Tool, discriminator="web_search"): """Web search. :ivar type: The type of the web search tool. One of ``web_search`` or - ``web_search_2025_08_26``. Required. + ``web_search_2025_08_26``. Required. WEB_SEARCH. :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH :ivar filters: :vartype filters: ~azure.ai.projects.models.WebSearchToolFilters @@ -13324,13 +13857,13 @@ class WebSearchTool(Tool, discriminator="web_search"): the following types: Literal["low"], Literal["medium"], Literal["high"] :vartype search_context_size: str or str or str :ivar custom_search_configuration: The project connections attached to this tool. There can be - a maximum of 1 connection - resource attached to the tool. + a maximum of 1 connection resource attached to the tool. :vartype custom_search_configuration: ~azure.ai.projects.models.WebSearchConfiguration """ type: Literal[ToolType.WEB_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the web search tool. One of ``web_search`` or ``web_search_2025_08_26``. Required.""" + """The type of the web search tool. One of ``web_search`` or ``web_search_2025_08_26``. Required. + WEB_SEARCH.""" filters: Optional["_models.WebSearchToolFilters"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -13346,8 +13879,8 @@ class WebSearchTool(Tool, discriminator="web_search"): custom_search_configuration: Optional["_models.WebSearchConfiguration"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The project connections attached to this tool. There can be a maximum of 1 connection - resource attached to the tool.""" + """The project connections attached to this tool. There can be a maximum of 1 connection resource + attached to the tool.""" @overload def __init__( @@ -13433,14 +13966,51 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RecurrenceType.WEEKLY # type: ignore -class WorkflowActionOutputItemResource(ItemResource, discriminator="workflow_action"): - """WorkflowActionOutputItemResource. +class WorkflowAgentDefinition(AgentDefinition, discriminator="workflow"): + """The workflow agent definition. - :ivar created_by: The information about the creator of the item. Is either a CreatedBy type or - a str type. - :vartype created_by: ~azure.ai.projects.models.CreatedBy or str - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.WORKFLOW_ACTION + :ivar rai_config: Configuration for Responsible AI (RAI) content filtering and safety features. + :vartype rai_config: ~azure.ai.projects.models.RaiConfig + :ivar kind: Required. WORKFLOW. + :vartype kind: str or ~azure.ai.projects.models.WORKFLOW + :ivar workflow: The CSDL YAML definition of the workflow. + :vartype workflow: str + """ + + kind: Literal[AgentKind.WORKFLOW] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. WORKFLOW.""" + workflow: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The CSDL YAML definition of the workflow.""" + + @overload + def __init__( + self, + *, + rai_config: Optional["_models.RaiConfig"] = None, + workflow: 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.WORKFLOW # type: ignore + + +class WorkflowPreviewActionOutputItemResource(ItemResource, discriminator="workflow_preview_action"): + """WorkflowPreviewActionOutputItemResource. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: Required. WORKFLOW_PREVIEW_ACTION. + :vartype type: str or ~azure.ai.projects.models.WORKFLOW_PREVIEW_ACTION :ivar kind: The kind of CSDL action (e.g., 'SetVariable', 'InvokeAzureAgent'). Required. :vartype kind: str :ivar action_id: Unique identifier for the action. Required. @@ -13455,8 +14025,8 @@ class WorkflowActionOutputItemResource(ItemResource, discriminator="workflow_act :vartype status: str or str or str or str """ - type: Literal[ItemResourceType.WORKFLOW_ACTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" + type: Literal[ItemResourceType.WORKFLOW_PREVIEW_ACTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. WORKFLOW_PREVIEW_ACTION.""" kind: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The kind of CSDL action (e.g., 'SetVariable', 'InvokeAzureAgent'). Required.""" action_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -13479,7 +14049,8 @@ def __init__( kind: str, action_id: str, status: Literal["completed", "failed", "in_progress", "cancelled"], - created_by: Optional[Union["_models.CreatedBy", str]] = None, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, parent_action_id: Optional[str] = None, previous_action_id: Optional[str] = None, ) -> None: ... @@ -13493,40 +14064,4 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemResourceType.WORKFLOW_ACTION # type: ignore - - -class WorkflowAgentDefinition(AgentDefinition, discriminator="workflow"): - """The workflow 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. - :vartype kind: str or ~azure.ai.projects.models.WORKFLOW - :ivar workflow: The CSDL YAML definition of the workflow. - :vartype workflow: str - """ - - kind: Literal[AgentKind.WORKFLOW] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - workflow: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The CSDL YAML definition of the workflow.""" - - @overload - def __init__( - self, - *, - rai_config: Optional["_models.RaiConfig"] = None, - workflow: 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.WORKFLOW # type: ignore + self.type = ItemResourceType.WORKFLOW_PREVIEW_ACTION # type: ignore 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 5ae1225f30fa..7c53165b9f1d 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 @@ -13,16 +13,16 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import AgentsOperations # type: ignore -from ._operations import MemoryStoresOperations # type: ignore from ._operations import ConnectionsOperations # type: ignore from ._operations import DatasetsOperations # type: ignore -from ._operations import IndexesOperations # type: ignore from ._operations import DeploymentsOperations # type: ignore -from ._operations import RedTeamsOperations # type: ignore -from ._operations import EvaluationRulesOperations # type: ignore from ._operations import EvaluationTaxonomiesOperations # type: ignore +from ._operations import EvaluationRulesOperations # type: ignore from ._operations import EvaluatorsOperations # type: ignore +from ._operations import IndexesOperations # type: ignore from ._operations import InsightsOperations # type: ignore +from ._operations import MemoryStoresOperations # type: ignore +from ._operations import RedTeamsOperations # type: ignore from ._operations import SchedulesOperations # type: ignore from ._patch import __all__ as _patch_all @@ -31,16 +31,16 @@ __all__ = [ "AgentsOperations", - "MemoryStoresOperations", "ConnectionsOperations", "DatasetsOperations", - "IndexesOperations", "DeploymentsOperations", - "RedTeamsOperations", - "EvaluationRulesOperations", "EvaluationTaxonomiesOperations", + "EvaluationRulesOperations", "EvaluatorsOperations", + "IndexesOperations", "InsightsOperations", + "MemoryStoresOperations", + "RedTeamsOperations", "SchedulesOperations", ] __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 3def1c5f7d71..dcda64b4245b 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 @@ -37,6 +37,7 @@ from .._configuration import AIProjectClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer +from ..models._enums import FoundryPreviewOptInKeys JSON = MutableMapping[str, Any] _Unset: Any = object() @@ -52,7 +53,7 @@ def build_agents_get_request(agent_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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,12 +73,23 @@ 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_create_request(**kwargs: Any) -> HttpRequest: +def build_agents_create_request( + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = 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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,6 +99,8 @@ def build_agents_create_request(**kwargs: Any) -> HttpRequest: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if foundry_beta is not None: + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -94,12 +108,14 @@ def build_agents_create_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_update_request(agent_name: str, **kwargs: Any) -> HttpRequest: +def build_agents_update_request( + agent_name: str, *, foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = 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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,6 +130,8 @@ def build_agents_update_request(agent_name: str, **kwargs: Any) -> HttpRequest: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if foundry_beta is not None: + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -121,12 +139,18 @@ def build_agents_update_request(agent_name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_create_from_manifest_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long +def build_agents_create_from_manifest_request( # pylint: disable=name-too-long + *, + foundry_beta: Optional[ + Union[Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1]] + ] = 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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,6 +160,8 @@ def build_agents_create_from_manifest_request(**kwargs: Any) -> HttpRequest: # _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if foundry_beta is not None: + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -144,13 +170,13 @@ def build_agents_create_from_manifest_request(**kwargs: Any) -> HttpRequest: # def build_agents_update_from_manifest_request( # pylint: disable=name-too-long - agent_name: str, **kwargs: Any + agent_name: str, *, foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = 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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -165,6 +191,8 @@ def build_agents_update_from_manifest_request( # pylint: disable=name-too-long _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if foundry_beta is not None: + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -172,11 +200,18 @@ def build_agents_update_from_manifest_request( # pylint: disable=name-too-long return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_delete_request(agent_name: str, **kwargs: Any) -> HttpRequest: +def build_agents_delete_request( + agent_name: str, + *, + foundry_beta: Optional[ + Union[Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1]] + ] = 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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,6 +226,8 @@ def build_agents_delete_request(agent_name: str, **kwargs: Any) -> HttpRequest: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if foundry_beta is not None: + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) @@ -208,14 +245,13 @@ def build_agents_list_request( _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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = "/agents" # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") if kind is not None: _params["kind"] = _SERIALIZER.query("kind", kind, "str") if limit is not None: @@ -226,6 +262,7 @@ def build_agents_list_request( _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") @@ -233,12 +270,24 @@ def build_agents_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_create_version_request(agent_name: str, **kwargs: Any) -> HttpRequest: +def build_agents_create_version_request( + agent_name: str, + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = 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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -253,6 +302,8 @@ def build_agents_create_version_request(agent_name: str, **kwargs: Any) -> HttpR _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if foundry_beta is not None: + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -267,7 +318,7 @@ def build_agents_create_version_from_manifest_request( # pylint: disable=name-t _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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -293,7 +344,7 @@ def build_agents_get_version_request(agent_name: str, agent_version: str, **kwar _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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -314,11 +365,19 @@ def build_agents_get_version_request(agent_name: str, agent_version: str, **kwar return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_delete_version_request(agent_name: str, agent_version: str, **kwargs: Any) -> HttpRequest: +def build_agents_delete_version_request( + agent_name: str, + agent_version: str, + *, + foundry_beta: Optional[ + Union[Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1]] + ] = 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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -334,6 +393,8 @@ def build_agents_delete_version_request(agent_name: str, agent_version: str, **k _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if foundry_beta is not None: + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) @@ -351,7 +412,7 @@ def build_agents_list_versions_request( _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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -363,7 +424,6 @@ def build_agents_list_versions_request( _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") if limit is not None: _params["limit"] = _SERIALIZER.query("limit", limit, "int") if order is not None: @@ -372,6 +432,7 @@ def build_agents_list_versions_request( _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") @@ -383,14 +444,16 @@ def build_agents_stream_agent_container_logs_request( # pylint: disable=name-to agent_name: str, agent_version: str, *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1]] = None, kind: Optional[Union[str, _models.ContainerLogKind]] = None, replica_name: Optional[str] = None, tail: 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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) # Construct URL _url = "/agents/{agent_name}/versions/{agent_version}/containers/default:logstream" path_format_arguments = { @@ -401,49 +464,56 @@ def build_agents_stream_agent_container_logs_request( # pylint: disable=name-to _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") if kind is not None: _params["kind"] = _SERIALIZER.query("kind", kind, "str") if replica_name is not None: _params["replica_name"] = _SERIALIZER.query("replica_name", replica_name, "str") if tail is not None: _params["tail"] = _SERIALIZER.query("tail", tail, "int") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + if foundry_beta is not None: + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_memory_stores_create_request(**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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores" + _url = "/connections/{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="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_memory_stores_update_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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) + 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 = "/connections/{name}/getConnectionWithCredentials" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -454,22 +524,48 @@ def build_memory_stores_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="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_memory_stores_get_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 {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) + 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 = "/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") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +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 {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/datasets/{name}/versions" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -485,33 +581,18 @@ def build_memory_stores_get_request(name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_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: +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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores" + _url = "/datasets" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "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") @@ -519,17 +600,18 @@ def build_memory_stores_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_memory_stores_delete_request(name: 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 {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) + 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 = "/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 @@ -540,23 +622,18 @@ def build_memory_stores_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_memory_stores_search_memories_request( # pylint: disable=name-too-long - name: 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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) # Construct URL - _url = "/memory_stores/{name}:search_memories" + _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 @@ -564,28 +641,22 @@ def build_memory_stores_search_memories_request( # pylint: disable=name-too-lon # 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="DELETE", url=_url, params=_params, **kwargs) -def build_memory_stores_update_memories_request( # pylint: disable=name-too-long - 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 {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}:update_memories" + _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 @@ -598,21 +669,22 @@ def build_memory_stores_update_memories_request( # pylint: disable=name-too-lon _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_memory_stores_delete_scope_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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/memory_stores/{name}:delete_scope" + _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 @@ -628,17 +700,18 @@ def build_memory_stores_delete_scope_request(name: str, **kwargs: Any) -> HttpRe 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 {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) 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 @@ -649,20 +722,18 @@ 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 {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/connections/{name}/getConnectionWithCredentials" + _url = "/deployments/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -675,30 +746,33 @@ 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 {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) 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") @@ -706,15 +780,15 @@ 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_evaluation_taxonomies_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", "2025-11-15-preview")) + 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 = "/evaluationtaxonomies/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -730,18 +804,24 @@ 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_evaluation_taxonomies_list_request( + *, 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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets" + _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") @@ -749,18 +829,17 @@ 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_evaluation_taxonomies_delete_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", "2025-11-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) # Construct URL - _url = "/datasets/{name}/versions/{version}" + _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 @@ -769,20 +848,24 @@ def build_datasets_get_request(name: str, version: str, **kwargs: Any) -> HttpRe _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, headers=_headers, **kwargs) -def build_datasets_delete_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_evaluation_taxonomies_create_request( # pylint: disable=name-too-long + name: str, *, foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = 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", "2025-11-15-preview")) + 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 = "/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 @@ -790,22 +873,30 @@ 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 + if foundry_beta is not None: + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "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) -def build_datasets_create_or_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_evaluation_taxonomies_update_request( # pylint: disable=name-too-long + name: str, *, foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = 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", "2025-11-15-preview")) + 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 = "/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 @@ -814,6 +905,8 @@ 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 foundry_beta is not None: + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -821,19 +914,17 @@ 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_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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) + 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}/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 @@ -842,25 +933,20 @@ 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_delete_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", "2025-11-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) # 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 @@ -869,22 +955,24 @@ def build_datasets_get_credentials_request(name: str, version: str, **kwargs: An _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) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_indexes_list_versions_request(name: str, **kwargs: Any) -> HttpRequest: +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 {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) + 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" + _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 @@ -893,23 +981,37 @@ 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 {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) 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") @@ -917,60 +1019,83 @@ 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_evaluators_list_versions_request( + name: str, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + 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", "2025-11-15-preview")) + 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 = "/evaluators/{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 _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["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") 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_evaluators_list_latest_versions_request( # pylint: disable=name-too-long + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + 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", "2025-11-15-preview")) - # Construct URL - _url = "/indexes/{name}/versions/{version}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), - } + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) + accept = _headers.pop("Accept", "application/json") - _url: str = _url.format(**path_format_arguments) # type: ignore + # 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") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_indexes_create_or_update_request(name: str, version: str, **kwargs: Any) -> HttpRequest: + +def build_evaluators_get_version_request( + name: str, version: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], **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", "2025-11-15-preview")) + 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 = "/evaluators/{name}/versions/{version}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), "version": _SERIALIZER.url("version", version, "str"), @@ -982,24 +1107,24 @@ 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["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "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_deployments_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_evaluators_delete_version_request( + name: str, version: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], **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", "2025-11-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) # Construct URL - _url = "/deployments/{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 @@ -1008,53 +1133,56 @@ def build_deployments_get_request(name: str, **kwargs: Any) -> HttpRequest: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "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_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_evaluators_create_version_request( + name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], **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", "2025-11-15-preview")) + 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" + _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 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["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "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="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_red_teams_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_evaluators_update_version_request( + name: str, version: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], **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", "2025-11-15-preview")) + 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/{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 @@ -1063,20 +1191,28 @@ def build_red_teams_get_request(name: str, **kwargs: Any) -> HttpRequest: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "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_red_teams_list_request(**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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/redTeams/runs" + _url = "/indexes/{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") @@ -1087,39 +1223,37 @@ def build_red_teams_list_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_red_teams_create_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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/redTeams/runs:run" + _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="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluation_rules_get_request(id: 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 {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationrules/{id}" + _url = "/indexes/{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 @@ -1133,15 +1267,15 @@ def build_evaluation_rules_get_request(id: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluation_rules_delete_request(id: str, **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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) # Construct URL - _url = "/evaluationrules/{id}" + _url = "/indexes/{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 @@ -1149,25 +1283,22 @@ def build_evaluation_rules_delete_request(id: str, **kwargs: Any) -> HttpRequest # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + 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: +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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationrules/{id}" + _url = "/indexes/{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 @@ -1180,57 +1311,59 @@ 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) + return HttpRequest(method="PATCH", 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_insights_generate_request( + *, foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], **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", "2025-11-15-preview")) + 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" + _url = "/insights" # 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["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + 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_evaluation_taxonomies_get_request(name: str, **kwargs: Any) -> HttpRequest: +def build_insights_get_request(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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies/{name}" + _url = "/insights/{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 # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if include_coordinates is not None: + _params["includeCoordinates"] = _SERIALIZER.query("include_coordinates", include_coordinates, "bool") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1238,24 +1371,36 @@ def build_evaluation_taxonomies_get_request(name: str, **kwargs: Any) -> HttpReq return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluation_taxonomies_list_request( - *, input_name: Optional[str] = None, input_type: Optional[str] = None, **kwargs: Any +def build_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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies" + _url = "/insights" # 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 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") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1263,41 +1408,43 @@ def build_evaluation_taxonomies_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluation_taxonomies_delete_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_memory_stores_create_request( + *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **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", "2025-11-15-preview")) - # Construct URL - _url = "/evaluationtaxonomies/{name}" - path_format_arguments = { - "name": _SERIALIZER.url("name", name, "str"), - } + 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") - _url: str = _url.format(**path_format_arguments) # type: ignore + # Construct URL + _url = "/memory_stores" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluation_taxonomies_create_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_memory_stores_update_request( + name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies/{name}" + _url = "/memory_stores/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -1308,25 +1455,25 @@ def build_evaluation_taxonomies_create_request( # pylint: disable=name-too-long _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "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) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluation_taxonomies_update_request( # pylint: disable=name-too-long - name: str, **kwargs: Any +def build_memory_stores_get_request( + name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluationtaxonomies/{name}" + _url = "/memory_stores/{name}" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -1337,87 +1484,89 @@ def build_evaluation_taxonomies_update_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["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "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_evaluators_list_versions_request( - name: str, +def build_memory_stores_list_request( *, - type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], limit: Optional[int] = None, - **kwargs: Any + 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", "2025-11-15-preview")) + 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 = "/memory_stores" # 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["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluators_list_latest_versions_request( # pylint: disable=name-too-long - *, - type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, - limit: Optional[int] = None, - **kwargs: Any +def build_memory_stores_delete_request( + name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/evaluators" + _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") - 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["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") _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_evaluators_get_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_memory_stores_search_memories_request( # pylint: disable=name-too-long + name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **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", "2025-11-15-preview")) + 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 = "/memory_stores/{name}:search_memories" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1426,40 +1575,26 @@ def build_evaluators_get_version_request(name: str, version: str, **kwargs: Any) _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "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) - - -def build_evaluators_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", "2025-11-15-preview")) - # 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) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluators_create_version_request(name: str, **kwargs: Any) -> HttpRequest: +def build_memory_stores_update_memories_request( # pylint: disable=name-too-long + name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **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", "2025-11-15-preview")) + 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 = "/memory_stores/{name}:update_memories" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), } @@ -1470,6 +1605,7 @@ def build_evaluators_create_version_request(name: str, **kwargs: Any) -> HttpReq _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1477,19 +1613,20 @@ def build_evaluators_create_version_request(name: str, **kwargs: Any) -> HttpReq return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_evaluators_update_version_request(name: str, version: str, **kwargs: Any) -> HttpRequest: +def build_memory_stores_delete_scope_request( + name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **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", "2025-11-15-preview")) + 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 = "/memory_stores/{name}:delete_scope" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), - "version": _SERIALIZER.url("version", version, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1498,60 +1635,50 @@ def build_evaluators_update_version_request(name: str, version: str, **kwargs: A _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "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_insights_generate_request(**kwargs: Any) -> HttpRequest: +def build_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 {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/insights" + _url = "/redTeams/runs/{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="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_insights_get_request(id: str, *, include_coordinates: Optional[bool] = None, **kwargs: Any) -> HttpRequest: +def build_red_teams_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", "2025-11-15-preview")) + 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("id", id, "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") - if include_coordinates is not None: - _params["includeCoordinates"] = _SERIALIZER.query("include_coordinates", include_coordinates, "bool") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -1559,48 +1686,37 @@ def build_insights_get_request(id: str, *, include_coordinates: Optional[bool] = return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_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_red_teams_create_request( + *, foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = 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", "2025-11-15-preview")) + 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 = "/redTeams/runs:run" # 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") # Construct headers + if foundry_beta is not None: + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "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="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_schedules_delete_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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) # Construct URL _url = "/schedules/{id}" path_format_arguments = { @@ -1621,7 +1737,7 @@ def build_schedules_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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1645,7 +1761,7 @@ def build_schedules_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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1665,7 +1781,7 @@ def build_schedules_create_or_update_request(id: str, **kwargs: Any) -> HttpRequ _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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1687,18 +1803,20 @@ def build_schedules_create_or_update_request(id: str, **kwargs: Any) -> HttpRequ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_schedules_get_run_request(schedule_id: str, run_id: str, **kwargs: Any) -> HttpRequest: +def build_schedules_get_run_request( + schedule_id: str, run_id: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], **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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/schedules/{scheduleId}/runs/{runId}" + _url = "/schedules/{schedule_id}/runs/{run_id}" path_format_arguments = { - "scheduleId": _SERIALIZER.url("schedule_id", schedule_id, "str"), - "runId": _SERIALIZER.url("run_id", run_id, "str"), + "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 @@ -1707,6 +1825,7 @@ def build_schedules_get_run_request(schedule_id: str, run_id: str, **kwargs: Any _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) @@ -1716,7 +1835,7 @@ def build_schedules_list_runs_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", "2025-11-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "v1")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1823,6 +1942,14 @@ def create( *, name: str, definition: _models.AgentDefinition, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, @@ -1840,6 +1967,16 @@ def create( :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 foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or + ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1858,11 +1995,35 @@ def create( """ @overload - def create(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.AgentDetails: + def create( + self, + body: JSON, + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AgentDetails: """Creates the agent. :param body: Required. :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or + ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1872,11 +2033,35 @@ def create(self, body: JSON, *, content_type: str = "application/json", **kwargs """ @overload - def create(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> _models.AgentDetails: + def create( + self, + body: IO[bytes], + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AgentDetails: """Creates the agent. :param body: Required. :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or + ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1892,6 +2077,14 @@ def create( *, name: str = _Unset, definition: _models.AgentDefinition = _Unset, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any @@ -1910,6 +2103,16 @@ def create( :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 foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or + ~azure.ai.projects.models.MEMORY_STORES_V1 :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. @@ -1952,6 +2155,7 @@ def create( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_agents_create_request( + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -1999,19 +2203,23 @@ def update( agent_name: str, *, definition: _models.AgentDefinition, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any ) -> _models.AgentDetails: - """Updates the agent by adding a new version if there are any changes to the agent definition. - If no changes, returns the existing agent version. + """Updates the 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 agent to retrieve. 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 foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2031,15 +2239,24 @@ def update( @overload def update( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: JSON, + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: - """Updates the agent by adding a new version if there are any changes to the agent definition. - If no changes, returns the existing agent version. + """Updates the 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 agent to retrieve. Required. :type agent_name: str :param body: Required. :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2050,15 +2267,24 @@ def update( @overload def update( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: IO[bytes], + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: - """Updates the agent by adding a new version if there are any changes to the agent definition. - If no changes, returns the existing agent version. + """Updates the 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 agent to retrieve. Required. :type agent_name: str :param body: Required. :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -2074,12 +2300,13 @@ def update( body: Union[JSON, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any ) -> _models.AgentDetails: - """Updates the agent by adding a new version if there are any changes to the agent definition. - If no changes, returns the existing agent version. + """Updates the 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 agent to retrieve. Required. :type agent_name: str @@ -2088,6 +2315,9 @@ def update( :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 foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :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. @@ -2129,6 +2359,7 @@ def update( _request = build_agents_update_request( agent_name=agent_name, + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -2177,6 +2408,11 @@ def create_from_manifest( name: str, manifest_id: str, parameter_values: dict[str, Any], + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] + ] + ] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, @@ -2196,6 +2432,12 @@ def create_from_manifest( :keyword parameter_values: The inputs to the manifest that will result in a fully materialized Agent. Required. :paramtype parameter_values: dict[str, any] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is either a + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2215,12 +2457,27 @@ def create_from_manifest( @overload def create_from_manifest( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + body: JSON, + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] + ] + ] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: """Creates an agent from a manifest. :param body: Required. :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is either a + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2231,12 +2488,27 @@ def create_from_manifest( @overload def create_from_manifest( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + body: IO[bytes], + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] + ] + ] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: """Creates an agent from a manifest. :param body: Required. :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is either a + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -2253,6 +2525,11 @@ def create_from_manifest( name: str = _Unset, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] + ] + ] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any @@ -2273,6 +2550,12 @@ def create_from_manifest( :keyword parameter_values: The inputs to the manifest that will result in a fully materialized Agent. Required. :paramtype parameter_values: dict[str, any] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is either a + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 :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. @@ -2323,6 +2606,7 @@ def create_from_manifest( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_agents_create_from_manifest_request( + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -2371,14 +2655,14 @@ def update_from_manifest( *, manifest_id: str, parameter_values: dict[str, Any], + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any ) -> _models.AgentDetails: """Updates the agent from a manifest by adding a new version if there are any changes to the agent - definition. - If no changes, returns the existing agent version. + definition. If no changes, returns the existing agent version. :param agent_name: The name of the agent to update. Required. :type agent_name: str @@ -2387,6 +2671,9 @@ def update_from_manifest( :keyword parameter_values: The inputs to the manifest that will result in a fully materialized Agent. Required. :paramtype parameter_values: dict[str, any] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2406,16 +2693,24 @@ def update_from_manifest( @overload def update_from_manifest( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: JSON, + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: """Updates the agent from a manifest by adding a new version if there are any changes to the agent - definition. - If no changes, returns the existing agent version. + definition. If no changes, returns the existing agent version. :param agent_name: The name of the agent to update. Required. :type agent_name: str :param body: Required. :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2426,16 +2721,24 @@ def update_from_manifest( @overload def update_from_manifest( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: IO[bytes], + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: """Updates the agent from a manifest by adding a new version if there are any changes to the agent - definition. - If no changes, returns the existing agent version. + definition. If no changes, returns the existing agent version. :param agent_name: The name of the agent to update. Required. :type agent_name: str :param body: Required. :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -2452,13 +2755,13 @@ def update_from_manifest( *, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any ) -> _models.AgentDetails: """Updates the agent from a manifest by adding a new version if there are any changes to the agent - definition. - If no changes, returns the existing agent version. + definition. If no changes, returns the existing agent version. :param agent_name: The name of the agent to update. Required. :type agent_name: str @@ -2469,6 +2772,9 @@ def update_from_manifest( :keyword parameter_values: The inputs to the manifest that will result in a fully materialized Agent. Required. :paramtype parameter_values: dict[str, any] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :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. @@ -2517,6 +2823,7 @@ def update_from_manifest( _request = build_agents_update_from_manifest_request( agent_name=agent_name, + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -2559,11 +2866,27 @@ def update_from_manifest( return deserialized # type: ignore @distributed_trace - def delete(self, agent_name: str, **kwargs: Any) -> _models.DeleteAgentResponse: + def delete( + self, + agent_name: str, + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] + ] + ] = None, + **kwargs: Any + ) -> _models.DeleteAgentResponse: """Deletes an agent. :param agent_name: The name of the agent to delete. Required. :type agent_name: str + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is either a + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 :return: DeleteAgentResponse. The DeleteAgentResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DeleteAgentResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -2583,6 +2906,7 @@ def delete(self, agent_name: str, **kwargs: Any) -> _models.DeleteAgentResponse: _request = build_agents_delete_request( agent_name=agent_name, + foundry_beta=foundry_beta, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2629,9 +2953,10 @@ def list( kind: Optional[Union[str, _models.AgentKind]] = None, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, + after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.AgentDetails"]: + ) -> _models.AgentsPagedResultAgentObject: """Returns the list of all agents. :keyword kind: Filter agents by kind. If not provided, all agents are returned. Known values @@ -2645,21 +2970,23 @@ 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: A cursor for use in pagination. ``after`` 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 after=obj_foo in order to fetch the next page of the list. Default + value is None. + :paramtype after: str :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] + :return: AgentsPagedResultAgentObject. The AgentsPagedResultAgentObject is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.AgentsPagedResultAgentObject :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, @@ -2668,51 +2995,55 @@ def list( } 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_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 + cls: ClsType[_models.AgentsPagedResultAgentObject] = kwargs.pop("cls", None) - 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) + _request = build_agents_list_request( + kind=kind, + limit=limit, + order=order, + after=after, + 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) - def get_next(_continuation_token=None): - _request = prepare_request(_continuation_token) + _stream = kwargs.pop("stream", False) + 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) + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AgentsPagedResultAgentObject, response.json()) - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - return ItemPaged(get_next, extract_data) + return deserialized # type: ignore @overload def create_version( @@ -2720,6 +3051,14 @@ def create_version( agent_name: str, *, definition: _models.AgentDefinition, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, @@ -2737,6 +3076,16 @@ def create_version( :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 foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or + ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2756,7 +3105,20 @@ 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: JSON, + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentVersionDetails: """Create a new agent version. @@ -2769,6 +3131,16 @@ def create_version( :type agent_name: str :param body: Required. :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or + ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2779,7 +3151,20 @@ def create_version( @overload def create_version( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: IO[bytes], + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentVersionDetails: """Create a new agent version. @@ -2792,6 +3177,16 @@ def create_version( :type agent_name: str :param body: Required. :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or + ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -2807,6 +3202,14 @@ def create_version( body: Union[JSON, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + ] + ] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any @@ -2825,6 +3228,16 @@ def create_version( :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 foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or + ~azure.ai.projects.models.MEMORY_STORES_V1 :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. @@ -2866,6 +3279,7 @@ def create_version( _request = build_agents_create_version_request( agent_name=agent_name, + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -3181,13 +3595,30 @@ 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, **kwargs: Any) -> _models.DeleteAgentVersionResponse: + def delete_version( + self, + agent_name: str, + agent_version: str, + *, + foundry_beta: Optional[ + Union[ + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] + ] + ] = None, + **kwargs: Any + ) -> _models.DeleteAgentVersionResponse: """Deletes a specific version of an agent. :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 foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is either a + Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a + Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1 :return: DeleteAgentVersionResponse. The DeleteAgentVersionResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DeleteAgentVersionResponse @@ -3209,6 +3640,7 @@ def delete_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _request = build_agents_delete_version_request( agent_name=agent_name, agent_version=agent_version, + foundry_beta=foundry_beta, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3345,6 +3777,7 @@ def stream_agent_container_logs( # pylint: disable=inconsistent-return-statemen agent_name: str, agent_version: str, *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1]] = None, kind: Optional[Union[str, _models.ContainerLogKind]] = None, replica_name: Optional[str] = None, tail: Optional[int] = None, @@ -3380,6 +3813,9 @@ def stream_agent_container_logs( # pylint: disable=inconsistent-return-statemen :type agent_name: str :param agent_version: The version of the agent. Required. :type agent_version: str + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. CONTAINER_AGENTS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 :keyword kind: console returns container stdout/stderr, system returns container app event stream. defaults to console. Known values are: "console" and "system". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.ContainerLogKind @@ -3409,6 +3845,7 @@ def stream_agent_container_logs( # pylint: disable=inconsistent-return-statemen _request = build_agents_stream_agent_container_logs_request( agent_name=agent_name, agent_version=agent_version, + foundry_beta=foundry_beta, kind=kind, replica_name=replica_name, tail=tail, @@ -3440,14 +3877,14 @@ def stream_agent_container_logs( # pylint: disable=inconsistent-return-statemen return cls(pipeline_response, None, {}) # type: ignore -class MemoryStoresOperations: +class ConnectionsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`memory_stores` attribute. + :attr:`connections` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -3457,94 +3894,14 @@ 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( - self, - *, - name: str, - definition: _models.MemoryStoreDefinition, - content_type: str = "application/json", - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - **kwargs: Any - ) -> _models.MemoryStoreDetails: - """Create a memory store. - - :keyword name: The name of the memory store. Required. - :paramtype name: str - :keyword definition: The memory store definition. Required. - :paramtype definition: ~azure.ai.projects.models.MemoryStoreDefinition - :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 memory store. Default value is None. - :paramtype description: str - :keyword metadata: Arbitrary key-value metadata to associate with the memory store. Default - value is None. - :paramtype metadata: dict[str, str] - :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreDetails: - """Create a memory store. - - :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: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreDetails: - """Create a memory store. - - :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: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def create( - self, - body: Union[JSON, IO[bytes]] = _Unset, - *, - name: str = _Unset, - definition: _models.MemoryStoreDefinition = _Unset, - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - **kwargs: Any - ) -> _models.MemoryStoreDetails: - """Create a memory store. + def _get(self, name: str, **kwargs: Any) -> _models.Connection: + """Get a connection by name, without populating connection credentials. - :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. - :paramtype definition: ~azure.ai.projects.models.MemoryStoreDefinition - :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 - value is None. - :paramtype metadata: dict[str, str] - :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails + :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 = { @@ -3555,30 +3912,14 @@ def create( } 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.MemoryStoreDetails] = 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 = {"definition": definition, "description": description, "metadata": metadata, "name": name} - 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_memory_stores_create_request( - content_type=content_type, + _request = build_connections_get_request( + name=name, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -3601,108 +3942,31 @@ def create( 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() else: - deserialized = _deserialize(_models.MemoryStoreDetails, 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 - @overload - def update( - self, - name: str, - *, - content_type: str = "application/json", - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - **kwargs: Any - ) -> _models.MemoryStoreDetails: - """Update a memory store. - - :param name: The name of the memory store to update. Required. - :type name: 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: 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 - value is None. - :paramtype metadata: dict[str, str] - :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreDetails: - """Update a memory store. - - :param name: The name of the memory store 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: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreDetails: - """Update a memory store. - - :param name: The name of the memory store 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: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def update( - self, - name: str, - body: Union[JSON, IO[bytes]] = _Unset, - *, - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, - **kwargs: Any - ) -> _models.MemoryStoreDetails: - """Update a memory store. + def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Connection: + """Get a connection by name, with its connection credentials. - :param name: The name of the memory store to update. Required. + :param name: The friendly name of the connection, provided by the user. Required. :type name: str - :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 - value is None. - :paramtype metadata: dict[str, str] - :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails + :return: Connection. The Connection is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Connection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3713,27 +3977,14 @@ 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.MemoryStoreDetails] = kwargs.pop("cls", None) - - if body is _Unset: - body = {"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 + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) - _request = build_memory_stores_update_request( + _request = build_connections_get_with_credentials_request( name=name, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -3756,32 +4007,49 @@ def update( 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() else: - deserialized = _deserialize(_models.MemoryStoreDetails, 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(self, name: str, **kwargs: Any) -> _models.MemoryStoreDetails: - """Retrieve a memory store. + def list( + self, + *, + connection_type: Optional[Union[str, _models.ConnectionType]] = None, + default_connection: Optional[bool] = None, + **kwargs: Any + ) -> ItemPaged["_models.Connection"]: + """List all connections in the project, without populating connection credentials. - :param name: The name of the memory store to retrieve. Required. - :type name: str - :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDetails + :keyword connection_type: List 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: List 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, @@ -3790,85 +4058,101 @@ def get(self, name: str, **kwargs: Any) -> _models.MemoryStoreDetails: } 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[_models.MemoryStoreDetails] = 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_memory_stores_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) + 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), 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 = kwargs.pop("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 [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, + 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 _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.MemoryStoreDetails, response.json()) + 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, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return ItemPaged(get_next, extract_data) + + +class DatasetsOperations: + """ + .. 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( - self, - *, - limit: Optional[int] = None, - order: Optional[Union[str, _models.PageOrder]] = None, - before: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.MemoryStoreDetails"]: - """List all memory stores. + def list_versions(self, name: str, **kwargs: Any) -> ItemPaged["_models.DatasetVersion"]: + """List all versions of the given DatasetVersion. - :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 MemoryStoreDetails - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.MemoryStoreDetails] + :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.MemoryStoreDetails]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.DatasetVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3878,32 +4162,53 @@ 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_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), 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_memory_stores_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.MemoryStoreDetails], deserialized.get("data", [])) + list_of_elem = _deserialize(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 @@ -3913,30 +4218,111 @@ 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 delete(self, name: str, **kwargs: Any) -> _models.DeleteMemoryStoreResult: - """Delete a memory store. + def list(self, **kwargs: Any) -> ItemPaged["_models.DatasetVersion"]: + """List the latest version of each DatasetVersion. - :param name: The name of the memory store to delete. Required. - :type name: str - :return: DeleteMemoryStoreResult. The DeleteMemoryStoreResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DeleteMemoryStoreResult + :return: An iterator like instance of DatasetVersion + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.DatasetVersion] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, + _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, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + 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), 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) + + _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 get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: + """Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the + DatasetVersion 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. + :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 = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -3944,10 +4330,11 @@ def delete(self, name: str, **kwargs: Any) -> _models.DeleteMemoryStoreResult: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeleteMemoryStoreResult] = kwargs.pop("cls", None) + cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) - _request = build_memory_stores_delete_request( + _request = build_datasets_get_request( name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3971,122 +4358,29 @@ def delete(self, name: str, **kwargs: Any) -> _models.DeleteMemoryStoreResult: 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() else: - deserialized = _deserialize(_models.DeleteMemoryStoreResult, response.json()) + deserialized = _deserialize(_models.DatasetVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def search_memories( - self, - name: str, - *, - scope: str, - content_type: str = "application/json", - items: Optional[List[_models.InputItem]] = None, - previous_search_id: Optional[str] = None, - options: Optional[_models.MemorySearchOptions] = None, - **kwargs: Any - ) -> _models.MemoryStoreSearchResult: - """Search for relevant memories from a memory store based on conversation context. - - :param name: The name of the memory store to search. Required. - :type name: str - :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. - Required. - :paramtype scope: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword items: Items for which to search for relevant memories. Default value is None. - :paramtype items: list[~azure.ai.projects.models.InputItem] - :keyword previous_search_id: The unique ID of the previous search request, enabling incremental - memory search from where the last operation left off. Default value is None. - :paramtype previous_search_id: str - :keyword options: Memory search options. Default value is None. - :paramtype options: ~azure.ai.projects.models.MemorySearchOptions - :return: MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreSearchResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def search_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreSearchResult: - """Search for relevant memories from a memory store based on conversation context. - - :param name: The name of the memory store to search. 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: MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreSearchResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def search_memories( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreSearchResult: - """Search for relevant memories from a memory store based on conversation context. - - :param name: The name of the memory store to search. 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: MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreSearchResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def search_memories( - self, - name: str, - body: Union[JSON, IO[bytes]] = _Unset, - *, - scope: str = _Unset, - items: Optional[List[_models.InputItem]] = None, - previous_search_id: Optional[str] = None, - options: Optional[_models.MemorySearchOptions] = None, - **kwargs: Any - ) -> _models.MemoryStoreSearchResult: - """Search for relevant memories from a memory store based on conversation context. + def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """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 name: The name of the memory store to search. Required. + :param name: The name of the resource. Required. :type name: str - :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 - :keyword items: Items for which to search for relevant memories. Default value is None. - :paramtype items: list[~azure.ai.projects.models.InputItem] - :keyword previous_search_id: The unique ID of the previous search request, enabling incremental - memory search from where the last operation left off. Default value is None. - :paramtype previous_search_id: str - :keyword options: Memory search options. Default value is None. - :paramtype options: ~azure.ai.projects.models.MemorySearchOptions - :return: MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreSearchResult + :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 = { @@ -4097,34 +4391,15 @@ def search_memories( } 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.MemoryStoreSearchResult] = kwargs.pop("cls", None) - - if body is _Unset: - if scope is _Unset: - raise TypeError("missing required argument: scope") - body = { - "items": items, - "options": options, - "previous_search_id": previous_search_id, - "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 + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_memory_stores_search_memories_request( + _request = build_datasets_delete_request( name=name, - content_type=content_type, + version=version, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -4133,47 +4408,115 @@ def search_memories( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _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, - response, - ) - raise HttpResponseError(response=response, model=error) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.MemoryStoreSearchResult, 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 a new or update an existing DatasetVersion with the given version id. - def _update_memories_initial( + :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, - body: Union[JSON, IO[bytes]] = _Unset, + version: str, + dataset_version: JSON, *, - scope: str = _Unset, - items: Optional[List[_models.InputItem]] = None, - previous_update_id: Optional[str] = None, - update_delay: Optional[int] = None, + content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> Iterator[bytes]: + ) -> _models.DatasetVersion: + """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 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 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 = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4186,27 +4529,18 @@ def _update_memories_initial( _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) + cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) - if body is _Unset: - if scope is _Unset: - raise TypeError("missing required argument: scope") - body = { - "items": items, - "previous_update_id": previous_update_id, - "scope": scope, - "update_delay": update_delay, - } - 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(dataset_version, (IOBase, bytes)): + _content = dataset_version else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(dataset_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_memory_stores_update_memories_request( + _request = build_datasets_create_or_update_request( name=name, + version=version, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -4218,228 +4552,130 @@ def _update_memories_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _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 [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + 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) - - response_headers = {} - response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + raise HttpResponseError(response=response) - deserialized = response.iter_bytes() + if _stream: + deserialized = response.iter_bytes() + else: + 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 _begin_update_memories( + def pending_upload( self, name: str, + version: str, + pending_upload_request: _models.PendingUploadRequest, *, - scope: str, content_type: str = "application/json", - items: Optional[List[_models.InputItem]] = None, - previous_update_id: Optional[str] = None, - update_delay: Optional[int] = None, **kwargs: Any - ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... - @overload - def _begin_update_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... + ) -> _models.PendingUploadResponse: + """Start a new or get an existing pending upload of a dataset for a specific 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 _begin_update_memories( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PendingUploadResponse: + """Start a new or get an existing pending upload of a dataset for a specific version. - @distributed_trace - def _begin_update_memories( + :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, - body: Union[JSON, IO[bytes]] = _Unset, + version: str, + pending_upload_request: IO[bytes], *, - scope: str = _Unset, - items: Optional[List[_models.InputItem]] = None, - previous_update_id: Optional[str] = None, - update_delay: Optional[int] = None, + content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: - """Update memory store with conversation memories. + ) -> _models.PendingUploadResponse: + """Start a new or get an existing pending upload of a dataset for a specific version. - :param name: The name of the memory store to update. Required. + :param name: The name of the resource. Required. :type name: str - :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 - :keyword items: Conversation items from which to extract memories. Default value is None. - :paramtype items: list[~azure.ai.projects.models.InputItem] - :keyword previous_update_id: The unique ID of the previous update request, enabling incremental - memory updates from where the last operation left off. Default value is None. - :paramtype previous_update_id: str - :keyword 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). Default value is None. - :paramtype update_delay: int - :return: An instance of LROPoller that returns MemoryStoreUpdateCompletedResult. The - MemoryStoreUpdateCompletedResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.ai.projects.models.MemoryStoreUpdateCompletedResult] - :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.MemoryStoreUpdateCompletedResult] = 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._update_memories_initial( - name=name, - body=body, - scope=scope, - items=items, - previous_update_id=previous_update_id, - update_delay=update_delay, - 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") - ) - - deserialized = _deserialize(_models.MemoryStoreUpdateCompletedResult, 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.MemoryStoreUpdateCompletedResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.MemoryStoreUpdateCompletedResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - def delete_scope( - self, name: str, *, scope: str, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. - - :param name: The name of the memory store. Required. - :type name: str - :keyword scope: The namespace that logically groups and isolates memories to delete, such as a - user ID. Required. - :paramtype scope: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDeleteScopeResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def delete_scope( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. - - :param name: The name of the memory store. 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: MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDeleteScopeResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def delete_scope( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. - - :param name: The name of the memory store. 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: MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDeleteScopeResult + :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 delete_scope( - self, name: str, body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, **kwargs: Any - ) -> _models.MemoryStoreDeleteScopeResult: - """Delete all memories associated with a specific scope from a memory store. + def pending_upload( + self, + name: str, + version: str, + pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.PendingUploadResponse: + """Start a new or get an existing pending upload of a dataset for a specific version. - :param name: The name of the memory store. Required. + :param name: The name of the resource. Required. :type name: str - :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 - :return: MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.MemoryStoreDeleteScopeResult + :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 = { @@ -4454,22 +4690,18 @@ def delete_scope( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.MemoryStoreDeleteScopeResult] = kwargs.pop("cls", None) + cls: ClsType[_models.PendingUploadResponse] = kwargs.pop("cls", 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} content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(pending_upload_request, (IOBase, bytes)): + _content = pending_upload_request else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(pending_upload_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_memory_stores_delete_scope_request( + _request = build_datasets_pending_upload_request( name=name, + version=version, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -4495,48 +4727,28 @@ def delete_scope( 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() else: - deserialized = _deserialize(_models.MemoryStoreDeleteScopeResult, response.json()) + deserialized = _deserialize(_models.PendingUploadResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - -class ConnectionsOperations: - """ - .. 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 by name, without populating connection credentials. + def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.DatasetCredential: + """Get 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 = { @@ -4550,10 +4762,11 @@ 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, @@ -4579,29 +4792,42 @@ 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() 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: + """ + .. 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_with_credentials(self, name: str, **kwargs: Any) -> _models.Connection: - """Get a connection by name, with its connection credentials. + def get(self, name: str, **kwargs: Any) -> _models.Deployment: + """Get 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 = { @@ -4615,9 +4841,9 @@ 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.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, @@ -4652,7 +4878,7 @@ def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Connection: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Connection, response.json()) + deserialized = _deserialize(_models.Deployment, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4663,27 +4889,29 @@ def _get_with_credentials(self, name: str, **kwargs: Any) -> _models.Connection: 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 - ) -> ItemPaged["_models.Connection"]: - """List all connections in the project, without populating connection credentials. + ) -> ItemPaged["_models.Deployment"]: + """List all deployed models in the project. - :keyword connection_type: List connections of this specific type. Known values are: - "AzureOpenAI", "AzureBlob", "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", - "AppConfig", "AppInsights", "CustomKeys", and "RemoteTool". Default value is None. - :paramtype connection_type: str or ~azure.ai.projects.models.ConnectionType - :keyword default_connection: List 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] + :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] :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, @@ -4696,9 +4924,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, @@ -4734,7 +4963,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Connection], deserialized.get("value", [])) + 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) @@ -4757,14 +4986,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class DatasetsOperations: +class EvaluationTaxonomiesOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`datasets` attribute. + :attr:`evaluation_taxonomies` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -4775,20 +5004,15 @@ 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.DatasetVersion"]: - """List all versions of the given DatasetVersion. + def get(self, name: str, **kwargs: Any) -> _models.EvaluationTaxonomy: + """Get an evaluation run by name. :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] + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :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, @@ -4797,80 +5021,71 @@ def list_versions(self, name: str, **kwargs: Any) -> ItemPaged["_models.DatasetV } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - _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) + cls: ClsType[_models.EvaluationTaxonomy] = 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), 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_evaluation_taxonomies_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) - return _request + _stream = kwargs.pop("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.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) + response = pipeline_response.http_response - def get_next(next_link=None): - _request = prepare_request(next_link) + 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) - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + response_headers = {} + response_headers["x-ms-client-request-id"] = self._deserialize( + "str", response.headers.get("x-ms-client-request-id") + ) - 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 _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EvaluationTaxonomy, response.json()) - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return ItemPaged(get_next, extract_data) + return deserialized # type: ignore @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.DatasetVersion"]: - """List the latest version of each DatasetVersion. + def list( + self, *, input_name: Optional[str] = None, input_type: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.EvaluationTaxonomy"]: + """List evaluation taxonomies. - :return: An iterator like instance of DatasetVersion - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.DatasetVersion] + :keyword input_name: Filter by the evaluation input name. Default value is None. + :paramtype input_name: str + :keyword input_type: Filter by taxonomy input type. Default value is None. + :paramtype input_type: str + :return: An iterator like instance of EvaluationTaxonomy + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.EvaluationTaxonomy] :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.EvaluationTaxonomy]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4883,7 +5098,9 @@ def list(self, **kwargs: Any) -> ItemPaged["_models.DatasetVersion"]: def prepare_request(next_link=None): if not next_link: - _request = build_datasets_list_request( + _request = build_evaluation_taxonomies_list_request( + input_name=input_name, + input_type=input_type, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4919,7 +5136,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.DatasetVersion], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.EvaluationTaxonomy], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4942,78 +5159,11 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: - """Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the - DatasetVersion 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. - :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 = { - 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.DatasetVersion] = kwargs.pop("cls", None) - - _request = build_datasets_get_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 = 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) - - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.DatasetVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """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. + def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete an evaluation taxonomy by name. :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: @@ -5031,9 +5181,8 @@ def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: dis cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_datasets_delete_request( + _request = build_evaluation_taxonomies_delete_request( name=name, - version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5054,102 +5203,116 @@ def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: dis 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 cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, None, response_headers) # type: ignore @overload - def create_or_update( + def create( self, name: str, - version: str, - dataset_version: _models.DatasetVersion, + body: _models.EvaluationTaxonomy, *, - content_type: str = "application/merge-patch+json", + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + content_type: str = "application/json", **kwargs: Any - ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + ) -> _models.EvaluationTaxonomy: + """Create an evaluation taxonomy. - :param name: The name of the resource. Required. + :param name: The name of the evaluation taxonomy. 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 + :param body: The evaluation taxonomy. Required. + :type body: ~azure.ai.projects.models.EvaluationTaxonomy + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". + Default value is "application/json". :paramtype content_type: str - :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def create( self, name: str, - version: str, - dataset_version: JSON, + body: JSON, *, - content_type: str = "application/merge-patch+json", + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + content_type: str = "application/json", **kwargs: Any - ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + ) -> _models.EvaluationTaxonomy: + """Create an evaluation taxonomy. - :param name: The name of the resource. Required. + :param name: The name of the evaluation taxonomy. 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 + :param body: The evaluation taxonomy. Required. + :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". + Default value is "application/json". :paramtype content_type: str - :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def create( self, name: str, - version: str, - dataset_version: IO[bytes], + body: IO[bytes], *, - content_type: str = "application/merge-patch+json", + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + content_type: str = "application/json", **kwargs: Any - ) -> _models.DatasetVersion: - """Create a new or update an existing DatasetVersion with the given version id. + ) -> _models.EvaluationTaxonomy: + """Create an evaluation taxonomy. - :param name: The name of the resource. Required. + :param name: The name of the evaluation taxonomy. 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] + :param body: The evaluation taxonomy. Required. + :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/merge-patch+json". + Default value is "application/json". :paramtype content_type: str - :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :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 a new or update an existing DatasetVersion with the given version id. + def create( + self, + name: str, + body: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + **kwargs: Any + ) -> _models.EvaluationTaxonomy: + """Create an evaluation taxonomy. - :param name: The name of the resource. Required. + :param name: The name of the evaluation taxonomy. 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 body: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, JSON, + IO[bytes] Required. + :type body: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5164,18 +5327,18 @@ 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.EvaluationTaxonomy] = kwargs.pop("cls", None) - content_type = content_type or "application/merge-patch+json" + content_type = content_type or "application/json" _content = None - if isinstance(dataset_version, (IOBase, bytes)): - _content = dataset_version + if isinstance(body, (IOBase, bytes)): + _content = body else: - _content = json.dumps(dataset_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_datasets_create_or_update_request( + _request = build_evaluation_taxonomies_create_request( name=name, - version=version, + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -5206,7 +5369,7 @@ def create_or_update( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.DatasetVersion, response.json()) + deserialized = _deserialize(_models.EvaluationTaxonomy, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5214,103 +5377,107 @@ def create_or_update( return deserialized # type: ignore @overload - def pending_upload( + def update( self, name: str, - version: str, - pending_upload_request: _models.PendingUploadRequest, + body: _models.EvaluationTaxonomy, *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + ) -> _models.EvaluationTaxonomy: + """Update an evaluation taxonomy. - :param name: The name of the resource. Required. + :param name: The name of the evaluation taxonomy. 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 + :param body: The evaluation taxonomy. Required. + :type body: ~azure.ai.projects.models.EvaluationTaxonomy + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 :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 + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def pending_upload( + def update( self, name: str, - version: str, - pending_upload_request: JSON, + body: JSON, *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + ) -> _models.EvaluationTaxonomy: + """Update an evaluation taxonomy. - :param name: The name of the resource. Required. + :param name: The name of the evaluation taxonomy. 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 + :param body: The evaluation taxonomy. Required. + :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 :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 + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def pending_upload( + def update( self, name: str, - version: str, - pending_upload_request: IO[bytes], + body: IO[bytes], *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + ) -> _models.EvaluationTaxonomy: + """Update an evaluation taxonomy. - :param name: The name of the resource. Required. + :param name: The name of the evaluation taxonomy. 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] + :param body: The evaluation taxonomy. Required. + :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 :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 + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def pending_upload( + def update( self, name: str, - version: str, - pending_upload_request: Union[_models.PendingUploadRequest, JSON, IO[bytes]], + body: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, **kwargs: Any - ) -> _models.PendingUploadResponse: - """Start a new or get an existing pending upload of a dataset for a specific version. + ) -> _models.EvaluationTaxonomy: + """Update an evaluation taxonomy. - :param name: The name of the resource. Required. + :param name: The name of the evaluation taxonomy. 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 body: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, JSON, + IO[bytes] Required. + :type body: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5325,18 +5492,18 @@ def pending_upload( _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) + cls: ClsType[_models.EvaluationTaxonomy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(pending_upload_request, (IOBase, bytes)): - _content = pending_upload_request + if isinstance(body, (IOBase, bytes)): + _content = body else: - _content = json.dumps(pending_upload_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_datasets_pending_upload_request( + _request = build_evaluation_taxonomies_update_request( name=name, - version=version, + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -5367,23 +5534,39 @@ def pending_upload( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.PendingUploadResponse, response.json()) + deserialized = _deserialize(_models.EvaluationTaxonomy, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + +class EvaluationRulesOperations: + """ + .. 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_credentials(self, name: str, version: str, **kwargs: Any) -> _models.DatasetCredential: - """Get the SAS credential to access the storage account associated with a Dataset version. + def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: + """Get an evaluation rule. - :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 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 = { @@ -5397,11 +5580,10 @@ 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[_models.EvaluationRule] = kwargs.pop("cls", None) - _request = build_datasets_get_credentials_request( - name=name, - version=version, + _request = build_evaluation_rules_get_request( + id=id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5427,49 +5609,143 @@ def get_credentials(self, name: str, version: str, **kwargs: Any) -> _models.Dat 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() else: - deserialized = _deserialize(_models.DatasetCredential, response.json()) + deserialized = _deserialize(_models.EvaluationRule, response.json()) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - -class IndexesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`indexes` 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.Index"]: - """List all versions of the given Index. + def delete(self, id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Delete an evaluation rule. - :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] + :param id: Unique identifier for the evaluation rule. Required. + :type 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[List[_models.Index]] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) + + _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) + + _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) + + response_headers = {} + response_headers["x-ms-client-request-id"] = self._deserialize( + "str", response.headers.get("x-ms-client-request-id") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # 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. + + :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. + + :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. + + :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 create_or_update( + self, id: str, evaluation_rule: Union[_models.EvaluationRule, JSON, IO[bytes]], **kwargs: Any + ) -> _models.EvaluationRule: + """Create or update an evaluation rule. + :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 = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5478,80 +5754,84 @@ 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: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _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) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EvaluationRule] = 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), 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(evaluation_rule, (IOBase, bytes)): + _content = evaluation_rule + else: + _content = json.dumps(evaluation_rule, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - return _request + _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, + ) + path_format_arguments = { + "endpoint": 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) + _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 - ) - 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 + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=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) + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.EvaluationRule, 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 list(self, **kwargs: Any) -> ItemPaged["_models.Index"]: - """List the latest version of each Index. + 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 all evaluation rules. - :return: An iterator like instance of Index - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Index] + :keyword action_type: Filter by the type of evaluation rule. Known values are: + "continuousEvaluation" and "humanEvaluation". 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.Index]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.EvaluationRule]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5564,7 +5844,10 @@ def list(self, **kwargs: Any) -> ItemPaged["_models.Index"]: def prepare_request(next_link=None): if not next_link: - _request = build_indexes_list_request( + _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, @@ -5600,7 +5883,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Index], deserialized.get("value", [])) + 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, iter(list_of_elem) @@ -5622,22 +5905,253 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - @distributed_trace - def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: - """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 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 = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, +class EvaluatorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`evaluators` 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, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, + limit: Optional[int] = None, + **kwargs: Any + ) -> ItemPaged["_models.EvaluatorVersion"]: + """List all versions of the given evaluator. + + :param name: The name of the resource. Required. + :type name: str + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one + of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default + value is None. + :paramtype type: str or str or str or 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 + :return: An iterator like instance of EvaluatorVersion + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.EvaluatorVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EvaluatorVersion]] = 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_evaluators_list_versions_request( + name=name, + foundry_beta=foundry_beta, + type=type, + limit=limit, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": 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), 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.EvaluatorVersion], 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) + + @distributed_trace + def list_latest_versions( + self, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, + limit: Optional[int] = None, + **kwargs: Any + ) -> ItemPaged["_models.EvaluatorVersion"]: + """List the latest version of each evaluator. + + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one + of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default + value is None. + :paramtype type: str or str or str or 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 + :return: An iterator like instance of EvaluatorVersion + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.EvaluatorVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EvaluatorVersion]] = 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_evaluators_list_latest_versions_request( + foundry_beta=foundry_beta, + type=type, + limit=limit, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": 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), 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.EvaluatorVersion], 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) + + @distributed_trace + def get_version( + self, name: str, version: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], **kwargs: Any + ) -> _models.EvaluatorVersion: + """Get the specific version of the EvaluatorVersion. The service returns 404 Not Found error if + the EvaluatorVersion does not exist. + + :param name: The name of the resource. Required. + :type name: str + :param version: The specific version id of the EvaluatorVersion to retrieve. Required. + :type version: str + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } @@ -5646,11 +6160,12 @@ 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.EvaluatorVersion] = kwargs.pop("cls", None) - _request = build_indexes_get_request( + _request = build_evaluators_get_version_request( name=name, version=version, + foundry_beta=foundry_beta, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5679,7 +6194,7 @@ def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Index, response.json()) + deserialized = _deserialize(_models.EvaluatorVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5687,14 +6202,19 @@ 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 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_version( # pylint: disable=inconsistent-return-statements + self, name: str, version: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], **kwargs: Any + ) -> None: + """Delete the specific version of the EvaluatorVersion. The service returns 204 No Content if the + EvaluatorVersion was deleted successfully or if the EvaluatorVersion does not exist. :param name: The name of the resource. Required. :type name: str - :param version: The version of the Index to delete. Required. + :param version: The version of the EvaluatorVersion to delete. Required. :type version: str + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -5712,9 +6232,10 @@ def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: dis cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_indexes_delete_request( + _request = build_evaluators_delete_version_request( name=name, version=version, + foundry_beta=foundry_beta, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5739,92 +6260,107 @@ def delete(self, name: str, version: str, **kwargs: Any) -> None: # pylint: dis return cls(pipeline_response, None, {}) # type: ignore @overload - def create_or_update( + def create_version( self, name: str, - version: str, - index: _models.Index, + evaluator_version: _models.EvaluatorVersion, *, - content_type: str = "application/merge-patch+json", + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + content_type: str = "application/json", **kwargs: Any - ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + ) -> _models.EvaluatorVersion: + """Create a new EvaluatorVersion with auto incremented 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 evaluator_version: Required. + :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". + Default value is "application/json". :paramtype content_type: str - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion :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 a new or update an existing Index with the given version id. + def create_version( + self, + name: str, + evaluator_version: JSON, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EvaluatorVersion: + """Create a new EvaluatorVersion with auto incremented 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 + :param evaluator_version: Required. + :type evaluator_version: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". + Default value is "application/json". :paramtype content_type: str - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def create_version( self, name: str, - version: str, - index: IO[bytes], + evaluator_version: IO[bytes], *, - content_type: str = "application/merge-patch+json", + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + content_type: str = "application/json", **kwargs: Any - ) -> _models.Index: - """Create a new or update an existing Index with the given version id. + ) -> _models.EvaluatorVersion: + """Create a new EvaluatorVersion with auto incremented 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] + :param evaluator_version: Required. + :type evaluator_version: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/merge-patch+json". + Default value is "application/json". :paramtype content_type: str - :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion :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 a new or update an existing Index with the given version id. + def create_version( + self, + name: str, + evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + **kwargs: Any + ) -> _models.EvaluatorVersion: + """Create a new EvaluatorVersion with auto incremented 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 + :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] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5839,18 +6375,18 @@ 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.EvaluatorVersion] = kwargs.pop("cls", None) - content_type = content_type or "application/merge-patch+json" + content_type = content_type or "application/json" _content = None - if isinstance(index, (IOBase, bytes)): - _content = index + if isinstance(evaluator_version, (IOBase, bytes)): + _content = evaluator_version else: - _content = json.dumps(index, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(evaluator_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_indexes_create_or_update_request( + _request = build_evaluators_create_version_request( name=name, - version=version, + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -5869,7 +6405,7 @@ def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [201]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -5881,39 +6417,127 @@ def create_or_update( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Index, response.json()) + deserialized = _deserialize(_models.EvaluatorVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @overload + def update_version( + self, + name: str, + version: str, + evaluator_version: _models.EvaluatorVersion, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EvaluatorVersion: + """Update an existing EvaluatorVersion with the given version id. -class DeploymentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. + :param name: The name of the resource. Required. + :type name: str + :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.models.EvaluatorVersion + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`deployments` attribute. - """ + @overload + def update_version( + self, + name: str, + version: str, + evaluator_version: JSON, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EvaluatorVersion: + """Update an existing EvaluatorVersion with the given version id. - 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 name: The name of the resource. Required. + :type name: str + :param version: The version of the EvaluatorVersion to update. Required. + :type version: str + :param evaluator_version: Evaluator resource. Required. + :type evaluator_version: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_version( + self, + name: str, + version: str, + evaluator_version: IO[bytes], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EvaluatorVersion: + """Update an existing EvaluatorVersion with the given version id. + + :param name: The name of the resource. Required. + :type name: str + :param version: The version of the EvaluatorVersion to update. Required. + :type version: str + :param evaluator_version: Evaluator resource. Required. + :type evaluator_version: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - def get(self, name: str, **kwargs: Any) -> _models.Deployment: - """Get a deployed model. + def update_version( + self, + name: str, + version: str, + evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + **kwargs: Any + ) -> _models.EvaluatorVersion: + """Update an existing EvaluatorVersion with the given version id. - :param name: Name of the deployment. Required. + :param name: The name of the resource. Required. :type name: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Deployment + :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] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5924,14 +6548,26 @@ def get(self, name: str, **kwargs: Any) -> _models.Deployment: } 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.Deployment] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EvaluatorVersion] = kwargs.pop("cls", None) - _request = build_deployments_get_request( + content_type = content_type or "application/json" + _content = None + if isinstance(evaluator_version, (IOBase, bytes)): + _content = evaluator_version + else: + _content = json.dumps(evaluator_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_evaluators_update_version_request( name=name, + version=version, + foundry_beta=foundry_beta, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -5956,48 +6592,48 @@ def get(self, name: str, **kwargs: Any) -> _models.Deployment: 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() else: - deserialized = _deserialize(_models.Deployment, response.json()) + deserialized = _deserialize(_models.EvaluatorVersion, 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 all deployed models in the project. - :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] - :raises ~azure.core.exceptions.HttpResponseError: - """ +class IndexesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`indexes` 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.Index"]: + """List all versions of the given Index. + + :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.Deployment]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Index]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6010,10 +6646,8 @@ def list( 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, + _request = build_indexes_list_versions_request( + name=name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6049,7 +6683,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Deployment], deserialized.get("value", [])) + 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) @@ -6071,101 +6705,18 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - -class RedTeamsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`red_teams` 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.RedTeam: - """Get a redteam by name. - - :param name: Identifier of the red team run. Required. - :type name: str - :return: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam - :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.RedTeam] = kwargs.pop("cls", None) - - _request = build_red_teams_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) - - _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() - else: - deserialized = _deserialize(_models.RedTeam, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.RedTeam"]: - """List a redteam by name. + def list(self, **kwargs: Any) -> ItemPaged["_models.Index"]: + """List the latest version of each Index. - :return: An iterator like instance of RedTeam - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.RedTeam] + :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.RedTeam]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Index]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6178,7 +6729,7 @@ def list(self, **kwargs: Any) -> ItemPaged["_models.RedTeam"]: def prepare_request(next_link=None): if not next_link: - _request = build_red_teams_list_request( + _request = build_indexes_list_request( api_version=self._config.api_version, headers=_headers, params=_params, @@ -6214,7 +6765,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.RedTeam], deserialized.get("value", [])) + 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) @@ -6236,59 +6787,17 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - @overload - def create( - self, red_team: _models.RedTeam, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RedTeam: - """Creates a redteam run. - - :param red_team: Redteam to be run. Required. - :type red_team: ~azure.ai.projects.models.RedTeam - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: - """Creates a redteam run. - - :param red_team: Redteam to be run. Required. - :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 - :return: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create(self, red_team: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: - """Creates a redteam run. - - :param red_team: Redteam to be run. Required. - :type red_team: 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: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models.RedTeam: - """Creates a redteam run. + def get(self, name: str, version: str, **kwargs: Any) -> _models.Index: + """Get the specific version of the Index. The service returns 404 Not Found error if the Index + does not exist. - :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 + :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 = { @@ -6299,23 +6808,15 @@ def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: An } 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.RedTeam] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(red_team, (IOBase, bytes)): - _content = red_team - else: - _content = json.dumps(red_team, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.Index] = kwargs.pop("cls", None) - _request = build_red_teams_create_request( - content_type=content_type, + _request = build_indexes_get_request( + name=name, + version=version, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -6331,7 +6832,7 @@ def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: An 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 @@ -6343,39 +6844,24 @@ def create(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: An if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.RedTeam, response.json()) + deserialized = _deserialize(_models.Index, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - -class EvaluationRulesOperations: - """ - .. 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, version: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """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 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 version of the Index to delete. Required. + :type version: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6389,10 +6875,11 @@ 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_indexes_delete_request( + name=name, + version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6402,72 +6889,7 @@ def get(self, id: str, **kwargs: Any) -> _models.EvaluationRule: } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _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() - else: - deserialized = _deserialize(_models.EvaluationRule, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete(self, id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete an evaluation rule. - - :param id: Unique identifier for the evaluation rule. Required. - :type 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_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) - - _stream = False + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -6478,81 +6900,96 @@ def delete(self, id: str, **kwargs: Any) -> None: # pylint: disable=inconsisten 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 cls: - return cls(pipeline_response, None, response_headers) # type: ignore + 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. + self, + name: str, + version: str, + index: _models.Index, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.Index: + """Create a new or update an existing Index 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: ~azure.ai.projects.models.EvaluationRule + :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/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: Index. The Index is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Index :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. + self, name: str, version: str, index: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + ) -> _models.Index: + """Create a new or update an existing Index 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 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/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: Index. The Index is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Index :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. + self, + name: str, + version: str, + index: IO[bytes], + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any + ) -> _models.Index: + """Create a new or update an existing Index 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 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/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: 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, 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, index: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Index: + """Create a new or update an existing Index 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 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 = { @@ -6567,17 +7004,18 @@ 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.Index] = 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(index, (IOBase, bytes)): + _content = index else: - _content = json.dumps(evaluation_rule, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(index, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_evaluation_rules_create_or_update_request( - id=id, + _request = build_indexes_create_or_update_request( + name=name, + version=version, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -6608,138 +7046,197 @@ def create_or_update( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.EvaluationRule, 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( + +class InsightsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`insights` 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 generate( self, + insight: _models.Insight, *, - action_type: Optional[Union[str, _models.EvaluationRuleActionType]] = None, - agent_name: Optional[str] = None, - enabled: Optional[bool] = None, + foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + content_type: str = "application/json", **kwargs: Any - ) -> ItemPaged["_models.EvaluationRule"]: - """List all evaluation rules. + ) -> _models.Insight: + """Generate Insights. - :keyword action_type: Filter by the type of evaluation rule. Known values are: - "continuousEvaluation" and "humanEvaluation". 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 insight: Complete evaluation configuration including data source, evaluators, and result + settings. Required. + :type insight: ~azure.ai.projects.models.Insight + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Insight. The Insight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Insight :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, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + @overload + def generate( + self, + insight: JSON, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Insight: + """Generate Insights. - _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) + :param insight: Complete evaluation configuration including data source, evaluators, and result + settings. Required. + :type insight: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Insight. The Insight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Insight + :raises ~azure.core.exceptions.HttpResponseError: + """ - 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), 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) + @overload + def generate( + self, + insight: IO[bytes], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Insight: + """Generate Insights. - return _request + :param insight: Complete evaluation configuration including data source, evaluators, and result + settings. Required. + :type insight: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Insight. The Insight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Insight + :raises ~azure.core.exceptions.HttpResponseError: + """ - 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, iter(list_of_elem) + @distributed_trace + def generate( + self, + insight: Union[_models.Insight, JSON, IO[bytes]], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + **kwargs: Any + ) -> _models.Insight: + """Generate Insights. - def get_next(next_link=None): - _request = prepare_request(next_link) + :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] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 + :return: Insight. The Insight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Insight + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Insight] = kwargs.pop("cls", None) - return pipeline_response + content_type = content_type or "application/json" + _content = None + if isinstance(insight, (IOBase, bytes)): + _content = insight + else: + _content = json.dumps(insight, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - return ItemPaged(get_next, extract_data) + _request = build_insights_generate_request( + foundry_beta=foundry_beta, + 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 = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) -class EvaluationTaxonomiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. + response = pipeline_response.http_response - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`evaluation_taxonomies` attribute. - """ + 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) + raise HttpResponseError(response=response) - 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") + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.Insight, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @distributed_trace - def get(self, name: str, **kwargs: Any) -> _models.EvaluationTaxonomy: - """Get an evaluation run by name. + def get(self, id: str, *, include_coordinates: Optional[bool] = None, **kwargs: Any) -> _models.Insight: + """Get a specific insight by Id. - :param name: The name of the resource. Required. - :type name: str - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :param id: The unique identifier for the insights report. Required. + :type id: str + :keyword include_coordinates: Whether to include coordinates for visualization in the response. + Defaults to false. Default value is None. + :paramtype include_coordinates: bool + :return: Insight. The Insight is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6753,10 +7250,11 @@ def get(self, name: str, **kwargs: Any) -> _models.EvaluationTaxonomy: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.EvaluationTaxonomy] = kwargs.pop("cls", None) + cls: ClsType[_models.Insight] = kwargs.pop("cls", None) - _request = build_evaluation_taxonomies_get_request( - name=name, + _request = build_insights_get_request( + id=id, + include_coordinates=include_coordinates, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6790,7 +7288,7 @@ def get(self, name: str, **kwargs: Any) -> _models.EvaluationTaxonomy: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.EvaluationTaxonomy, response.json()) + deserialized = _deserialize(_models.Insight, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -6799,22 +7297,37 @@ def get(self, name: str, **kwargs: Any) -> _models.EvaluationTaxonomy: @distributed_trace def list( - self, *, input_name: Optional[str] = None, input_type: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.EvaluationTaxonomy"]: - """List evaluation taxonomies. + self, + *, + 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 + ) -> ItemPaged["_models.Insight"]: + """List all insights in reverse chronological order (newest first). - :keyword input_name: Filter by the evaluation input name. Default value is None. - :paramtype input_name: str - :keyword input_type: Filter by taxonomy input type. Default value is None. - :paramtype input_type: str - :return: An iterator like instance of EvaluationTaxonomy - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.EvaluationTaxonomy] + :keyword type: Filter by the type of analysis. Known values are: "EvaluationRunClusterInsight", + "AgentClusterInsight", and "EvaluationComparison". Default value is None. + :paramtype type: str or ~azure.ai.projects.models.InsightType + :keyword eval_id: Filter by the evaluation ID. Default value is None. + :paramtype eval_id: str + :keyword run_id: Filter by the evaluation run ID. Default value is None. + :paramtype run_id: str + :keyword agent_name: Filter by the agent name. Default value is None. + :paramtype agent_name: str + :keyword include_coordinates: Whether to include coordinates for visualization in the response. + Defaults to false. Default value is None. + :paramtype include_coordinates: bool + :return: An iterator like instance of Insight + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Insight] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.EvaluationTaxonomy]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Insight]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6827,9 +7340,12 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_evaluation_taxonomies_list_request( - input_name=input_name, - input_type=input_type, + _request = build_insights_list_request( + type=type, + eval_id=eval_id, + run_id=run_id, + agent_name=agent_name, + include_coordinates=include_coordinates, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6865,7 +7381,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.EvaluationTaxonomy], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.Insight], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -6887,126 +7403,136 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - @distributed_trace - def delete(self, name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete an evaluation taxonomy by name. - - :param name: The name of the resource. 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 {} +class MemoryStoresOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - cls: ClsType[None] = kwargs.pop("cls", None) + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`memory_stores` attribute. + """ - _request = build_evaluation_taxonomies_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) - 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 cls: - return cls(pipeline_response, None, response_headers) # 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") @overload def create( - self, name: str, body: _models.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationTaxonomy: - """Create an evaluation taxonomy. + self, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + name: str, + definition: _models.MemoryStoreDefinition, + content_type: str = "application/json", + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Create a memory store. - :param name: The name of the evaluation taxonomy. Required. - :type name: str - :param body: The evaluation taxonomy. Required. - :type body: ~azure.ai.projects.models.EvaluationTaxonomy + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword name: The name of the memory store. Required. + :paramtype name: str + :keyword definition: The memory store definition. Required. + :paramtype definition: ~azure.ai.projects.models.MemoryStoreDefinition :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :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 + value is None. + :paramtype metadata: dict[str, str] + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ @overload def create( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationTaxonomy: - """Create an evaluation taxonomy. + self, + body: JSON, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Create a memory store. - :param name: The name of the evaluation taxonomy. Required. - :type name: str - :param body: The evaluation taxonomy. Required. + :param body: Required. :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ @overload def create( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationTaxonomy: - """Create an evaluation taxonomy. + self, + body: IO[bytes], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Create a memory store. - :param name: The name of the evaluation taxonomy. Required. - :type name: str - :param body: The evaluation taxonomy. Required. + :param body: Required. :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace def create( - self, name: str, body: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any - ) -> _models.EvaluationTaxonomy: - """Create an evaluation taxonomy. + self, + body: Union[JSON, IO[bytes]] = _Unset, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + name: str = _Unset, + definition: _models.MemoryStoreDefinition = _Unset, + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Create a memory store. - :param name: The name of the evaluation taxonomy. Required. - :type name: str - :param body: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, JSON, - IO[bytes] Required. - :type body: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword name: The name of the memory store. Required. + :paramtype name: str + :keyword definition: The memory store definition. Required. + :paramtype definition: ~azure.ai.projects.models.MemoryStoreDefinition + :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 + value is None. + :paramtype metadata: dict[str, str] + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7021,8 +7547,15 @@ def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EvaluationTaxonomy] = kwargs.pop("cls", None) + cls: ClsType[_models.MemoryStoreDetails] = 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 = {"definition": definition, "description": description, "metadata": metadata, "name": name} + 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)): @@ -7030,8 +7563,8 @@ def create( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_evaluation_taxonomies_create_request( - name=name, + _request = build_memory_stores_create_request( + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -7050,19 +7583,23 @@ def create( 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() else: - deserialized = _deserialize(_models.EvaluationTaxonomy, response.json()) + deserialized = _deserialize(_models.MemoryStoreDetails, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -7071,71 +7608,116 @@ def create( @overload def update( - self, name: str, body: _models.EvaluationTaxonomy, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationTaxonomy: - """Update an evaluation taxonomy. + self, + name: str, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Update a memory store. - :param name: The name of the evaluation taxonomy. Required. + :param name: The name of the memory store to update. Required. :type name: str - :param body: The evaluation taxonomy. Required. - :type body: ~azure.ai.projects.models.EvaluationTaxonomy + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :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 + value is None. + :paramtype metadata: dict[str, str] + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ @overload def update( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationTaxonomy: - """Update an evaluation taxonomy. + self, + name: str, + body: JSON, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Update a memory store. - :param name: The name of the evaluation taxonomy. Required. + :param name: The name of the memory store to update. Required. :type name: str - :param body: The evaluation taxonomy. Required. + :param body: Required. :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ @overload def update( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluationTaxonomy: - """Update an evaluation taxonomy. + self, + name: str, + body: IO[bytes], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Update a memory store. - :param name: The name of the evaluation taxonomy. Required. + :param name: The name of the memory store to update. Required. :type name: str - :param body: The evaluation taxonomy. Required. + :param body: Required. :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace def update( - self, name: str, body: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], **kwargs: Any - ) -> _models.EvaluationTaxonomy: - """Update an evaluation taxonomy. + self, + name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Update a memory store. - :param name: The name of the evaluation taxonomy. Required. + :param name: The name of the memory store to update. Required. :type name: str - :param body: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, JSON, - IO[bytes] Required. - :type body: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] - :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationTaxonomy + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :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 + value is None. + :paramtype metadata: dict[str, str] + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7150,8 +7732,11 @@ def update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EvaluationTaxonomy] = kwargs.pop("cls", None) + cls: ClsType[_models.MemoryStoreDetails] = kwargs.pop("cls", None) + if body is _Unset: + body = {"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)): @@ -7159,8 +7744,9 @@ def update( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_evaluation_taxonomies_update_request( + _request = build_memory_stores_update_request( name=name, + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -7186,65 +7772,37 @@ def update( 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() else: - deserialized = _deserialize(_models.EvaluationTaxonomy, response.json()) + deserialized = _deserialize(_models.MemoryStoreDetails, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @distributed_trace + def get( + self, name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **kwargs: Any + ) -> _models.MemoryStoreDetails: + """Retrieve a memory store. -class EvaluatorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`evaluators` 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, - *, - type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, - limit: Optional[int] = None, - **kwargs: Any - ) -> ItemPaged["_models.EvaluatorVersion"]: - """List all versions of the given evaluator. - - :param name: The name of the resource. Required. + :param name: The name of the memory store to retrieve. Required. :type name: str - :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one - of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default - value is None. - :paramtype type: str or str or str or 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 - :return: An iterator like instance of EvaluatorVersion - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.EvaluatorVersion] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EvaluatorVersion]] = kwargs.pop("cls", None) - error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7253,95 +7811,90 @@ def list_versions( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_evaluators_list_versions_request( - name=name, - type=type, - limit=limit, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": 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), 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[_models.MemoryStoreDetails] = kwargs.pop("cls", None) - return _request + _request = build_memory_stores_get_request( + name=name, + foundry_beta=foundry_beta, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": 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.EvaluatorVersion], deserialized.get("value", [])) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + _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 [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) + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.MemoryStoreDetails, 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 list_latest_versions( + def list( self, *, - type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], limit: Optional[int] = None, + order: Optional[Union[str, _models.PageOrder]] = None, + before: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.EvaluatorVersion"]: - """List the latest version of each evaluator. + ) -> ItemPaged["_models.MemoryStoreDetails"]: + """List all memory stores. - :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one - of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default - value is None. - :paramtype type: str or str or str or str + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :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. + 100, and the + default is 20. Default value is None. :paramtype limit: int - :return: An iterator like instance of EvaluatorVersion - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.EvaluatorVersion] + :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 MemoryStoreDetails + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.MemoryStoreDetails] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.EvaluatorVersion]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.MemoryStoreDetails]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7351,54 +7904,33 @@ def list_latest_versions( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_evaluators_list_latest_versions_request( - type=type, - limit=limit, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": 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), 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_memory_stores_list_request( + foundry_beta=foundry_beta, + 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.EvaluatorVersion], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.MemoryStoreDetails], 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 @@ -7408,23 +7940,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) @distributed_trace - def get_version(self, name: str, version: str, **kwargs: Any) -> _models.EvaluatorVersion: - """Get the specific version of the EvaluatorVersion. The service returns 404 Not Found error if - the EvaluatorVersion does not exist. + def delete( + self, name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **kwargs: Any + ) -> _models.DeleteMemoryStoreResult: + """Delete a memory store. - :param name: The name of the resource. Required. + :param name: The name of the memory store to delete. Required. :type name: str - :param version: The specific version id of the EvaluatorVersion to retrieve. Required. - :type version: str - :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :return: DeleteMemoryStoreResult. The DeleteMemoryStoreResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.DeleteMemoryStoreResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7438,11 +7976,11 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models.Evaluat _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.EvaluatorVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.DeleteMemoryStoreResult] = kwargs.pop("cls", None) - _request = build_evaluators_get_version_request( + _request = build_memory_stores_delete_request( name=name, - version=version, + foundry_beta=foundry_beta, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7466,144 +8004,148 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models.Evaluat 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() else: - deserialized = _deserialize(_models.EvaluatorVersion, response.json()) + deserialized = _deserialize(_models.DeleteMemoryStoreResult, response.json()) if cls: 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 the specific version of the EvaluatorVersion. The service returns 204 No Content if the - EvaluatorVersion was deleted successfully or if the EvaluatorVersion does not exist. - - :param name: The name of the resource. Required. - :type name: str - :param version: The version of the EvaluatorVersion 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_evaluators_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) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - @overload - def create_version( + def search_memories( self, name: str, - evaluator_version: _models.EvaluatorVersion, *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + scope: str, content_type: str = "application/json", + items: Optional[List[_models.InputItem]] = None, + previous_search_id: Optional[str] = None, + options: Optional[_models.MemorySearchOptions] = None, **kwargs: Any - ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + ) -> _models.MemoryStoreSearchResult: + """Search for relevant memories from a memory store based on conversation context. - :param name: The name of the resource. Required. + :param name: The name of the memory store to search. Required. :type name: str - :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :paramtype scope: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion + :keyword items: Items for which to search for relevant memories. Default value is None. + :paramtype items: list[~azure.ai.projects.models.InputItem] + :keyword previous_search_id: The unique ID of the previous search request, enabling incremental + memory search from where the last operation left off. Default value is None. + :paramtype previous_search_id: str + :keyword options: Memory search options. Default value is None. + :paramtype options: ~azure.ai.projects.models.MemorySearchOptions + :return: MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreSearchResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_version( - self, name: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + def search_memories( + self, + name: str, + body: JSON, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MemoryStoreSearchResult: + """Search for relevant memories from a memory store based on conversation context. - :param name: The name of the resource. Required. + :param name: The name of the memory store to search. Required. :type name: str - :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: JSON + :param body: Required. + :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion + :return: MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreSearchResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_version( - self, name: str, evaluator_version: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + def search_memories( + self, + name: str, + body: IO[bytes], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MemoryStoreSearchResult: + """Search for relevant memories from a memory store based on conversation context. - :param name: The name of the resource. Required. + :param name: The name of the memory store to search. Required. :type name: str - :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: IO[bytes] + :param body: Required. + :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion + :return: MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreSearchResult :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_version( - self, name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], **kwargs: Any - ) -> _models.EvaluatorVersion: - """Create a new EvaluatorVersion with auto incremented version id. + def search_memories( + self, + name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + scope: str = _Unset, + items: Optional[List[_models.InputItem]] = None, + previous_search_id: Optional[str] = None, + options: Optional[_models.MemorySearchOptions] = None, + **kwargs: Any + ) -> _models.MemoryStoreSearchResult: + """Search for relevant memories from a memory store based on conversation context. - :param name: The name of the resource. Required. + :param name: The name of the memory store to search. Required. :type name: 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] - :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :paramtype scope: str + :keyword items: Items for which to search for relevant memories. Default value is None. + :paramtype items: list[~azure.ai.projects.models.InputItem] + :keyword previous_search_id: The unique ID of the previous search request, enabling incremental + memory search from where the last operation left off. Default value is None. + :paramtype previous_search_id: str + :keyword options: Memory search options. Default value is None. + :paramtype options: ~azure.ai.projects.models.MemorySearchOptions + :return: MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreSearchResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7618,17 +8160,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.EvaluatorVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.MemoryStoreSearchResult] = kwargs.pop("cls", None) + if body is _Unset: + if scope is _Unset: + raise TypeError("missing required argument: scope") + body = { + "items": items, + "options": options, + "previous_search_id": previous_search_id, + "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(evaluator_version, (IOBase, bytes)): - _content = evaluator_version + if isinstance(body, (IOBase, bytes)): + _content = body else: - _content = json.dumps(evaluator_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_evaluators_create_version_request( + _request = build_memory_stores_search_memories_request( name=name, + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -7647,142 +8200,75 @@ def create_version( 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) - raise HttpResponseError(response=response) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.EvaluatorVersion, response.json()) + deserialized = _deserialize(_models.MemoryStoreSearchResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def update_version( + def _update_memories_initial( self, name: str, - version: str, - evaluator_version: _models.EvaluatorVersion, + body: Union[JSON, IO[bytes]] = _Unset, *, - content_type: str = "application/json", + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + scope: str = _Unset, + items: Optional[List[_models.InputItem]] = None, + previous_update_id: Optional[str] = None, + update_delay: Optional[int] = None, **kwargs: Any - ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. - - :param name: The name of the resource. Required. - :type name: str - :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.models.EvaluatorVersion - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update_version( - self, name: str, version: str, evaluator_version: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. + ) -> Iterator[bytes]: + 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 resource. Required. - :type name: str - :param version: The version of the EvaluatorVersion to update. Required. - :type version: str - :param evaluator_version: Evaluator resource. Required. - :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 - :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - @overload - def update_version( - self, - name: str, - version: str, - evaluator_version: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. - - :param name: The name of the resource. Required. - :type name: str - :param version: The version of the EvaluatorVersion to update. Required. - :type version: str - :param evaluator_version: Evaluator resource. Required. - :type evaluator_version: 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: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update_version( - self, - name: str, - version: str, - evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.EvaluatorVersion: - """Update an existing EvaluatorVersion with the given version id. - - :param name: The name of the resource. Required. - :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] - :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluatorVersion - :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.EvaluatorVersion] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + if body is _Unset: + if scope is _Unset: + raise TypeError("missing required argument: scope") + body = { + "items": items, + "previous_update_id": previous_update_id, + "scope": scope, + "update_delay": update_delay, + } + 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(evaluator_version, (IOBase, bytes)): - _content = evaluator_version + if isinstance(body, (IOBase, bytes)): + _content = body else: - _content = json.dumps(evaluator_version, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_evaluators_update_version_request( + _request = build_memory_stores_update_memories_request( name=name, - version=version, + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -7794,106 +8280,282 @@ def update_version( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = kwargs.pop("stream", False) + _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) - raise HttpResponseError(response=response) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.EvaluatorVersion, response.json()) + response_headers = {} + response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) + + deserialized = response.iter_bytes() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore + @overload + def _begin_update_memories( + self, + name: str, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + scope: str, + content_type: str = "application/json", + items: Optional[List[_models.InputItem]] = None, + previous_update_id: Optional[str] = None, + update_delay: Optional[int] = None, + **kwargs: Any + ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... + @overload + def _begin_update_memories( + self, + name: str, + body: JSON, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... + @overload + def _begin_update_memories( + self, + name: str, + body: IO[bytes], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... -class InsightsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. + @distributed_trace + def _begin_update_memories( + self, + name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + scope: str = _Unset, + items: Optional[List[_models.InputItem]] = None, + previous_update_id: Optional[str] = None, + update_delay: Optional[int] = None, + **kwargs: Any + ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: + """Update memory store with conversation memories. - Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s - :attr:`insights` attribute. - """ + :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] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :paramtype scope: str + :keyword items: Conversation items from which to extract memories. Default value is None. + :paramtype items: list[~azure.ai.projects.models.InputItem] + :keyword previous_update_id: The unique ID of the previous update request, enabling incremental + memory updates from where the last operation left off. Default value is None. + :paramtype previous_update_id: str + :keyword 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). Default value is None. + :paramtype update_delay: int + :return: An instance of LROPoller that returns MemoryStoreUpdateCompletedResult. The + MemoryStoreUpdateCompletedResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.ai.projects.models.MemoryStoreUpdateCompletedResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(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") + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MemoryStoreUpdateCompletedResult] = 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._update_memories_initial( + name=name, + body=body, + foundry_beta=foundry_beta, + scope=scope, + items=items, + previous_update_id=previous_update_id, + update_delay=update_delay, + 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") + ) + + deserialized = _deserialize(_models.MemoryStoreUpdateCompletedResult, 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.MemoryStoreUpdateCompletedResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.MemoryStoreUpdateCompletedResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @overload - def generate( - self, insight: _models.Insight, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Insight: - """Generate Insights. + def delete_scope( + self, + name: str, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + scope: str, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MemoryStoreDeleteScopeResult: + """Delete all memories associated with a specific scope from a memory store. - :param insight: Complete evaluation configuration including data source, evaluators, and result - settings. Required. - :type insight: ~azure.ai.projects.models.Insight + :param name: The name of the memory store. Required. + :type name: str + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword scope: The namespace that logically groups and isolates memories to delete, such as a + user ID. Required. + :paramtype scope: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: Insight. The Insight is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Insight + :return: MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDeleteScopeResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def generate(self, insight: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.Insight: - """Generate Insights. + def delete_scope( + self, + name: str, + body: JSON, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MemoryStoreDeleteScopeResult: + """Delete all memories associated with a specific scope from a memory store. - :param insight: Complete evaluation configuration including data source, evaluators, and result - settings. Required. - :type insight: JSON + :param name: The name of the memory store. Required. + :type name: str + :param body: Required. + :type body: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: Insight. The Insight is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Insight + :return: MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDeleteScopeResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def generate(self, insight: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> _models.Insight: - """Generate Insights. + def delete_scope( + self, + name: str, + body: IO[bytes], + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MemoryStoreDeleteScopeResult: + """Delete all memories associated with a specific scope from a memory store. - :param insight: Complete evaluation configuration including data source, evaluators, and result - settings. Required. - :type insight: IO[bytes] + :param name: The name of the memory store. Required. + :type name: str + :param body: Required. + :type body: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: Insight. The Insight is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Insight + :return: MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDeleteScopeResult :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: Any) -> _models.Insight: - """Generate Insights. + def delete_scope( + self, + name: str, + body: Union[JSON, IO[bytes]] = _Unset, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + scope: str = _Unset, + **kwargs: Any + ) -> _models.MemoryStoreDeleteScopeResult: + """Delete all memories associated with a specific scope from a memory store. - :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] - :return: Insight. The Insight is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Insight + :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] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword scope: The namespace that logically groups and isolates memories to delete, such as a + user ID. Required. + :paramtype scope: str + :return: MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with + MutableMapping + :rtype: ~azure.ai.projects.models.MemoryStoreDeleteScopeResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7908,16 +8570,23 @@ def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: A _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Insight] = kwargs.pop("cls", None) + cls: ClsType[_models.MemoryStoreDeleteScopeResult] = kwargs.pop("cls", 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} content_type = content_type or "application/json" _content = None - if isinstance(insight, (IOBase, bytes)): - _content = insight + if isinstance(body, (IOBase, bytes)): + _content = body else: - _content = json.dumps(insight, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_insights_generate_request( + _request = build_memory_stores_delete_scope_request( + name=name, + foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -7936,36 +8605,55 @@ def generate(self, insight: Union[_models.Insight, JSON, IO[bytes]], **kwargs: A 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) - raise HttpResponseError(response=response) + error = _failsafe_deserialize( + _models.ApiErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Insight, response.json()) + deserialized = _deserialize(_models.MemoryStoreDeleteScopeResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + +class RedTeamsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.AIProjectClient`'s + :attr:`red_teams` 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, *, include_coordinates: Optional[bool] = None, **kwargs: Any) -> _models.Insight: - """Get a specific insight by Id. + def get(self, name: str, **kwargs: Any) -> _models.RedTeam: + """Get a redteam by name. - :param id: The unique identifier for the insights report. Required. - :type id: str - :keyword include_coordinates: Whether to include coordinates for visualization in the response. - Defaults to false. Default value is None. - :paramtype include_coordinates: bool - :return: Insight. The Insight is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Insight + :param name: Identifier of the red team run. Required. + :type name: str + :return: RedTeam. The RedTeam is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7979,11 +8667,10 @@ def get(self, id: str, *, include_coordinates: Optional[bool] = None, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Insight] = kwargs.pop("cls", None) + cls: ClsType[_models.RedTeam] = kwargs.pop("cls", None) - _request = build_insights_get_request( - id=id, - include_coordinates=include_coordinates, + _request = build_red_teams_get_request( + name=name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8017,7 +8704,7 @@ def get(self, id: str, *, include_coordinates: Optional[bool] = None, **kwargs: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.Insight, response.json()) + deserialized = _deserialize(_models.RedTeam, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -8025,38 +8712,17 @@ def get(self, id: str, *, include_coordinates: Optional[bool] = None, **kwargs: return deserialized # type: ignore @distributed_trace - def list( - self, - *, - 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 - ) -> ItemPaged["_models.Insight"]: - """List all insights in reverse chronological order (newest first). + def list(self, **kwargs: Any) -> ItemPaged["_models.RedTeam"]: + """List a redteam by name. - :keyword type: Filter by the type of analysis. Known values are: "EvaluationRunClusterInsight", - "AgentClusterInsight", and "EvaluationComparison". Default value is None. - :paramtype type: str or ~azure.ai.projects.models.InsightType - :keyword eval_id: Filter by the evaluation ID. Default value is None. - :paramtype eval_id: str - :keyword run_id: Filter by the evaluation run ID. Default value is None. - :paramtype run_id: str - :keyword agent_name: Filter by the agent name. Default value is None. - :paramtype agent_name: str - :keyword include_coordinates: Whether to include coordinates for visualization in the response. - Defaults to false. Default value is None. - :paramtype include_coordinates: bool - :return: An iterator like instance of Insight - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Insight] + :return: An iterator like instance of RedTeam + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.RedTeam] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Insight]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RedTeam]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8069,12 +8735,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_insights_list_request( - type=type, - eval_id=eval_id, - run_id=run_id, - agent_name=agent_name, - include_coordinates=include_coordinates, + _request = build_red_teams_list_request( api_version=self._config.api_version, headers=_headers, params=_params, @@ -8110,7 +8771,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Insight], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.RedTeam], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -8132,6 +8793,162 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) + @overload + def create( + self, + red_team: _models.RedTeam, + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RedTeam: + """Creates a redteam run. + + :param red_team: Redteam to be run. Required. + :type red_team: ~azure.ai.projects.models.RedTeam + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. RED_TEAMS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.RED_TEAMS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RedTeam. The RedTeam is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.RedTeam + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + red_team: JSON, + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RedTeam: + """Creates a redteam run. + + :param red_team: Redteam to be run. Required. + :type red_team: JSON + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. RED_TEAMS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.RED_TEAMS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RedTeam. The RedTeam is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.RedTeam + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + red_team: IO[bytes], + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RedTeam: + """Creates a redteam run. + + :param red_team: Redteam to be run. Required. + :type red_team: IO[bytes] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. RED_TEAMS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.RED_TEAMS_V1 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: RedTeam. The RedTeam is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.RedTeam + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create( + self, + red_team: Union[_models.RedTeam, JSON, IO[bytes]], + *, + foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, + **kwargs: Any + ) -> _models.RedTeam: + """Creates a redteam run. + + :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] + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. RED_TEAMS_V1. Default value is None. + :paramtype foundry_beta: str or ~azure.ai.projects.models.RED_TEAMS_V1 + :return: RedTeam. The RedTeam is compatible with MutableMapping + :rtype: ~azure.ai.projects.models.RedTeam + :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.RedTeam] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(red_team, (IOBase, bytes)): + _content = red_team + else: + _content = json.dumps(red_team, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_red_teams_create_request( + foundry_beta=foundry_beta, + 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 = 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() + else: + deserialized = _deserialize(_models.RedTeam, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + class SchedulesOperations: """ @@ -8352,16 +9169,16 @@ def get_next(next_link=None): @overload def create_or_update( - self, id: str, schedule: _models.Schedule, *, content_type: str = "application/json", **kwargs: Any + self, id: str, resource: _models.Schedule, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Schedule: - """Create or update a schedule by id. + """Create or update operation template. :param id: Identifier of the schedule. Required. :type id: str - :param schedule: Schedule resource. Required. - :type schedule: ~azure.ai.projects.models.Schedule + :param resource: The resource instance. Required. + :type resource: ~azure.ai.projects.models.Schedule :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: Schedule. The Schedule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Schedule @@ -8370,16 +9187,16 @@ def create_or_update( @overload def create_or_update( - self, id: str, schedule: JSON, *, content_type: str = "application/json", **kwargs: Any + self, id: str, resource: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Schedule: - """Create or update a schedule by id. + """Create or update operation template. :param id: Identifier of the schedule. Required. :type id: str - :param schedule: Schedule resource. Required. - :type schedule: JSON + :param resource: The resource instance. Required. + :type resource: 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: Schedule. The Schedule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Schedule @@ -8388,16 +9205,16 @@ def create_or_update( @overload def create_or_update( - self, id: str, schedule: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, id: str, resource: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Schedule: - """Create or update a schedule by id. + """Create or update operation template. :param id: Identifier of the schedule. Required. :type id: str - :param schedule: Schedule resource. Required. - :type schedule: IO[bytes] + :param resource: The resource instance. Required. + :type resource: 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: Schedule. The Schedule is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Schedule @@ -8406,15 +9223,15 @@ def create_or_update( @distributed_trace def create_or_update( - self, id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any + self, id: str, resource: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any ) -> _models.Schedule: - """Create or update a schedule by id. + """Create or update operation template. :param id: Identifier of the schedule. Required. :type id: str - :param schedule: Schedule resource. Is one of the following types: Schedule, JSON, IO[bytes] - Required. - :type schedule: ~azure.ai.projects.models.Schedule or JSON or IO[bytes] + :param resource: The resource instance. Is one of the following types: Schedule, JSON, + IO[bytes] Required. + :type resource: ~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: @@ -8433,12 +9250,12 @@ def create_or_update( content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/merge-patch+json" _content = None - if isinstance(schedule, (IOBase, bytes)): - _content = schedule + if isinstance(resource, (IOBase, bytes)): + _content = resource else: - _content = json.dumps(schedule, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_schedules_create_or_update_request( id=id, @@ -8469,24 +9286,39 @@ def create_or_update( 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() else: deserialized = _deserialize(_models.Schedule, 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_run(self, schedule_id: str, run_id: str, **kwargs: Any) -> _models.ScheduleRun: + def get_run( + self, + schedule_id: str, + run_id: str, + *, + foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + **kwargs: Any + ) -> _models.ScheduleRun: """Get a schedule run by id. - :param schedule_id: Identifier of the schedule. Required. + :param schedule_id: The unique identifier of the schedule. Required. :type schedule_id: str - :param run_id: Identifier of the schedule run. Required. + :param run_id: The unique identifier of the schedule run. Required. :type run_id: str + :keyword foundry_beta: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1. Required. + :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 :return: ScheduleRun. The ScheduleRun is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ScheduleRun :raises ~azure.core.exceptions.HttpResponseError: @@ -8507,6 +9339,7 @@ def get_run(self, schedule_id: str, run_id: str, **kwargs: Any) -> _models.Sched _request = build_schedules_get_run_request( schedule_id=schedule_id, run_id=run_id, + foundry_beta=foundry_beta, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8530,7 +9363,11 @@ def get_run(self, schedule_id: str, run_id: str, **kwargs: Any) -> _models.Sched 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() diff --git a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd index a347fd395fe5..88d92c54eaec 100644 --- a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd +++ b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd @@ -10,7 +10,8 @@ REM REM Revert this, as we want to keep some edits to these file. git restore pyproject.toml -git restore azure\ai\projects\_version.py +REM Looks like this is no longer needed: +REM git restore azure\ai\projects\_version.py REM Rename "A2_A_PREVIEW" to "A2A_PREVIEW". Since this value is an extension to OpenAI.ToolType enum, we can't use @className in client.tsp to do the rename. powershell -Command "(Get-Content azure\ai\projects\models\_models.py) -replace 'A2_A_PREVIEW', 'A2A_PREVIEW' | Set-Content azure\ai\projects\models\_models.py" @@ -21,13 +22,13 @@ powershell -Command "(Get-Content azure\ai\projects\aio\operations\_operations.p powershell -Command "(Get-Content azure\ai\projects\operations\_operations.py) -replace '\"items_property\": items', '\"items\": items' | Set-Content azure\ai\projects\operations\_operations.py" REM Fix type annotations by replacing "_types.Filters" with proper union type to fix Pyright errors -powershell -Command "(Get-Content azure\ai\projects\models\_models.py) -replace '\"_types\.Filters\"', 'Union[\"_models.ComparisonFilter\", \"_models.CompoundFilter\"]' | Set-Content azure\ai\projects\models\_models.py" +REM powershell -Command "(Get-Content azure\ai\projects\models\_models.py) -replace '\"_types\.Filters\"', 'Union[\"_models.ComparisonFilter\", \"_models.CompoundFilter\"]' | Set-Content azure\ai\projects\models\_models.py" REM Add additional pylint disables to the model_base.py file -powershell -Command "(Get-Content azure\ai\projects\_utils\model_base.py) -replace '# pylint: disable=protected-access, broad-except', '# pylint: disable=protected-access, broad-except, import-error, no-value-for-parameter' | Set-Content azure\ai\projects\_utils\model_base.py" +REM powershell -Command "(Get-Content azure\ai\projects\_utils\model_base.py) -replace '# pylint: disable=protected-access, broad-except', '# pylint: disable=protected-access, broad-except, import-error, no-value-for-parameter' | Set-Content azure\ai\projects\_utils\model_base.py" REM Add pyright ignore comment to created_by fields to suppress reportIncompatibleVariableOverride errors -powershell -Command "(Get-Content azure\ai\projects\models\_models.py) -replace 'created_by: Optional\[str\] = rest_field\(visibility=\[\"read\", \"create\", \"update\", \"delete\", \"query\"\]\)', 'created_by: Optional[str] = rest_field(visibility=[\"read\", \"create\", \"update\", \"delete\", \"query\"]) # pyright: ignore[reportIncompatibleVariableOverride]' | Set-Content azure\ai\projects\models\_models.py" +REM powershell -Command "(Get-Content azure\ai\projects\models\_models.py) -replace 'created_by: Optional\[str\] = rest_field\(visibility=\[\"read\", \"create\", \"update\", \"delete\", \"query\"\]\)', 'created_by: Optional[str] = rest_field(visibility=[\"read\", \"create\", \"update\", \"delete\", \"query\"]) # pyright: ignore[reportIncompatibleVariableOverride]' | Set-Content azure\ai\projects\models\_models.py" echo Now do these additional changes manually, if you want the "Generate docs" job to succeed in PR pipeline REM Remove `generate_summary` from class `Reasoning`. It's deprecated but causes two types of errors. Consider removing it from TypeSpec. diff --git a/sdk/ai/azure-ai-projects/pyproject.toml b/sdk/ai/azure-ai-projects/pyproject.toml index 7f55115918ef..d5a866a06ce3 100644 --- a/sdk/ai/azure-ai-projects/pyproject.toml +++ b/sdk/ai/azure-ai-projects/pyproject.toml @@ -33,7 +33,7 @@ keywords = ["azure", "azure sdk"] dependencies = [ "isodate>=0.6.1", - "azure-core>=1.36.0", + "azure-core>=1.37.0", "typing-extensions>=4.11", "azure-identity>=1.15.0", "openai>=2.8.0", diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py index 93d2a41866e4..f2a9bdaa1c24 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py @@ -84,7 +84,9 @@ scope = "user_123" # Extract memories from messages and add them to the memory store - user_message = EasyInputMessage(role="user", content="I prefer dark roast coffee and usually drink it in the morning") + user_message = EasyInputMessage( + role="user", content="I prefer dark roast coffee and usually drink it in the morning" + ) update_poller = project_client.memory_stores.begin_update_memories( name=memory_store.name, scope=scope, @@ -130,7 +132,9 @@ print(f" - Memory ID: {memory.memory_item.memory_id}, Content: {memory.memory_item.content}") # Perform another search using the previous search as context - agent_message = EasyInputMessage(role="assistant", content="You previously indicated a preference for dark roast coffee in the morning.") + agent_message = EasyInputMessage( + role="assistant", content="You previously indicated a preference for dark roast coffee in the morning." + ) followup_query = EasyInputMessage(role="user", content="What about afternoon?") followup_search_response = project_client.memory_stores.search_memories( name=memory_store.name, diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced_async.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced_async.py index 0f607302208e..019a8d88306d 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced_async.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced_async.py @@ -88,7 +88,9 @@ async def main() -> None: scope = "user_123" # Extract memories from messages and add them to the memory store - user_message = EasyInputMessage(role="user", content="I prefer dark roast coffee and usually drink it in the morning") + user_message = EasyInputMessage( + role="user", content="I prefer dark roast coffee and usually drink it in the morning" + ) update_poller = await project_client.memory_stores.begin_update_memories( name=memory_store.name, scope=scope, @@ -136,7 +138,9 @@ async def main() -> None: print(f" - Memory ID: {memory.memory_item.memory_id}, Content: {memory.memory_item.content}") # Perform another search using the previous search as context - agent_message = EasyInputMessage(role="assistant", content="You previously indicated a preference for dark roast coffee in the morning.") + agent_message = EasyInputMessage( + role="assistant", content="You previously indicated a preference for dark roast coffee in the morning." + ) followup_query = EasyInputMessage(role="user", content="What about afternoon?") followup_search_response = await project_client.memory_stores.search_memories( name=memory_store.name, diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py index 3969e8ffb779..90b0f9e70032 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py @@ -82,7 +82,9 @@ scope = "user_123" # Add a memory to the memory store - user_message = EasyInputMessage(role="user", content="I prefer dark roast coffee and usually drink it in the morning") + user_message = EasyInputMessage( + role="user", content="I prefer dark roast coffee and usually drink it in the morning" + ) update_poller = project_client.memory_stores.begin_update_memories( name=memory_store.name, scope=scope, diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic_async.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic_async.py index 6cf110c3a932..1bf50cf79242 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic_async.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic_async.py @@ -87,7 +87,9 @@ async def main() -> None: scope = "user_123" # Add a memory to the memory store - user_message = EasyInputMessage(role="user", content="I prefer dark roast coffee and usually drink it in the morning") + user_message = EasyInputMessage( + role="user", content="I prefer dark roast coffee and usually drink it in the morning" + ) update_poller = await project_client.memory_stores.begin_update_memories( name=memory_store.name, scope=scope, From f630bc750d635c2e8256eb3aa5b3e959be39f3cb Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 30 Jan 2026 16:59:58 -0800 Subject: [PATCH 03/22] Update samples to show pip install `azure-ai-projects>=2.0.0b4` --- sdk/ai/azure-ai-projects/README.md | 2 +- sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic.py | 2 +- .../samples/agents/sample_agent_basic_async.py | 2 +- .../samples/agents/sample_agent_retrieve_basic.py | 2 +- .../samples/agents/sample_agent_retrieve_basic_async.py | 2 +- .../samples/agents/sample_agent_stream_events.py | 2 +- .../samples/agents/sample_agent_structured_output.py | 2 +- .../samples/agents/sample_agent_structured_output_async.py | 2 +- .../samples/agents/sample_workflow_multi_agent.py | 2 +- .../samples/agents/sample_workflow_multi_agent_async.py | 2 +- .../telemetry/sample_agent_basic_with_azure_monitor_tracing.py | 2 +- .../agents/telemetry/sample_agent_basic_with_console_tracing.py | 2 +- ...sample_agent_basic_with_console_tracing_custom_attributes.py | 2 +- .../samples/agents/tools/sample_agent_ai_search.py | 2 +- .../samples/agents/tools/sample_agent_bing_custom_search.py | 2 +- .../samples/agents/tools/sample_agent_bing_grounding.py | 2 +- .../samples/agents/tools/sample_agent_browser_automation.py | 2 +- .../samples/agents/tools/sample_agent_code_interpreter.py | 2 +- .../samples/agents/tools/sample_agent_code_interpreter_async.py | 2 +- .../samples/agents/tools/sample_agent_computer_use.py | 2 +- .../samples/agents/tools/sample_agent_computer_use_async.py | 2 +- .../samples/agents/tools/sample_agent_fabric.py | 2 +- .../samples/agents/tools/sample_agent_file_search.py | 2 +- .../samples/agents/tools/sample_agent_file_search_in_stream.py | 2 +- .../agents/tools/sample_agent_file_search_in_stream_async.py | 2 +- .../samples/agents/tools/sample_agent_function_tool.py | 2 +- .../samples/agents/tools/sample_agent_function_tool_async.py | 2 +- .../samples/agents/tools/sample_agent_image_generation.py | 2 +- .../samples/agents/tools/sample_agent_image_generation_async.py | 2 +- .../azure-ai-projects/samples/agents/tools/sample_agent_mcp.py | 2 +- .../samples/agents/tools/sample_agent_mcp_async.py | 2 +- .../agents/tools/sample_agent_mcp_with_project_connection.py | 2 +- .../tools/sample_agent_mcp_with_project_connection_async.py | 2 +- .../samples/agents/tools/sample_agent_memory_search.py | 2 +- .../samples/agents/tools/sample_agent_memory_search_async.py | 2 +- .../samples/agents/tools/sample_agent_openapi.py | 2 +- .../tools/sample_agent_openapi_with_project_connection.py | 2 +- .../samples/agents/tools/sample_agent_sharepoint.py | 2 +- .../samples/agents/tools/sample_agent_to_agent.py | 2 +- .../samples/agents/tools/sample_agent_web_search.py | 2 +- .../azure-ai-projects/samples/connections/sample_connections.py | 2 +- .../samples/connections/sample_connections_async.py | 2 +- sdk/ai/azure-ai-projects/samples/datasets/sample_datasets.py | 2 +- .../azure-ai-projects/samples/datasets/sample_datasets_async.py | 2 +- .../samples/datasets/sample_datasets_download.py | 2 +- .../azure-ai-projects/samples/deployments/sample_deployments.py | 2 +- .../samples/deployments/sample_deployments_async.py | 2 +- .../samples/evaluations/agentic_evaluators/sample_coherence.py | 2 +- .../samples/evaluations/agentic_evaluators/sample_fluency.py | 2 +- .../sample_generic_agentic_evaluator.py | 2 +- .../evaluations/agentic_evaluators/sample_groundedness.py | 2 +- .../evaluations/agentic_evaluators/sample_intent_resolution.py | 2 +- .../samples/evaluations/agentic_evaluators/sample_relevance.py | 2 +- .../agentic_evaluators/sample_response_completeness.py | 2 +- .../evaluations/agentic_evaluators/sample_task_adherence.py | 2 +- .../evaluations/agentic_evaluators/sample_task_completion.py | 2 +- .../agentic_evaluators/sample_task_navigation_efficiency.py | 2 +- .../evaluations/agentic_evaluators/sample_tool_call_accuracy.py | 2 +- .../evaluations/agentic_evaluators/sample_tool_call_success.py | 2 +- .../agentic_evaluators/sample_tool_input_accuracy.py | 2 +- .../agentic_evaluators/sample_tool_output_utilization.py | 2 +- .../evaluations/agentic_evaluators/sample_tool_selection.py | 2 +- .../samples/evaluations/sample_agent_evaluation.py | 2 +- .../samples/evaluations/sample_agent_response_evaluation.py | 2 +- .../sample_agent_response_evaluation_with_function_tool.py | 2 +- .../samples/evaluations/sample_continuous_evaluation_rule.py | 2 +- .../samples/evaluations/sample_eval_catalog.py | 2 +- .../evaluations/sample_eval_catalog_code_based_evaluators.py | 2 +- .../evaluations/sample_eval_catalog_prompt_based_evaluators.py | 2 +- .../samples/evaluations/sample_evaluation_cluster_insight.py | 2 +- .../samples/evaluations/sample_evaluation_compare_insight.py | 2 +- .../samples/evaluations/sample_evaluations_ai_assisted.py | 2 +- .../evaluations/sample_evaluations_builtin_with_dataset_id.py | 2 +- .../evaluations/sample_evaluations_builtin_with_inline_data.py | 2 +- .../evaluations/sample_evaluations_builtin_with_traces.py | 2 +- .../samples/evaluations/sample_evaluations_graders.py | 2 +- .../samples/evaluations/sample_model_evaluation.py | 2 +- .../samples/evaluations/sample_redteam_evaluations.py | 2 +- .../samples/evaluations/sample_scheduled_evaluations.py | 2 +- sdk/ai/azure-ai-projects/samples/indexes/sample_indexes.py | 2 +- .../azure-ai-projects/samples/indexes/sample_indexes_async.py | 2 +- .../samples/mcp_client/sample_mcp_tool_async.py | 2 +- .../samples/memories/sample_memory_advanced.py | 2 +- .../samples/memories/sample_memory_advanced_async.py | 2 +- .../azure-ai-projects/samples/memories/sample_memory_basic.py | 2 +- .../samples/memories/sample_memory_basic_async.py | 2 +- sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py | 2 +- .../samples/memories/sample_memory_crud_async.py | 2 +- sdk/ai/azure-ai-projects/samples/red_team/sample_red_team.py | 2 +- .../azure-ai-projects/samples/red_team/sample_red_team_async.py | 2 +- .../samples/responses/sample_responses_basic.py | 2 +- .../samples/responses/sample_responses_basic_async.py | 2 +- .../samples/responses/sample_responses_image_input.py | 2 +- .../samples/responses/sample_responses_stream_events.py | 2 +- .../samples/responses/sample_responses_stream_manager.py | 2 +- .../samples/responses/sample_responses_structured_output.py | 2 +- sdk/ai/azure-ai-projects/samples/telemetry/sample_telemetry.py | 2 +- .../samples/telemetry/sample_telemetry_async.py | 2 +- 98 files changed, 98 insertions(+), 98 deletions(-) diff --git a/sdk/ai/azure-ai-projects/README.md b/sdk/ai/azure-ai-projects/README.md index f6c858708b72..2b8baaff8831 100644 --- a/sdk/ai/azure-ai-projects/README.md +++ b/sdk/ai/azure-ai-projects/README.md @@ -954,7 +954,7 @@ You can add an Application Insights Azure resource to your Microsoft Foundry pro Make sure to install OpenTelemetry and the Azure SDK tracing plugin via ```bash -pip install "azure-ai-projects>=2.0.0b1" azure-identity opentelemetry-sdk azure-core-tracing-opentelemetry azure-monitor-opentelemetry +pip install "azure-ai-projects>=2.0.0b4" opentelemetry-sdk azure-core-tracing-opentelemetry azure-monitor-opentelemetry ``` You will also need an exporter to send telemetry to your observability backend. You can print traces to the console or use a local viewer such as [Aspire Dashboard](https://learn.microsoft.com/dotnet/aspire/fundamentals/dashboard/standalone?tabs=bash). diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic.py b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic.py index a3f87dcdeb81..7ca90a2efad3 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic.py @@ -17,7 +17,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic_async.py b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic_async.py index 5894722ed72d..3c33176da798 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_basic_async.py @@ -17,7 +17,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic.py b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic.py index 1102d326b2f3..8d8c190c57d5 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic.py @@ -18,7 +18,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic_async.py b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic_async.py index 5cae332aa01f..4a5489db834a 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic_async.py @@ -18,7 +18,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" aiohttp python-dotenv + pip install "azure-ai-projects>=2.0.0b4" aiohttp python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_stream_events.py b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_stream_events.py index 2e90a148bf9c..fa8e31045a55 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_stream_events.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_stream_events.py @@ -18,7 +18,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_structured_output.py b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_structured_output.py index 31d84821591e..844f89fcb3c2 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_structured_output.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_structured_output.py @@ -22,7 +22,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv pydantic + pip install "azure-ai-projects>=2.0.0b4" python-dotenv pydantic Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_structured_output_async.py b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_structured_output_async.py index beb96d3800a9..8571cc8e07a2 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_structured_output_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_structured_output_async.py @@ -22,7 +22,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp pydantic + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp pydantic Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview 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 65e51a97aa6c..e733a206ff1f 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 @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview 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 293fbcf5fa09..bb4042abecf1 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 @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/telemetry/sample_agent_basic_with_azure_monitor_tracing.py b/sdk/ai/azure-ai-projects/samples/agents/telemetry/sample_agent_basic_with_azure_monitor_tracing.py index 5ceede581e59..e79fab387673 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/telemetry/sample_agent_basic_with_azure_monitor_tracing.py +++ b/sdk/ai/azure-ai-projects/samples/agents/telemetry/sample_agent_basic_with_azure_monitor_tracing.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv azure-monitor-opentelemetry + pip install "azure-ai-projects>=2.0.0b4" python-dotenv azure-monitor-opentelemetry Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/telemetry/sample_agent_basic_with_console_tracing.py b/sdk/ai/azure-ai-projects/samples/agents/telemetry/sample_agent_basic_with_console_tracing.py index 85e844cc5c27..5abdba346def 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/telemetry/sample_agent_basic_with_console_tracing.py +++ b/sdk/ai/azure-ai-projects/samples/agents/telemetry/sample_agent_basic_with_console_tracing.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv opentelemetry-sdk azure-core-tracing-opentelemetry + pip install "azure-ai-projects>=2.0.0b4" python-dotenv opentelemetry-sdk azure-core-tracing-opentelemetry Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/telemetry/sample_agent_basic_with_console_tracing_custom_attributes.py b/sdk/ai/azure-ai-projects/samples/agents/telemetry/sample_agent_basic_with_console_tracing_custom_attributes.py index 0864fcc3f9d9..2cc58950ca0f 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/telemetry/sample_agent_basic_with_console_tracing_custom_attributes.py +++ b/sdk/ai/azure-ai-projects/samples/agents/telemetry/sample_agent_basic_with_console_tracing_custom_attributes.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv opentelemetry-sdk azure-core-tracing-opentelemetry + pip install "azure-ai-projects>=2.0.0b4" python-dotenv opentelemetry-sdk azure-core-tracing-opentelemetry Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_ai_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_ai_search.py index 876ed221a2fe..eaa05ad3fda4 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_ai_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_ai_search.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_custom_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_custom_search.py index ea15b1c331a5..d5bbee261047 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_custom_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_custom_search.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_grounding.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_grounding.py index b09aa64347ee..891250783659 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_grounding.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_bing_grounding.py @@ -22,7 +22,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_browser_automation.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_browser_automation.py index 5156baa55fd3..87d444c6b623 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_browser_automation.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_browser_automation.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter.py index 443f736d5cff..0f0c522bc61f 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_async.py index 0f8f8eacf6ee..3aafc79626e7 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_code_interpreter_async.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use.py index 04c0a336bd39..e439bd388b3b 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use.py @@ -20,7 +20,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use_async.py index 33d33ef33be6..86ae06ce232f 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_computer_use_async.py @@ -20,7 +20,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_fabric.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_fabric.py index 3107cfe87e23..4a7639aaa308 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_fabric.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_fabric.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search.py index 9351a29a8977..43c71427f6e9 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search.py @@ -13,7 +13,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream.py index 21c04ba22bf6..c1a95213708c 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream_async.py index 31280352ac7c..746c83f58837 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_file_search_in_stream_async.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool.py index cfa1dad9ba7f..8c8a7bc4d281 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool_async.py index 9a70726fb2cf..4fc0ec2756ce 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_function_tool_async.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation.py index 3fd58f5aa926..815da33ac701 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation.py @@ -22,7 +22,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation_async.py index 0ad945453783..ae97e3817ccc 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation_async.py @@ -22,7 +22,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp.py index 17fcbe97df6f..f914919afc3f 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_async.py index ddcbc3e4614c..292a22509019 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_async.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection.py index 3534a00ae3eb..f0422331df33 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection_async.py index 2ccad0ca0a03..28072869aea8 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_mcp_with_project_connection_async.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search.py index dd08e302693d..b76dbf494693 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search.py @@ -18,7 +18,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Deploy a chat model (e.g. gpt-4.1) and an embedding model (e.g. text-embedding-3-small). Once you have deployed models, set the deployment name in the variables below. diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search_async.py index 4a54942a9f7a..3dce555f5f69 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search_async.py @@ -18,7 +18,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Deploy a chat model (e.g. gpt-4.1) and an embedding model (e.g. text-embedding-3-small). Once you have deployed models, set the deployment name in the variables below. diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi.py index 94f71a6b4634..901c33283ed6 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv jsonref + pip install "azure-ai-projects>=2.0.0b4" python-dotenv jsonref Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi_with_project_connection.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi_with_project_connection.py index b1f4e2022321..7f680a979e6a 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi_with_project_connection.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi_with_project_connection.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv jsonref + pip install "azure-ai-projects>=2.0.0b4" python-dotenv jsonref Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_sharepoint.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_sharepoint.py index 4388b73f3f53..dec10b425b54 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_sharepoint.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_sharepoint.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_to_agent.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_to_agent.py index b190090f9cf3..8ec7df5d3902 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_to_agent.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_to_agent.py @@ -16,7 +16,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py index 7ef45abec3dd..b83844e28db7 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py @@ -13,7 +13,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/connections/sample_connections.py b/sdk/ai/azure-ai-projects/samples/connections/sample_connections.py index 33266e030587..6a075b23b96c 100644 --- a/sdk/ai/azure-ai-projects/samples/connections/sample_connections.py +++ b/sdk/ai/azure-ai-projects/samples/connections/sample_connections.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/connections/sample_connections_async.py b/sdk/ai/azure-ai-projects/samples/connections/sample_connections_async.py index f199e86ba35c..2e115e18aaf2 100644 --- a/sdk/ai/azure-ai-projects/samples/connections/sample_connections_async.py +++ b/sdk/ai/azure-ai-projects/samples/connections/sample_connections_async.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/datasets/sample_datasets.py b/sdk/ai/azure-ai-projects/samples/datasets/sample_datasets.py index 5521931ed21c..a2c2c30c9e0b 100644 --- a/sdk/ai/azure-ai-projects/samples/datasets/sample_datasets.py +++ b/sdk/ai/azure-ai-projects/samples/datasets/sample_datasets.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/datasets/sample_datasets_async.py b/sdk/ai/azure-ai-projects/samples/datasets/sample_datasets_async.py index 4c36b4518c79..d159fea9e2af 100644 --- a/sdk/ai/azure-ai-projects/samples/datasets/sample_datasets_async.py +++ b/sdk/ai/azure-ai-projects/samples/datasets/sample_datasets_async.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/datasets/sample_datasets_download.py b/sdk/ai/azure-ai-projects/samples/datasets/sample_datasets_download.py index dc701ca81b81..2600f864c365 100644 --- a/sdk/ai/azure-ai-projects/samples/datasets/sample_datasets_download.py +++ b/sdk/ai/azure-ai-projects/samples/datasets/sample_datasets_download.py @@ -16,7 +16,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/deployments/sample_deployments.py b/sdk/ai/azure-ai-projects/samples/deployments/sample_deployments.py index 295e713d1846..70a3a981e015 100644 --- a/sdk/ai/azure-ai-projects/samples/deployments/sample_deployments.py +++ b/sdk/ai/azure-ai-projects/samples/deployments/sample_deployments.py @@ -13,7 +13,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/deployments/sample_deployments_async.py b/sdk/ai/azure-ai-projects/samples/deployments/sample_deployments_async.py index cd0c322c6fbc..bbc5db10b6d4 100644 --- a/sdk/ai/azure-ai-projects/samples/deployments/sample_deployments_async.py +++ b/sdk/ai/azure-ai-projects/samples/deployments/sample_deployments_async.py @@ -13,7 +13,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_coherence.py b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_coherence.py index 4f3b93813bb4..7cc8638693e5 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_coherence.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_coherence.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_fluency.py b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_fluency.py index fc51bf844426..cd4dce1ce152 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_fluency.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_fluency.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_generic_agentic_evaluator/sample_generic_agentic_evaluator.py b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_generic_agentic_evaluator/sample_generic_agentic_evaluator.py index b4cd599e684d..a21b770b777b 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_generic_agentic_evaluator/sample_generic_agentic_evaluator.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_generic_agentic_evaluator/sample_generic_agentic_evaluator.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_groundedness.py b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_groundedness.py index e59ae572009a..ab22619ee672 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_groundedness.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_groundedness.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_intent_resolution.py b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_intent_resolution.py index 176733e9894e..97b23e78e02f 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_intent_resolution.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_intent_resolution.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_relevance.py b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_relevance.py index c6046938fc63..2010cb056409 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_relevance.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_relevance.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_response_completeness.py b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_response_completeness.py index e63911bfbb9a..e009731db128 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_response_completeness.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_response_completeness.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_task_adherence.py b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_task_adherence.py index 0cbc213e475a..67c2dad71fbb 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_task_adherence.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_task_adherence.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_task_completion.py b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_task_completion.py index e91915fd67ad..87804396d05b 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_task_completion.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_task_completion.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_task_navigation_efficiency.py b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_task_navigation_efficiency.py index cac84b1c9750..f1f9353d3e77 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_task_navigation_efficiency.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_task_navigation_efficiency.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_call_accuracy.py b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_call_accuracy.py index c70261d52d9e..7903ae929512 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_call_accuracy.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_call_accuracy.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_call_success.py b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_call_success.py index 9e9ed9d042bb..84211c2cf320 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_call_success.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_call_success.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_input_accuracy.py b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_input_accuracy.py index c6479709cda7..f3d0f6a688a7 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_input_accuracy.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_input_accuracy.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_output_utilization.py b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_output_utilization.py index 172cb4fa9f3c..6ee61ee717f6 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_output_utilization.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_output_utilization.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_selection.py b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_selection.py index 571f2060c2cc..8ab24c315d0e 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_selection.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/agentic_evaluators/sample_tool_selection.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_evaluation.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_evaluation.py index af587d75b6b7..b2590349893a 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_evaluation.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_evaluation.py @@ -16,7 +16,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_response_evaluation.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_response_evaluation.py index 3ae0c4b4db98..8ea75c3247c5 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_response_evaluation.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_response_evaluation.py @@ -16,7 +16,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_response_evaluation_with_function_tool.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_response_evaluation_with_function_tool.py index 64b7099abf1e..ecc232f0ebcb 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_response_evaluation_with_function_tool.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_response_evaluation_with_function_tool.py @@ -16,7 +16,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_continuous_evaluation_rule.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_continuous_evaluation_rule.py index 9a9972678e0c..f24bc14f208e 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_continuous_evaluation_rule.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_continuous_evaluation_rule.py @@ -25,7 +25,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog.py index f00b953f6c37..6cf957e50952 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_code_based_evaluators.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_code_based_evaluators.py index d4dec7209354..81a4ccee2f89 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_code_based_evaluators.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_code_based_evaluators.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_prompt_based_evaluators.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_prompt_based_evaluators.py index 9c13d93b3d29..0669329711bc 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_prompt_based_evaluators.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_prompt_based_evaluators.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_cluster_insight.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_cluster_insight.py index 98c18dd97d84..751047c33310 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_cluster_insight.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_cluster_insight.py @@ -18,7 +18,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_compare_insight.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_compare_insight.py index 953003de1ce1..45b4686f3bf1 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_compare_insight.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_compare_insight.py @@ -18,7 +18,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_ai_assisted.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_ai_assisted.py index e14beec50fd5..4af82c33cdf5 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_ai_assisted.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_ai_assisted.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_builtin_with_dataset_id.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_builtin_with_dataset_id.py index 209f26daf171..a1998429e8b0 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_builtin_with_dataset_id.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_builtin_with_dataset_id.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_builtin_with_inline_data.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_builtin_with_inline_data.py index 642ec007ce7e..0ce61c5b6186 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_builtin_with_inline_data.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_builtin_with_inline_data.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_builtin_with_traces.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_builtin_with_traces.py index 8658a605498f..249705035cb5 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_builtin_with_traces.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_builtin_with_traces.py @@ -16,7 +16,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv azure-monitor-query + pip install "azure-ai-projects>=2.0.0b4" python-dotenv azure-monitor-query Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_graders.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_graders.py index 806d734330fc..5b503d6f2356 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_graders.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_graders.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_model_evaluation.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_model_evaluation.py index 91e45ecf3355..38a4e921d118 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_model_evaluation.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_model_evaluation.py @@ -17,7 +17,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_redteam_evaluations.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_redteam_evaluations.py index 4773ae76102c..29e7f77db6e3 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_redteam_evaluations.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_redteam_evaluations.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_scheduled_evaluations.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_scheduled_evaluations.py index 18ba9481a951..9f301303840e 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_scheduled_evaluations.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_scheduled_evaluations.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv azure-mgmt-authorization azure-mgmt-resource + pip install "azure-ai-projects>=2.0.0b4" python-dotenv azure-mgmt-authorization azure-mgmt-resource Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/indexes/sample_indexes.py b/sdk/ai/azure-ai-projects/samples/indexes/sample_indexes.py index d8429f8d1ff1..9534aae7e309 100644 --- a/sdk/ai/azure-ai-projects/samples/indexes/sample_indexes.py +++ b/sdk/ai/azure-ai-projects/samples/indexes/sample_indexes.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/indexes/sample_indexes_async.py b/sdk/ai/azure-ai-projects/samples/indexes/sample_indexes_async.py index ce37089d20d6..24f05fa57266 100644 --- a/sdk/ai/azure-ai-projects/samples/indexes/sample_indexes_async.py +++ b/sdk/ai/azure-ai-projects/samples/indexes/sample_indexes_async.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/mcp_client/sample_mcp_tool_async.py b/sdk/ai/azure-ai-projects/samples/mcp_client/sample_mcp_tool_async.py index de76f3097ceb..216fd54a7057 100644 --- a/sdk/ai/azure-ai-projects/samples/mcp_client/sample_mcp_tool_async.py +++ b/sdk/ai/azure-ai-projects/samples/mcp_client/sample_mcp_tool_async.py @@ -26,7 +26,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv mcp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv mcp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py index f2a9bdaa1c24..5368936f1ef5 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py @@ -18,7 +18,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Deploy a chat model (e.g. gpt-4.1) and an embedding model (e.g. text-embedding-3-small). Once you have deployed models, set the deployment name in the variables below. diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced_async.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced_async.py index 019a8d88306d..1eaeed6d6eec 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced_async.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced_async.py @@ -18,7 +18,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Deploy a chat model (e.g. gpt-4.1) and an embedding model (e.g. text-embedding-3-small). Once you have deployed models, set the deployment name in the variables below. diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py index 90b0f9e70032..33bb33f5e613 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py @@ -16,7 +16,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Deploy a chat model (e.g. gpt-4.1) and an embedding model (e.g. text-embedding-3-small). Once you have deployed models, set the deployment name in the variables below. diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic_async.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic_async.py index 1bf50cf79242..f2aba5612750 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic_async.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic_async.py @@ -17,7 +17,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Deploy a chat model (e.g. gpt-4.1) and an embedding model (e.g. text-embedding-3-small). Once you have deployed models, set the deployment name in the variables below. diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py index 3101976e7c34..63f9d4ffdbef 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py @@ -17,7 +17,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud_async.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud_async.py index 6d96c5d23aba..2517a580b3ab 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud_async.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud_async.py @@ -17,7 +17,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/red_team/sample_red_team.py b/sdk/ai/azure-ai-projects/samples/red_team/sample_red_team.py index e5e2252501e5..747fd3d91d51 100644 --- a/sdk/ai/azure-ai-projects/samples/red_team/sample_red_team.py +++ b/sdk/ai/azure-ai-projects/samples/red_team/sample_red_team.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/red_team/sample_red_team_async.py b/sdk/ai/azure-ai-projects/samples/red_team/sample_red_team_async.py index 34b4580ee80c..435a088ecce8 100644 --- a/sdk/ai/azure-ai-projects/samples/red_team/sample_red_team_async.py +++ b/sdk/ai/azure-ai-projects/samples/red_team/sample_red_team_async.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic.py b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic.py index 5dd5e86d385e..1bb5d52fcdbf 100644 --- a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic.py +++ b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" openai azure-identity python-dotenv + pip install "azure-ai-projects>=2.0.0b4" openai azure-identity python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic_async.py b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic_async.py index 590c85480b27..752ddbf40b78 100644 --- a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic_async.py +++ b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic_async.py @@ -15,7 +15,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_image_input.py b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_image_input.py index d75a83c8feaf..ffede4ef3b58 100644 --- a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_image_input.py +++ b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_image_input.py @@ -16,7 +16,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_stream_events.py b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_stream_events.py index 6c4ab37c17a7..7068a2fd24f5 100644 --- a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_stream_events.py +++ b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_stream_events.py @@ -17,7 +17,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_stream_manager.py b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_stream_manager.py index 31368d285576..b3ab4ecac13f 100644 --- a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_stream_manager.py +++ b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_stream_manager.py @@ -17,7 +17,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_structured_output.py b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_structured_output.py index e45bbdd5f8a5..0e081799afb0 100644 --- a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_structured_output.py +++ b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_structured_output.py @@ -17,7 +17,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/telemetry/sample_telemetry.py b/sdk/ai/azure-ai-projects/samples/telemetry/sample_telemetry.py index 697a2e78d614..cf35d6d3cad7 100644 --- a/sdk/ai/azure-ai-projects/samples/telemetry/sample_telemetry.py +++ b/sdk/ai/azure-ai-projects/samples/telemetry/sample_telemetry.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/telemetry/sample_telemetry_async.py b/sdk/ai/azure-ai-projects/samples/telemetry/sample_telemetry_async.py index bb5a5c55dac4..5c53760c58f6 100644 --- a/sdk/ai/azure-ai-projects/samples/telemetry/sample_telemetry_async.py +++ b/sdk/ai/azure-ai-projects/samples/telemetry/sample_telemetry_async.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the overview page of your From 3bedda255ddad11dd3fbce114e29c4b76a841a97 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Fri, 30 Jan 2026 17:39:19 -0800 Subject: [PATCH 04/22] Update README.md --- sdk/ai/azure-ai-projects/README.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sdk/ai/azure-ai-projects/README.md b/sdk/ai/azure-ai-projects/README.md index 2b8baaff8831..cb157d7f8454 100644 --- a/sdk/ai/azure-ai-projects/README.md +++ b/sdk/ai/azure-ai-projects/README.md @@ -32,7 +32,7 @@ resources in your Microsoft Foundry Project. Use it to: * **Upload documents and create Datasets** to reference them using the `.datasets` operations. * **Create and enumerate Search Indexes** using methods the `.indexes` operations. -The client library uses version `2025-11-15-preview` of the AI Foundry [data plane REST APIs](https://aka.ms/azsdk/azure-ai-projects-v2/api-reference-2025-11-15-preview). +The client library uses version `v1` of the AI Foundry [data plane REST APIs](https://aka.ms/azsdk/azure-ai-projects-v2/api-reference-v1). [Product documentation](https://aka.ms/azsdk/azure-ai-projects-v2/product-doc) | [Samples][samples] @@ -64,12 +64,6 @@ To report an issue with the client library, or request additional features, plea pip install --pre azure-ai-projects ``` -Note that the packages [openai](https://pypi.org/project/openai) and [azure-identity](https://pypi.org/project/azure-identity) also need to be installed if you intend to call `get_openai_client()`: - -```bash -pip install openai azure-identity -``` - ## Key concepts ### Create and authenticate the client with Entra ID From 3545a8d11d7f4c0b159617ae2687ea140015eec2 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Mon, 2 Feb 2026 08:30:17 -0800 Subject: [PATCH 05/22] Re-emit. Fixes due to class rename and new v1 version --- sdk/ai/azure-ai-projects/CHANGELOG.md | 1 + .../azure-ai-projects/apiview-properties.json | 1 - .../azure/ai/projects/_patch.py | 40 ++- .../azure/ai/projects/aio/_patch.py | 41 ++- .../ai/projects/aio/operations/_operations.py | 238 +++++----------- .../aio/operations/_patch_memories_async.py | 6 +- .../azure/ai/projects/models/__init__.py | 2 - .../azure/ai/projects/models/_enums.py | 4 +- .../azure/ai/projects/models/_models.py | 59 +--- .../ai/projects/operations/_operations.py | 257 +++++------------- .../ai/projects/operations/_patch_memories.py | 6 +- .../telemetry/_ai_project_instrumentor.py | 2 +- .../agents/sample_agent_structured_output.py | 4 +- .../sample_agent_structured_output_async.py | 4 +- ...valuations_builtin_with_inline_data_oai.py | 3 +- ...responses_basic_without_aiprojectclient.py | 3 +- ...ses_basic_without_aiprojectclient_async.py | 3 +- .../telemetry/test_ai_agents_instrumentor.py | 14 +- .../test_ai_agents_instrumentor_async.py | 14 +- .../tests/agents/test_agent_responses_crud.py | 4 +- .../agents/test_agent_responses_crud_async.py | 4 +- 21 files changed, 211 insertions(+), 499 deletions(-) diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 0cac8cb15095..17e88a5355f7 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -21,6 +21,7 @@ * Rename class `MicrosoftFabricAgentTool` to `MicrosoftFabricPreviewTool`. * Rename class `SharepointAgentTool` to `SharepointPreviewTool`. * Rename class `ItemParam` to `InputItem`. +* Rename class `PromptAgentDefinitionText` to `PromptAgentDefinitionTextOptions` * Tracing: workflow actions in conversation item listings are now emitted as "gen_ai.conversation.item" events (with role="workflow") instead of "gen_ai.workflow.action" events in the list_conversation_items span. * Tracing: response generation span names changed from "responses {model_name}" to "chat {model_name}" for model calls and from "responses {agent_name}" to "invoke_agent {agent_name}" for agent calls. diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index bd38ab31572c..dbfee8e01162 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -13,7 +13,6 @@ "azure.ai.projects.models.AgenticIdentityPreviewCredentials": "Azure.AI.Projects.AgenticIdentityPreviewCredentials", "azure.ai.projects.models.AgentObjectVersions": "Azure.AI.Projects.AgentObject.versions.anonymous", "azure.ai.projects.models.AgentReference": "Azure.AI.Projects.AgentReference", - "azure.ai.projects.models.AgentsPagedResultAgentObject": "Azure.AI.Projects.AgentsPagedResult", "azure.ai.projects.models.EvaluationTaxonomyInput": "Azure.AI.Projects.EvaluationTaxonomyInput", "azure.ai.projects.models.AgentTaxonomyInput": "Azure.AI.Projects.AgentTaxonomyInput", "azure.ai.projects.models.AgentVersionDetails": "Azure.AI.Projects.AgentVersionObject", 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 a6902daaafa6..abe4ae47086d 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_patch.py @@ -26,43 +26,39 @@ class AIProjectClient(AIProjectClientGenerated): # pylint: disable=too-many-ins :ivar agents: AgentsOperations operations :vartype agents: azure.ai.projects.operations.AgentsOperations - :ivar memory_stores: MemoryStoresOperations operations - :vartype memory_stores: azure.ai.projects.operations.MemoryStoresOperations :ivar connections: ConnectionsOperations operations :vartype connections: azure.ai.projects.operations.ConnectionsOperations :ivar datasets: DatasetsOperations operations :vartype datasets: azure.ai.projects.operations.DatasetsOperations - :ivar indexes: IndexesOperations operations - :vartype indexes: azure.ai.projects.operations.IndexesOperations :ivar deployments: DeploymentsOperations operations :vartype deployments: azure.ai.projects.operations.DeploymentsOperations - :ivar red_teams: RedTeamsOperations operations - :vartype red_teams: azure.ai.projects.operations.RedTeamsOperations - :ivar evaluation_rules: EvaluationRulesOperations operations - :vartype evaluation_rules: azure.ai.projects.operations.EvaluationRulesOperations :ivar evaluation_taxonomies: EvaluationTaxonomiesOperations operations :vartype evaluation_taxonomies: azure.ai.projects.operations.EvaluationTaxonomiesOperations + :ivar evaluation_rules: EvaluationRulesOperations operations + :vartype evaluation_rules: azure.ai.projects.operations.EvaluationRulesOperations :ivar evaluators: EvaluatorsOperations operations :vartype evaluators: azure.ai.projects.operations.EvaluatorsOperations + :ivar indexes: IndexesOperations operations + :vartype indexes: azure.ai.projects.operations.IndexesOperations :ivar insights: InsightsOperations operations :vartype insights: azure.ai.projects.operations.InsightsOperations + :ivar memory_stores: MemoryStoresOperations operations + :vartype memory_stores: azure.ai.projects.operations.MemoryStoresOperations + :ivar red_teams: RedTeamsOperations operations + :vartype red_teams: azure.ai.projects.operations.RedTeamsOperations :ivar schedules: SchedulesOperations operations :vartype schedules: azure.ai.projects.operations.SchedulesOperations :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. + "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. Default value is - "2025-11-15-preview". Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Default value is "v1". Note + that overriding this default value may result in unsupported behavior. :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :keyword user_agent: Optional string identifying the caller. This string will show up at the front of the "User-Agent" HTTP request header in all network calls this client makes. If an OpenAI client was obtained by calling get_openai_client(), this string will also show up at the front of the "User-Agent" request header in network calls that OpenAI client makes. """ def __init__(self, endpoint: str, credential: TokenCredential, **kwargs: Any) -> None: @@ -102,8 +98,7 @@ def get_openai_client(self, **kwargs: Any) -> "OpenAI": # type: ignore[name-def The OpenAI client constructor is called with: - * ``base_url`` set to the endpoint provided to the AIProjectClient constructor, with "/openai" appended. - * ``api-version`` set to "2025-05-15-preview" by default, unless overridden by the ``api_version`` keyword argument. + * ``base_url`` set to the endpoint provided to the AIProjectClient constructor, with "/openai/v1" appended. * ``api_key`` set to a get_bearer_token_provider() callable that uses the TokenCredential provided to the AIProjectClient constructor, with scope "https://ai.azure.com/.default". .. note:: The packages ``openai`` and ``azure.identity`` must be installed prior to calling this method. @@ -116,10 +111,7 @@ def get_openai_client(self, **kwargs: Any) -> "OpenAI": # type: ignore[name-def :raises ~azure.core.exceptions.HttpResponseError: """ - base_url = self._config.endpoint.rstrip("/") + "/openai" # pylint: disable=protected-access - - if "default_query" not in kwargs: - kwargs["default_query"] = {"api-version": "2025-11-15-preview"} + base_url = self._config.endpoint.rstrip("/") + "/openai/v1" # pylint: disable=protected-access logger.debug( # pylint: disable=specify-parameter-names-in-call "[get_openai_client] Creating OpenAI client using Entra ID authentication, base_url = `%s`", # pylint: disable=line-too-long 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 4a9f2d6ca489..e9d163cff7e4 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 @@ -26,44 +26,39 @@ class AIProjectClient(AIProjectClientGenerated): # pylint: disable=too-many-ins :ivar agents: AgentsOperations operations :vartype agents: azure.ai.projects.aio.operations.AgentsOperations - :ivar memory_stores: MemoryStoresOperations operations - :vartype memory_stores: azure.ai.projects.aio.operations.MemoryStoresOperations :ivar connections: ConnectionsOperations operations :vartype connections: azure.ai.projects.aio.operations.ConnectionsOperations :ivar datasets: DatasetsOperations operations :vartype datasets: azure.ai.projects.aio.operations.DatasetsOperations - :ivar indexes: IndexesOperations operations - :vartype indexes: azure.ai.projects.aio.operations.IndexesOperations :ivar deployments: DeploymentsOperations operations :vartype deployments: azure.ai.projects.aio.operations.DeploymentsOperations - :ivar red_teams: RedTeamsOperations operations - :vartype red_teams: azure.ai.projects.aio.operations.RedTeamsOperations - :ivar evaluation_rules: EvaluationRulesOperations operations - :vartype evaluation_rules: azure.ai.projects.aio.operations.EvaluationRulesOperations :ivar evaluation_taxonomies: EvaluationTaxonomiesOperations operations :vartype evaluation_taxonomies: azure.ai.projects.aio.operations.EvaluationTaxonomiesOperations + :ivar evaluation_rules: EvaluationRulesOperations operations + :vartype evaluation_rules: azure.ai.projects.aio.operations.EvaluationRulesOperations :ivar evaluators: EvaluatorsOperations operations :vartype evaluators: azure.ai.projects.aio.operations.EvaluatorsOperations + :ivar indexes: IndexesOperations operations + :vartype indexes: azure.ai.projects.aio.operations.IndexesOperations :ivar insights: InsightsOperations operations :vartype insights: azure.ai.projects.aio.operations.InsightsOperations + :ivar memory_stores: MemoryStoresOperations operations + :vartype memory_stores: azure.ai.projects.aio.operations.MemoryStoresOperations + :ivar red_teams: RedTeamsOperations operations + :vartype red_teams: azure.ai.projects.aio.operations.RedTeamsOperations :ivar schedules: SchedulesOperations operations :vartype schedules: azure.ai.projects.aio.operations.SchedulesOperations :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. + "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. Default value is - "2025-11-15-preview". Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Default value is "v1". Note + that overriding this default value may result in unsupported behavior. :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :keyword user_agent: Optional string identifying the caller. This string will show up at the front of the "User-Agent" HTTP request header in all network calls this client makes. If an OpenAI client was obtained by calling get_openai_client(), this string will also show up at the front of the "User-Agent" request header in network calls that OpenAI client makes. - :meth:`get_openai_client`. """ def __init__(self, endpoint: str, credential: AsyncTokenCredential, **kwargs: Any) -> None: @@ -103,8 +98,7 @@ def get_openai_client(self, **kwargs: Any) -> "AsyncOpenAI": # type: ignore[nam The AsyncOpenAI client constructor is called with: - * ``base_url`` set to the endpoint provided to the AIProjectClient constructor, with "/openai" appended. - * ``api-version`` set to "2025-05-15-preview" by default, unless overridden by the ``api_version`` keyword argument. + * ``base_url`` set to the endpoint provided to the AIProjectClient constructor, with "/openai/v1" appended. * ``api_key`` set to a get_bearer_token_provider() callable that uses the TokenCredential provided to the AIProjectClient constructor, with scope "https://ai.azure.com/.default". .. note:: The packages ``openai`` and ``azure.identity`` must be installed prior to calling this method. @@ -117,10 +111,7 @@ def get_openai_client(self, **kwargs: Any) -> "AsyncOpenAI": # type: ignore[nam :raises ~azure.core.exceptions.HttpResponseError: """ - base_url = self._config.endpoint.rstrip("/") + "/openai" # pylint: disable=protected-access - - if "default_query" not in kwargs: - kwargs["default_query"] = {"api-version": "2025-11-15-preview"} + base_url = self._config.endpoint.rstrip("/") + "/openai/v1" # pylint: disable=protected-access logger.debug( # pylint: disable=specify-parameter-names-in-call "[get_openai_client] Creating OpenAI client using Entra ID authentication, base_url = `%s`", # pylint: disable=line-too-long 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 9bfc4afc7bc3..1c70bca2abbf 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 @@ -204,7 +204,6 @@ async def create( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, content_type: str = "application/json", @@ -228,12 +227,10 @@ async def create( modifying persisted preview resources. Is one of the following types: Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or - ~azure.ai.projects.models.MEMORY_STORES_V1 + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -261,7 +258,6 @@ async def create( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, content_type: str = "application/json", @@ -275,12 +271,10 @@ async def create( modifying persisted preview resources. Is one of the following types: Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or - ~azure.ai.projects.models.MEMORY_STORES_V1 + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -299,7 +293,6 @@ async def create( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, content_type: str = "application/json", @@ -313,12 +306,10 @@ async def create( modifying persisted preview resources. Is one of the following types: Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or - ~azure.ai.projects.models.MEMORY_STORES_V1 + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -339,7 +330,6 @@ async def create( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, metadata: Optional[dict[str, str]] = None, @@ -364,12 +354,10 @@ async def create( modifying persisted preview resources. Is one of the following types: Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or - ~azure.ai.projects.models.MEMORY_STORES_V1 + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 :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. @@ -460,7 +448,6 @@ async def update( agent_name: str, *, definition: _models.AgentDefinition, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, @@ -474,9 +461,6 @@ async def update( :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 foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -496,13 +480,7 @@ async def update( @overload async def update( - self, - agent_name: str, - body: JSON, - *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentDetails: """Updates the agent by adding a new version if there are any changes to the agent definition. If no changes, returns the existing agent version. @@ -511,9 +489,6 @@ async def update( :type agent_name: str :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -524,13 +499,7 @@ async def update( @overload async def update( - self, - agent_name: str, - body: IO[bytes], - *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentDetails: """Updates the agent by adding a new version if there are any changes to the agent definition. If no changes, returns the existing agent version. @@ -539,9 +508,6 @@ async def update( :type agent_name: str :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -557,7 +523,6 @@ async def update( body: Union[JSON, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any @@ -572,9 +537,6 @@ async def update( :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 foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :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. @@ -616,7 +578,6 @@ async def update( _request = build_agents_update_request( agent_name=agent_name, - foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -912,7 +873,6 @@ async def update_from_manifest( *, manifest_id: str, parameter_values: dict[str, Any], - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, @@ -928,9 +888,6 @@ async def update_from_manifest( :keyword parameter_values: The inputs to the manifest that will result in a fully materialized Agent. Required. :paramtype parameter_values: dict[str, any] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -950,13 +907,7 @@ async def update_from_manifest( @overload async def update_from_manifest( - self, - agent_name: str, - body: JSON, - *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentDetails: """Updates the agent from a manifest by adding a new version if there are any changes to the agent definition. If no changes, returns the existing agent version. @@ -965,9 +916,6 @@ async def update_from_manifest( :type agent_name: str :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -978,13 +926,7 @@ async def update_from_manifest( @overload async def update_from_manifest( - self, - agent_name: str, - body: IO[bytes], - *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentDetails: """Updates the agent from a manifest by adding a new version if there are any changes to the agent definition. If no changes, returns the existing agent version. @@ -993,9 +935,6 @@ async def update_from_manifest( :type agent_name: str :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1012,7 +951,6 @@ async def update_from_manifest( *, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any @@ -1029,9 +967,6 @@ async def update_from_manifest( :keyword parameter_values: The inputs to the manifest that will result in a fully materialized Agent. Required. :paramtype parameter_values: dict[str, any] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :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. @@ -1080,7 +1015,6 @@ async def update_from_manifest( _request = build_agents_update_from_manifest_request( agent_name=agent_name, - foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -1123,27 +1057,11 @@ async def update_from_manifest( return deserialized # type: ignore @distributed_trace_async - async def delete( - self, - agent_name: str, - *, - foundry_beta: Optional[ - Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] - ] - ] = None, - **kwargs: Any - ) -> _models.DeleteAgentResponse: + async def delete(self, agent_name: str, **kwargs: Any) -> _models.DeleteAgentResponse: """Deletes an agent. :param agent_name: The name of the agent to delete. Required. :type agent_name: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is either a - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 :return: DeleteAgentResponse. The DeleteAgentResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DeleteAgentResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -1163,7 +1081,6 @@ async def delete( _request = build_agents_delete_request( agent_name=agent_name, - foundry_beta=foundry_beta, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1203,17 +1120,16 @@ async def delete( return deserialized # type: ignore - @distributed_trace_async - async def list( + @distributed_trace + def list( self, *, kind: Optional[Union[str, _models.AgentKind]] = None, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any - ) -> _models.AgentsPagedResultAgentObject: + ) -> AsyncItemPaged["_models.AgentDetails"]: """Returns the list of all agents. :keyword kind: Filter agents by kind. If not provided, all agents are returned. Known values @@ -1227,23 +1143,21 @@ async 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: A cursor for use in pagination. ``after`` 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 after=obj_foo in order to fetch the next page of the list. Default - value is None. - :paramtype after: str :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: AgentsPagedResultAgentObject. The AgentsPagedResultAgentObject is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.AgentsPagedResultAgentObject + :return: An iterator like instance of AgentDetails + :rtype: ~azure.core.async_paging.AsyncItemPaged[~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, @@ -1252,55 +1166,51 @@ async def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.AgentsPagedResultAgentObject] = kwargs.pop("cls", None) + def prepare_request(_continuation_token=None): - _request = build_agents_list_request( - kind=kind, - limit=limit, - order=order, - after=after, - 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) + _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 - _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.AgentDetails], 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() - else: - deserialized = _deserialize(_models.AgentsPagedResultAgentObject, 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 AsyncItemPaged(get_next, extract_data) @overload async def create_version( @@ -1313,7 +1223,6 @@ async def create_version( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, content_type: str = "application/json", @@ -1337,12 +1246,10 @@ async def create_version( modifying persisted preview resources. Is one of the following types: Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or - ~azure.ai.projects.models.MEMORY_STORES_V1 + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1371,7 +1278,6 @@ async def create_version( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, content_type: str = "application/json", @@ -1392,12 +1298,10 @@ async def create_version( modifying persisted preview resources. Is one of the following types: Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or - ~azure.ai.projects.models.MEMORY_STORES_V1 + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1417,7 +1321,6 @@ async def create_version( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, content_type: str = "application/json", @@ -1438,12 +1341,10 @@ async def create_version( modifying persisted preview resources. Is one of the following types: Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or - ~azure.ai.projects.models.MEMORY_STORES_V1 + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -1464,7 +1365,6 @@ async def create_version( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, metadata: Optional[dict[str, str]] = None, @@ -1489,12 +1389,10 @@ async def create_version( modifying persisted preview resources. Is one of the following types: Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or - ~azure.ai.projects.models.MEMORY_STORES_V1 + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 :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. 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 4f1343541de5..f5e10b01c4bc 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 @@ -109,9 +109,9 @@ async def begin_update_memories( @distributed_trace_async @api_version_validation( - method_added_on="2025-11-15-preview", - params_added_on={"2025-11-15-preview": ["api_version", "name", "content_type", "accept"]}, - api_versions_list=["2025-11-15-preview"], + method_added_on="v1", + params_added_on={"v1": ["api_version", "name", "content_type", "accept"]}, + api_versions_list=["v1"], ) async def begin_update_memories( self, 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 6e80777a20ed..342360a55764 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 @@ -25,7 +25,6 @@ AgentTaxonomyInput, AgentVersionDetails, AgenticIdentityPreviewCredentials, - AgentsPagedResultAgentObject, Annotation, ApiErrorResponse, ApiKeyCredentials, @@ -422,7 +421,6 @@ "AgentTaxonomyInput", "AgentVersionDetails", "AgenticIdentityPreviewCredentials", - "AgentsPagedResultAgentObject", "Annotation", "ApiErrorResponse", "ApiKeyCredentials", 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 46424a3df6fc..ac757d285013 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 @@ -685,8 +685,8 @@ class ItemResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """STRUCTURED_OUTPUTS.""" OAUTH_CONSENT_REQUEST = "oauth_consent_request" """OAUTH_CONSENT_REQUEST.""" - MEMORY_SEARCH_PREVIEW_CALL = "memory_search_preview_call" - """MEMORY_SEARCH_PREVIEW_CALL.""" + MEMORY_SEARCH_CALL = "memory_search_call" + """MEMORY_SEARCH_CALL.""" WORKFLOW_PREVIEW_ACTION = "workflow_preview_action" """WORKFLOW_PREVIEW_ACTION.""" 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 b9cf4ff29817..9bd3ccd9367e 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 @@ -500,51 +500,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["agent_reference"] = "agent_reference" -class AgentsPagedResultAgentObject(_Model): - """The response data for a requested list of items. - - :ivar data: The requested list of items. Required. - :vartype data: list[~azure.ai.projects.models.AgentDetails] - :ivar first_id: The first ID represented in this list. - :vartype first_id: str - :ivar last_id: The last ID represented in this list. - :vartype last_id: str - :ivar has_more: A value indicating whether there are additional values available not captured - in this list. Required. - :vartype has_more: bool - """ - - data: list["_models.AgentDetails"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The requested list of items. Required.""" - first_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The first ID represented in this list.""" - last_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The last ID represented in this list.""" - has_more: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A value indicating whether there are additional values available not captured in this list. - Required.""" - - @overload - def __init__( - self, - *, - data: list["_models.AgentDetails"], - has_more: bool, - first_id: Optional[str] = None, - last_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 EvaluationTaxonomyInput(_Model): """Input configuration for the evaluation taxonomy. @@ -7885,7 +7840,7 @@ class ItemResource(_Model): "function_call_output", "image_generation_call", "code_interpreter_call", "local_shell_call", "local_shell_call_output", "shell_call", "shell_call_output", "apply_patch_call", "apply_patch_call_output", "mcp_list_tools", "mcp_approval_request", "mcp_approval_response", - "mcp_call", "structured_outputs", "oauth_consent_request", "memory_search_preview_call", and + "mcp_call", "structured_outputs", "oauth_consent_request", "memory_search_call", and "workflow_preview_action". :vartype type: str or ~azure.ai.projects.models.ItemResourceType :ivar agent_reference: The agent that created the item. @@ -7902,7 +7857,7 @@ class ItemResource(_Model): \"local_shell_call\", \"local_shell_call_output\", \"shell_call\", \"shell_call_output\", \"apply_patch_call\", \"apply_patch_call_output\", \"mcp_list_tools\", \"mcp_approval_request\", \"mcp_approval_response\", \"mcp_call\", \"structured_outputs\", - \"oauth_consent_request\", \"memory_search_preview_call\", and \"workflow_preview_action\".""" + \"oauth_consent_request\", \"memory_search_call\", and \"workflow_preview_action\".""" agent_reference: Optional["_models.AgentReference"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -10171,8 +10126,8 @@ class MemorySearchToolCallItemResource(ItemResource, discriminator="memory_searc :vartype agent_reference: ~azure.ai.projects.models.AgentReference :ivar response_id: The response on which the item is created. :vartype response_id: str - :ivar type: Required. Default value is "memory_search_call". - :vartype type: str + :ivar type: Required. MEMORY_SEARCH_CALL. + :vartype type: str or ~azure.ai.projects.models.MEMORY_SEARCH_CALL :ivar status: The status of the memory search tool call. One of ``in_progress``, ``searching``, ``completed``, ``incomplete`` or ``failed``,. Required. Is one of the following types: Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["incomplete"], @@ -10182,8 +10137,8 @@ class MemorySearchToolCallItemResource(ItemResource, discriminator="memory_searc :vartype results: list[~azure.ai.projects.models.MemorySearchItem] """ - type: Literal["memory_search_call"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"memory_search_call\".""" + type: Literal[ItemResourceType.MEMORY_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. MEMORY_SEARCH_CALL.""" status: Literal["in_progress", "searching", "completed", "incomplete", "failed"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -10215,7 +10170,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "memory_search_call" # type: ignore + self.type = ItemResourceType.MEMORY_SEARCH_CALL # type: ignore class MemoryStoreDefinition(_Model): 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 dcda64b4245b..7454a3583ef0 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 @@ -80,7 +80,6 @@ def build_agents_create_request( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, **kwargs: Any @@ -108,9 +107,7 @@ def build_agents_create_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_update_request( - agent_name: str, *, foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, **kwargs: Any -) -> HttpRequest: +def build_agents_update_request(agent_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -130,8 +127,6 @@ def build_agents_update_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if foundry_beta is not None: - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -170,7 +165,7 @@ def build_agents_create_from_manifest_request( # pylint: disable=name-too-long def build_agents_update_from_manifest_request( # pylint: disable=name-too-long - agent_name: str, *, foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, **kwargs: Any + agent_name: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -191,8 +186,6 @@ def build_agents_update_from_manifest_request( # pylint: disable=name-too-long _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if foundry_beta is not None: - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -200,14 +193,7 @@ def build_agents_update_from_manifest_request( # pylint: disable=name-too-long return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_delete_request( - agent_name: str, - *, - foundry_beta: Optional[ - Union[Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1]] - ] = None, - **kwargs: Any -) -> HttpRequest: +def build_agents_delete_request(agent_name: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -226,8 +212,6 @@ def build_agents_delete_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if foundry_beta is not None: - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) @@ -278,7 +262,6 @@ def build_agents_create_version_request( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, **kwargs: Any @@ -1947,7 +1930,6 @@ def create( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, content_type: str = "application/json", @@ -1971,12 +1953,10 @@ def create( modifying persisted preview resources. Is one of the following types: Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or - ~azure.ai.projects.models.MEMORY_STORES_V1 + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2004,7 +1984,6 @@ def create( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, content_type: str = "application/json", @@ -2018,12 +1997,10 @@ def create( modifying persisted preview resources. Is one of the following types: Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or - ~azure.ai.projects.models.MEMORY_STORES_V1 + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2042,7 +2019,6 @@ def create( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, content_type: str = "application/json", @@ -2056,12 +2032,10 @@ def create( modifying persisted preview resources. Is one of the following types: Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or - ~azure.ai.projects.models.MEMORY_STORES_V1 + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -2082,7 +2056,6 @@ def create( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, metadata: Optional[dict[str, str]] = None, @@ -2107,12 +2080,10 @@ def create( modifying persisted preview resources. Is one of the following types: Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or - ~azure.ai.projects.models.MEMORY_STORES_V1 + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 :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. @@ -2203,7 +2174,6 @@ def update( agent_name: str, *, definition: _models.AgentDefinition, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, @@ -2217,9 +2187,6 @@ def update( :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 foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2239,13 +2206,7 @@ def update( @overload def update( - self, - agent_name: str, - body: JSON, - *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentDetails: """Updates the agent by adding a new version if there are any changes to the agent definition. If no changes, returns the existing agent version. @@ -2254,9 +2215,6 @@ def update( :type agent_name: str :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2267,13 +2225,7 @@ def update( @overload def update( - self, - agent_name: str, - body: IO[bytes], - *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentDetails: """Updates the agent by adding a new version if there are any changes to the agent definition. If no changes, returns the existing agent version. @@ -2282,9 +2234,6 @@ def update( :type agent_name: str :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -2300,7 +2249,6 @@ def update( body: Union[JSON, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any @@ -2315,9 +2263,6 @@ def update( :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 foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :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. @@ -2359,7 +2304,6 @@ def update( _request = build_agents_update_request( agent_name=agent_name, - foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -2655,7 +2599,6 @@ def update_from_manifest( *, manifest_id: str, parameter_values: dict[str, Any], - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, @@ -2671,9 +2614,6 @@ def update_from_manifest( :keyword parameter_values: The inputs to the manifest that will result in a fully materialized Agent. Required. :paramtype parameter_values: dict[str, any] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2693,13 +2633,7 @@ def update_from_manifest( @overload def update_from_manifest( - self, - agent_name: str, - body: JSON, - *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentDetails: """Updates the agent from a manifest by adding a new version if there are any changes to the agent definition. If no changes, returns the existing agent version. @@ -2708,9 +2642,6 @@ def update_from_manifest( :type agent_name: str :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2721,13 +2652,7 @@ def update_from_manifest( @overload def update_from_manifest( - self, - agent_name: str, - body: IO[bytes], - *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, - content_type: str = "application/json", - **kwargs: Any + self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentDetails: """Updates the agent from a manifest by adding a new version if there are any changes to the agent definition. If no changes, returns the existing agent version. @@ -2736,9 +2661,6 @@ def update_from_manifest( :type agent_name: str :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -2755,7 +2677,6 @@ def update_from_manifest( *, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1]] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any @@ -2772,9 +2693,6 @@ def update_from_manifest( :keyword parameter_values: The inputs to the manifest that will result in a fully materialized Agent. Required. :paramtype parameter_values: dict[str, any] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 :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. @@ -2823,7 +2741,6 @@ def update_from_manifest( _request = build_agents_update_from_manifest_request( agent_name=agent_name, - foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -2866,27 +2783,11 @@ def update_from_manifest( return deserialized # type: ignore @distributed_trace - def delete( - self, - agent_name: str, - *, - foundry_beta: Optional[ - Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] - ] - ] = None, - **kwargs: Any - ) -> _models.DeleteAgentResponse: + def delete(self, agent_name: str, **kwargs: Any) -> _models.DeleteAgentResponse: """Deletes an agent. :param agent_name: The name of the agent to delete. Required. :type agent_name: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is either a - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 :return: DeleteAgentResponse. The DeleteAgentResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DeleteAgentResponse :raises ~azure.core.exceptions.HttpResponseError: @@ -2906,7 +2807,6 @@ def delete( _request = build_agents_delete_request( agent_name=agent_name, - foundry_beta=foundry_beta, api_version=self._config.api_version, headers=_headers, params=_params, @@ -2953,10 +2853,9 @@ def list( kind: Optional[Union[str, _models.AgentKind]] = None, limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, - after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any - ) -> _models.AgentsPagedResultAgentObject: + ) -> ItemPaged["_models.AgentDetails"]: """Returns the list of all agents. :keyword kind: Filter agents by kind. If not provided, all agents are returned. Known values @@ -2970,23 +2869,21 @@ 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: A cursor for use in pagination. ``after`` 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 after=obj_foo in order to fetch the next page of the list. Default - value is None. - :paramtype after: str :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: AgentsPagedResultAgentObject. The AgentsPagedResultAgentObject is compatible with - MutableMapping - :rtype: ~azure.ai.projects.models.AgentsPagedResultAgentObject + :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, @@ -2995,55 +2892,51 @@ def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.AgentsPagedResultAgentObject] = kwargs.pop("cls", None) + def prepare_request(_continuation_token=None): - _request = build_agents_list_request( - kind=kind, - limit=limit, - order=order, - after=after, - 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) + _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 - _stream = kwargs.pop("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.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) - 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 = pipeline_response.http_response - if _stream: - deserialized = response.iter_bytes() - else: - deserialized = _deserialize(_models.AgentsPagedResultAgentObject, 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) @overload def create_version( @@ -3056,7 +2949,6 @@ def create_version( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, content_type: str = "application/json", @@ -3080,12 +2972,10 @@ def create_version( modifying persisted preview resources. Is one of the following types: Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or - ~azure.ai.projects.models.MEMORY_STORES_V1 + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3114,7 +3004,6 @@ def create_version( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, content_type: str = "application/json", @@ -3135,12 +3024,10 @@ def create_version( modifying persisted preview resources. Is one of the following types: Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or - ~azure.ai.projects.models.MEMORY_STORES_V1 + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3160,7 +3047,6 @@ def create_version( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, content_type: str = "application/json", @@ -3181,12 +3067,10 @@ def create_version( modifying persisted preview resources. Is one of the following types: Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or - ~azure.ai.projects.models.MEMORY_STORES_V1 + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -3207,7 +3091,6 @@ def create_version( Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], ] ] = None, metadata: Optional[dict[str, str]] = None, @@ -3232,12 +3115,10 @@ def create_version( modifying persisted preview resources. Is one of the following types: Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1] Default value is None. + Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 or str or - ~azure.ai.projects.models.MEMORY_STORES_V1 + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 :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. 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 ca25e90aa008..b88312d13b2e 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 @@ -109,9 +109,9 @@ def begin_update_memories( @distributed_trace @api_version_validation( - method_added_on="2025-11-15-preview", - params_added_on={"2025-11-15-preview": ["api_version", "name", "content_type", "accept"]}, - api_versions_list=["2025-11-15-preview"], + method_added_on="v1", + params_added_on={"v1": ["api_version", "name", "content_type", "accept"]}, + api_versions_list=["v1"], ) def begin_update_memories( self, diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/telemetry/_ai_project_instrumentor.py b/sdk/ai/azure-ai-projects/azure/ai/projects/telemetry/_ai_project_instrumentor.py index ba9a5da65c3a..54e446f85c5f 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/telemetry/_ai_project_instrumentor.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/telemetry/_ai_project_instrumentor.py @@ -744,7 +744,7 @@ def _create_agent_span_from_parameters( if text: # Handle different types of text objects if hasattr(text, "format"): - # Azure AI Agents PromptAgentDefinitionText model object + # Azure AI Agents PromptAgentDefinitionTextOptions model object format_info = getattr(text, "format", None) if format_info: if hasattr(format_info, "type"): diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_structured_output.py b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_structured_output.py index 844f89fcb3c2..378d37d29b42 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_structured_output.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_structured_output.py @@ -37,7 +37,7 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( PromptAgentDefinition, - PromptAgentDefinitionText, + PromptAgentDefinitionTextOptions, TextResponseFormatJsonSchema, ) from pydantic import BaseModel, Field @@ -64,7 +64,7 @@ class CalendarEvent(BaseModel): agent_name="MyAgent", definition=PromptAgentDefinition( model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"], - text=PromptAgentDefinitionText( + text=PromptAgentDefinitionTextOptions( format=TextResponseFormatJsonSchema(name="CalendarEvent", schema=CalendarEvent.model_json_schema()) ), instructions=""" diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_structured_output_async.py b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_structured_output_async.py index 8571cc8e07a2..c5be9c79a436 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_structured_output_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_structured_output_async.py @@ -38,7 +38,7 @@ from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( PromptAgentDefinition, - PromptAgentDefinitionText, + PromptAgentDefinitionTextOptions, TextResponseFormatJsonSchema, ) from pydantic import BaseModel, Field @@ -65,7 +65,7 @@ async def main() -> None: agent_name="MyAgent", definition=PromptAgentDefinition( model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"], - text=PromptAgentDefinitionText( + text=PromptAgentDefinitionTextOptions( format=TextResponseFormatJsonSchema(name="CalendarEvent", schema=CalendarEvent.model_json_schema()) ), instructions=""" diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_builtin_with_inline_data_oai.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_builtin_with_inline_data_oai.py index ef8a44ba47d4..f69a7c8d19b4 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_builtin_with_inline_data_oai.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluations_builtin_with_inline_data_oai.py @@ -43,8 +43,7 @@ client = OpenAI( api_key=get_bearer_token_provider(DefaultAzureCredential(), "https://ai.azure.com/.default"), - base_url=os.environ["AZURE_AI_PROJECT_ENDPOINT"].rstrip("/") + "/openai", - default_query={"api-version": "2025-11-15-preview"}, + base_url=os.environ["AZURE_AI_PROJECT_ENDPOINT"].rstrip("/") + "/openai/v1", ) model_deployment_name = os.environ.get("AZURE_AI_MODEL_DEPLOYMENT_NAME", "") # Sample : gpt-4o-mini diff --git a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic_without_aiprojectclient.py b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic_without_aiprojectclient.py index 12ca5a99fe68..9c5d8b656bd7 100644 --- a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic_without_aiprojectclient.py +++ b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic_without_aiprojectclient.py @@ -34,8 +34,7 @@ openai = OpenAI( api_key=get_bearer_token_provider(DefaultAzureCredential(), "https://ai.azure.com/.default"), - base_url=os.environ["AZURE_AI_PROJECT_ENDPOINT"].rstrip("/") + "/openai", - default_query={"api-version": "2025-11-15-preview"}, + base_url=os.environ["AZURE_AI_PROJECT_ENDPOINT"].rstrip("/") + "/openai/v1", ) response = openai.responses.create( diff --git a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic_without_aiprojectclient_async.py b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic_without_aiprojectclient_async.py index 4eb408389364..8a2934ff7418 100644 --- a/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic_without_aiprojectclient_async.py +++ b/sdk/ai/azure-ai-projects/samples/responses/sample_responses_basic_without_aiprojectclient_async.py @@ -42,8 +42,7 @@ async def main() -> None: openai = AsyncOpenAI( api_key=get_bearer_token_provider(credential, "https://ai.azure.com/.default"), - base_url=os.environ["AZURE_AI_PROJECT_ENDPOINT"].rstrip("/") + "/openai", - default_query={"api-version": "2025-11-15-preview"}, + base_url=os.environ["AZURE_AI_PROJECT_ENDPOINT"].rstrip("/") + "/openai/v1", ) async with openai: diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor.py index fe1f1ae1c27b..8a28ad4c797a 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor.py @@ -10,7 +10,7 @@ from azure.ai.projects.telemetry import AIProjectInstrumentor, _utils from azure.core.settings import settings from gen_ai_trace_verifier import GenAiTraceVerifier -from azure.ai.projects.models import PromptAgentDefinition, PromptAgentDefinitionText +from azure.ai.projects.models import PromptAgentDefinition, PromptAgentDefinitionTextOptions from azure.ai.projects.models import ( Reasoning, @@ -231,7 +231,7 @@ def test_agent_creation_with_tracing_content_recording_enabled(self, **kwargs): # ), # ], # # Text response configuration - # text=PromptAgentDefinitionText(format=ResponseTextFormatConfigurationText()), + # text=PromptAgentDefinitionTextOptions(format=ResponseTextFormatConfigurationText()), ) agent = project_client.agents.create_version(agent_name="myagent", definition=agent_definition) @@ -323,7 +323,7 @@ def test_agent_creation_with_tracing_content_recording_disabled(self, **kwargs): # ), # ], # Text response configuration - # text=PromptAgentDefinitionText(format=ResponseTextFormatConfigurationText()), + # text=PromptAgentDefinitionTextOptions(format=ResponseTextFormatConfigurationText()), ) agent = project_client.agents.create_version(agent_name="myagent", definition=agent_definition) @@ -535,7 +535,7 @@ def test_agent_with_structured_output_with_instructions_content_recording_enable agent_definition = PromptAgentDefinition( model=model, instructions="You are a helpful assistant that extracts person information.", - text=PromptAgentDefinitionText( + text=PromptAgentDefinitionTextOptions( format=TextResponseFormatJsonSchema( name="PersonInfo", schema=test_schema, @@ -621,7 +621,7 @@ def test_agent_with_structured_output_with_instructions_content_recording_disabl agent_definition = PromptAgentDefinition( model=model, instructions="You are a helpful assistant that extracts person information.", - text=PromptAgentDefinitionText( + text=PromptAgentDefinitionTextOptions( format=TextResponseFormatJsonSchema( name="PersonInfo", schema=test_schema, @@ -694,7 +694,7 @@ def test_agent_with_structured_output_without_instructions_content_recording_ena agent_definition = PromptAgentDefinition( model=model, # No instructions provided - text=PromptAgentDefinitionText( + text=PromptAgentDefinitionTextOptions( format=TextResponseFormatJsonSchema( name="Result", schema=test_schema, @@ -776,7 +776,7 @@ def test_agent_with_structured_output_without_instructions_content_recording_dis agent_definition = PromptAgentDefinition( model=model, # No instructions provided - text=PromptAgentDefinitionText( + text=PromptAgentDefinitionTextOptions( format=TextResponseFormatJsonSchema( name="Result", schema=test_schema, diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor_async.py index 39c878fd889c..cb45d12c36bf 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor_async.py @@ -9,7 +9,7 @@ from azure.ai.projects.telemetry import AIProjectInstrumentor, _utils from azure.core.settings import settings from gen_ai_trace_verifier import GenAiTraceVerifier -from azure.ai.projects.models import PromptAgentDefinition, PromptAgentDefinitionText +from azure.ai.projects.models import PromptAgentDefinition, PromptAgentDefinitionTextOptions from azure.ai.projects.models import ( Reasoning, FunctionTool, @@ -111,7 +111,7 @@ async def test_create_agent_with_tracing_content_recording_enabled(self, **kwarg # ), # ], # # Text response configuration - # text=PromptAgentDefinitionText(format=ResponseTextFormatConfigurationText()), + # text=PromptAgentDefinitionTextOptions(format=ResponseTextFormatConfigurationText()), ) agent = await project_client.agents.create_version(agent_name="myagent", definition=agent_definition) @@ -204,7 +204,7 @@ async def test_agent_creation_with_tracing_content_recording_disabled(self, **kw # ), # ], # # Text response configuration - # text=PromptAgentDefinitionText(format=ResponseTextFormatConfigurationText()), + # text=PromptAgentDefinitionTextOptions(format=ResponseTextFormatConfigurationText()), ) agent = await project_client.agents.create_version(agent_name="myagent", definition=agent_definition) @@ -414,7 +414,7 @@ async def test_agent_with_structured_output_with_instructions_content_recording_ agent_definition = PromptAgentDefinition( model=model, instructions="You are a helpful assistant that extracts person information.", - text=PromptAgentDefinitionText( + text=PromptAgentDefinitionTextOptions( format=TextResponseFormatJsonSchema( name="PersonInfo", schema=test_schema, @@ -503,7 +503,7 @@ async def test_agent_with_structured_output_with_instructions_content_recording_ agent_definition = PromptAgentDefinition( model=model, instructions="You are a helpful assistant that extracts person information.", - text=PromptAgentDefinitionText( + text=PromptAgentDefinitionTextOptions( format=TextResponseFormatJsonSchema( name="PersonInfo", schema=test_schema, @@ -579,7 +579,7 @@ async def test_agent_with_structured_output_without_instructions_content_recordi agent_definition = PromptAgentDefinition( model=model, # No instructions provided - text=PromptAgentDefinitionText( + text=PromptAgentDefinitionTextOptions( format=TextResponseFormatJsonSchema( name="Result", schema=test_schema, @@ -662,7 +662,7 @@ async def test_agent_with_structured_output_without_instructions_content_recordi agent_definition = PromptAgentDefinition( model=model, # No instructions provided - text=PromptAgentDefinitionText( + text=PromptAgentDefinitionTextOptions( format=TextResponseFormatJsonSchema( name="Result", schema=test_schema, diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_agent_responses_crud.py b/sdk/ai/azure-ai-projects/tests/agents/test_agent_responses_crud.py index 98f4ada367df..db20f9024ed2 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_agent_responses_crud.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_agent_responses_crud.py @@ -11,7 +11,7 @@ from azure.ai.projects.models import ( PromptAgentDefinition, TextResponseFormatJsonSchema, - PromptAgentDefinitionText, + PromptAgentDefinitionTextOptions, ) @@ -175,7 +175,7 @@ class CalendarEvent(BaseModel): agent_name="MyAgent", definition=PromptAgentDefinition( model=model, - text=PromptAgentDefinitionText( + text=PromptAgentDefinitionTextOptions( format=TextResponseFormatJsonSchema(name="CalendarEvent", schema=CalendarEvent.model_json_schema()) ), instructions=""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_agent_responses_crud_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_agent_responses_crud_async.py index 9a73410e6821..7c5065752924 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_agent_responses_crud_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_agent_responses_crud_async.py @@ -12,7 +12,7 @@ from azure.ai.projects.models import ( PromptAgentDefinition, TextResponseFormatJsonSchema, - PromptAgentDefinitionText, + PromptAgentDefinitionTextOptions, ) @@ -148,7 +148,7 @@ class CalendarEvent(BaseModel): agent_name="MyAgent", definition=PromptAgentDefinition( model=model, - text=PromptAgentDefinitionText( + text=PromptAgentDefinitionTextOptions( format=TextResponseFormatJsonSchema( name="CalendarEvent", schema=CalendarEvent.model_json_schema() ) From 2e706018314dfeeab73a23454133156c97566850 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Mon, 2 Feb 2026 11:34:33 -0800 Subject: [PATCH 06/22] Add foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 to Memory Store calls --- .../tools/sample_agent_memory_search.py | 6 +++-- .../tools/sample_agent_memory_search_async.py | 10 +++++-- .../memories/sample_memory_advanced.py | 19 ++++++++++--- .../memories/sample_memory_advanced_async.py | 23 +++++++++++++--- .../samples/memories/sample_memory_basic.py | 17 +++++++++--- .../memories/sample_memory_basic_async.py | 21 ++++++++++++--- .../samples/memories/sample_memory_crud.py | 27 ++++++++++++++----- .../memories/sample_memory_crud_async.py | 27 ++++++++++++++----- .../agents/tools/test_agent_memory_search.py | 10 +++++-- .../tools/test_agent_memory_search_async.py | 10 +++++-- 10 files changed, 132 insertions(+), 38 deletions(-) diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search.py index b76dbf494693..1082694dacb0 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search.py @@ -41,6 +41,7 @@ from azure.core.exceptions import ResourceNotFoundError from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( + FoundryPreviewOptInKeys, MemoryStoreDefaultDefinition, MemorySearchPreviewTool, PromptAgentDefinition, @@ -60,7 +61,7 @@ # Delete memory store, if it already exists memory_store_name = "my_memory_store" try: - project_client.memory_stores.delete(memory_store_name) + project_client.memory_stores.delete(memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -77,6 +78,7 @@ name=memory_store_name, description="Example memory store for conversations", definition=definition, + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"Created memory store: {memory_store.name} ({memory_store.id}): {memory_store.description}") @@ -140,5 +142,5 @@ project_client.agents.delete_version(agent_name=agent.name, agent_version=agent.version) print("Agent deleted") - project_client.memory_stores.delete(memory_store.name) + project_client.memory_stores.delete(memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1) print("Memory store deleted") diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search_async.py index 3dce555f5f69..1bd4e59bbc8b 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search_async.py @@ -41,6 +41,7 @@ from azure.core.exceptions import ResourceNotFoundError from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( + FoundryPreviewOptInKeys, MemoryStoreDefaultDefinition, MemorySearchPreviewTool, PromptAgentDefinition, @@ -63,7 +64,9 @@ async def main() -> None: # Delete memory store, if it already exists memory_store_name = "my_memory_store" try: - await project_client.memory_stores.delete(memory_store_name) + await project_client.memory_stores.delete( + memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -80,6 +83,7 @@ async def main() -> None: name=memory_store_name, description="Example memory store for conversations", definition=definition, + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"Created memory store: {memory_store.name} ({memory_store.id}): {memory_store.description}") @@ -141,7 +145,9 @@ async def main() -> None: await project_client.agents.delete_version(agent_name=agent.name, agent_version=agent.version) print("Agent deleted") - await project_client.memory_stores.delete(memory_store.name) + await project_client.memory_stores.delete( + memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print("Memory store deleted") diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py index 5368936f1ef5..3dc04afeab9d 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py @@ -39,6 +39,7 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( EasyInputMessage, + FoundryPreviewOptInKeys, MemoryStoreDefaultDefinition, MemoryStoreDefaultOptions, MemorySearchOptions, @@ -56,7 +57,7 @@ # Delete memory store, if it already exists memory_store_name = "my_memory_store" try: - project_client.memory_stores.delete(memory_store_name) + project_client.memory_stores.delete(memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -76,6 +77,7 @@ name=memory_store_name, description="Example memory store for conversations", definition=definition, + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"Created memory store: {memory_store.name} ({memory_store.id}): {memory_store.description}") @@ -92,6 +94,7 @@ scope=scope, items=[user_message], # Pass conversation items that you want to add to memory update_delay=300, # Keep default inactivity delay before starting update + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"Scheduled memory update operation (Update ID: {update_poller.update_id}, Status: {update_poller.status()})") @@ -103,6 +106,7 @@ items=[new_message], previous_update_id=update_poller.update_id, # Extend from previous update ID update_delay=0, # Trigger update immediately without waiting for inactivity + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print( f"Scheduled memory update operation (Update ID: {new_update_poller.update_id}, Status: {new_update_poller.status()})" @@ -125,7 +129,11 @@ # Retrieve memories from the memory store query_message = EasyInputMessage(role="user", content="What are my morning coffee preferences?") search_response = project_client.memory_stores.search_memories( - name=memory_store.name, scope=scope, items=[query_message], options=MemorySearchOptions(max_memories=5) + name=memory_store.name, + scope=scope, + items=[query_message], + options=MemorySearchOptions(max_memories=5), + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"Found {len(search_response.memories)} memories") for memory in search_response.memories: @@ -142,15 +150,18 @@ items=[agent_message, followup_query], previous_search_id=search_response.search_id, options=MemorySearchOptions(max_memories=5), + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"Found {len(followup_search_response.memories)} memories") for memory in followup_search_response.memories: print(f" - Memory ID: {memory.memory_item.memory_id}, Content: {memory.memory_item.content}") # Delete memories for the current scope - project_client.memory_stores.delete_scope(name=memory_store.name, scope=scope) + project_client.memory_stores.delete_scope( + name=memory_store.name, scope=scope, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print(f"Deleted memories for scope '{scope}'") # Delete memory store - project_client.memory_stores.delete(memory_store.name) + project_client.memory_stores.delete(memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1) print(f"Deleted memory store `{memory_store.name}`") diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced_async.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced_async.py index 1eaeed6d6eec..766d62cd09a1 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced_async.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced_async.py @@ -40,6 +40,7 @@ from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( EasyInputMessage, + FoundryPreviewOptInKeys, MemoryStoreDefaultDefinition, MemoryStoreDefaultOptions, MemorySearchOptions, @@ -60,7 +61,9 @@ async def main() -> None: # Delete memory store, if it already exists memory_store_name = "my_memory_store" try: - await project_client.memory_stores.delete(memory_store_name) + await project_client.memory_stores.delete( + memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -80,6 +83,7 @@ async def main() -> None: name=memory_store_name, description="Example memory store for conversations", definition=definition, + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"Created memory store: {memory_store.name} ({memory_store.id}): {memory_store.description}") @@ -96,6 +100,7 @@ async def main() -> None: scope=scope, items=[user_message], # Pass conversation items that you want to add to memory update_delay=300, # Keep default inactivity delay before starting update + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print( f"Scheduled memory update operation (Update ID: {update_poller.update_id}, Status: {update_poller.status()})" @@ -109,6 +114,7 @@ async def main() -> None: items=[new_message], previous_update_id=update_poller.update_id, # Extend from previous update ID update_delay=0, # Trigger update immediately without waiting for inactivity + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print( f"Scheduled memory update operation (Update ID: {new_update_poller.update_id}, Status: {new_update_poller.status()})" @@ -131,7 +137,11 @@ async def main() -> None: # Retrieve memories from the memory store query_message = EasyInputMessage(role="user", content="What are my morning coffee preferences?") search_response = await project_client.memory_stores.search_memories( - name=memory_store.name, scope=scope, items=[query_message], options=MemorySearchOptions(max_memories=5) + name=memory_store.name, + scope=scope, + items=[query_message], + options=MemorySearchOptions(max_memories=5), + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"Found {len(search_response.memories)} memories") for memory in search_response.memories: @@ -148,17 +158,22 @@ async def main() -> None: items=[agent_message, followup_query], previous_search_id=search_response.search_id, options=MemorySearchOptions(max_memories=5), + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"Found {len(followup_search_response.memories)} memories") for memory in followup_search_response.memories: print(f" - Memory ID: {memory.memory_item.memory_id}, Content: {memory.memory_item.content}") # Delete memories for the current scope - await project_client.memory_stores.delete_scope(name=memory_store.name, scope=scope) + await project_client.memory_stores.delete_scope( + name=memory_store.name, scope=scope, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print(f"Deleted memories for scope '{scope}'") # Delete memory store - await project_client.memory_stores.delete(memory_store.name) + await project_client.memory_stores.delete( + memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print(f"Deleted memory store `{memory_store.name}`") diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py index 33bb33f5e613..f271b74da882 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py @@ -37,6 +37,7 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( EasyInputMessage, + FoundryPreviewOptInKeys, MemoryStoreDefaultDefinition, MemoryStoreDefaultOptions, MemorySearchOptions, @@ -54,7 +55,7 @@ # Delete memory store, if it already exists memory_store_name = "my_memory_store" try: - project_client.memory_stores.delete(memory_store_name) + project_client.memory_stores.delete(memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -71,6 +72,7 @@ name=memory_store_name, description="Example memory store for conversations", definition=definition, + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"Created memory store: {memory_store.name} ({memory_store.id}): {memory_store.description}") if isinstance(memory_store.definition, MemoryStoreDefaultDefinition): @@ -90,6 +92,7 @@ scope=scope, items=[user_message], # Pass conversation items that you want to add to memory update_delay=0, # Trigger update immediately without waiting for inactivity + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) # Wait for the update operation to complete, but can also fire and forget @@ -103,16 +106,22 @@ # Retrieve memories from the memory store query_message = EasyInputMessage(role="user", content="What are my coffee preferences?") search_response = project_client.memory_stores.search_memories( - name=memory_store.name, scope=scope, items=[query_message], options=MemorySearchOptions(max_memories=5) + name=memory_store.name, + scope=scope, + items=[query_message], + options=MemorySearchOptions(max_memories=5), + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"Found {len(search_response.memories)} memories") for memory in search_response.memories: print(f" - Memory ID: {memory.memory_item.memory_id}, Content: {memory.memory_item.content}") # Delete memories for a specific scope - project_client.memory_stores.delete_scope(name=memory_store.name, scope=scope) + project_client.memory_stores.delete_scope( + name=memory_store.name, scope=scope, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print(f"Deleted memories for scope '{scope}'") # Delete memory store - project_client.memory_stores.delete(memory_store.name) + project_client.memory_stores.delete(memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1) print(f"Deleted memory store `{memory_store.name}`") diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic_async.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic_async.py index f2aba5612750..11a120deb0a8 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic_async.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic_async.py @@ -39,6 +39,7 @@ from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( EasyInputMessage, + FoundryPreviewOptInKeys, MemoryStoreDefaultDefinition, MemoryStoreDefaultOptions, MemorySearchOptions, @@ -59,7 +60,9 @@ async def main() -> None: # Delete memory store, if it already exists memory_store_name = "my_memory_store" try: - await project_client.memory_stores.delete(memory_store_name) + await project_client.memory_stores.delete( + memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -76,6 +79,7 @@ async def main() -> None: name=memory_store_name, description="Example memory store for conversations", definition=definition, + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"Created memory store: {memory_store.name} ({memory_store.id}): {memory_store.description}") if isinstance(memory_store.definition, MemoryStoreDefaultDefinition): @@ -95,6 +99,7 @@ async def main() -> None: scope=scope, items=[user_message], # Pass conversation items that you want to add to memory update_delay=0, # Trigger update immediately without waiting for inactivity + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) # Wait for the update operation to complete, but can also fire and forget @@ -108,18 +113,26 @@ async def main() -> None: # Retrieve memories from the memory store query_message = EasyInputMessage(role="user", content="What are my coffee preferences?") search_response = await project_client.memory_stores.search_memories( - name=memory_store.name, scope=scope, items=[query_message], options=MemorySearchOptions(max_memories=5) + name=memory_store.name, + scope=scope, + items=[query_message], + options=MemorySearchOptions(max_memories=5), + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"Found {len(search_response.memories)} memories") for memory in search_response.memories: print(f" - Memory ID: {memory.memory_item.memory_id}, Content: {memory.memory_item.content}") # Delete memories for a specific scope - await project_client.memory_stores.delete_scope(name=memory_store.name, scope=scope) + await project_client.memory_stores.delete_scope( + name=memory_store.name, scope=scope, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print(f"Deleted memories for scope '{scope}'") # Delete memory store - await project_client.memory_stores.delete(memory_store.name) + await project_client.memory_stores.delete( + memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print(f"Deleted memory store `{memory_store.name}`") diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py index 63f9d4ffdbef..038690d8b561 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py @@ -33,7 +33,7 @@ from azure.core.exceptions import ResourceNotFoundError from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import MemoryStoreDefaultDefinition +from azure.ai.projects.models import FoundryPreviewOptInKeys, MemoryStoreDefaultDefinition load_dotenv() @@ -47,7 +47,7 @@ # Delete memory store, if it already exists memory_store_name = "my_memory_store" try: - project_client.memory_stores.delete(memory_store_name) + project_client.memory_stores.delete(memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -58,24 +58,37 @@ embedding_model=os.environ["MEMORY_STORE_EMBEDDING_MODEL_DEPLOYMENT_NAME"], ) memory_store = project_client.memory_stores.create( - name=memory_store_name, description="Example memory store for conversations", definition=definition + name=memory_store_name, + description="Example memory store for conversations", + definition=definition, + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"Created memory store: {memory_store.name} ({memory_store.id}): {memory_store.description}") # Get Memory Store - get_store = project_client.memory_stores.get(memory_store.name) + get_store = project_client.memory_stores.get( + memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print(f"Retrieved: {get_store.name} ({get_store.id}): {get_store.description}") # Update Memory Store - updated_store = project_client.memory_stores.update(name=memory_store.name, description="Updated description") + updated_store = project_client.memory_stores.update( + name=memory_store.name, + description="Updated description", + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + ) print(f"Updated: {updated_store.name} ({updated_store.id}): {updated_store.description}") # List Memory Store - memory_stores = list(project_client.memory_stores.list(limit=10)) + memory_stores = list( + project_client.memory_stores.list(limit=10, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1) + ) print(f"Found {len(memory_stores)} memory stores") for store in memory_stores: print(f" - {store.name} ({store.id}): {store.description}") # Delete Memory Store - delete_response = project_client.memory_stores.delete(memory_store.name) + delete_response = project_client.memory_stores.delete( + memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print(f"Deleted: {delete_response.deleted}") diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud_async.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud_async.py index 2517a580b3ab..ba10f820d59d 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud_async.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud_async.py @@ -34,7 +34,7 @@ from azure.core.exceptions import ResourceNotFoundError from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import MemoryStoreDefaultDefinition +from azure.ai.projects.models import FoundryPreviewOptInKeys, MemoryStoreDefaultDefinition load_dotenv() @@ -51,7 +51,9 @@ async def main() -> None: # Delete memory store, if it already exists memory_store_name = "my_memory_store" try: - await project_client.memory_stores.delete(memory_store_name) + await project_client.memory_stores.delete( + memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -62,30 +64,41 @@ async def main() -> None: embedding_model=os.environ["MEMORY_STORE_EMBEDDING_MODEL_DEPLOYMENT_NAME"], ) memory_store = await project_client.memory_stores.create( - name=memory_store_name, description="Example memory store for conversations", definition=definition + name=memory_store_name, + description="Example memory store for conversations", + definition=definition, + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"Created memory store: {memory_store.name} ({memory_store.id}): {memory_store.description}") # Get Memory Store - get_store = await project_client.memory_stores.get(memory_store.name) + get_store = await project_client.memory_stores.get( + memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print(f"Retrieved: {get_store.name} ({get_store.id}): {get_store.description}") # Update Memory Store updated_store = await project_client.memory_stores.update( - name=memory_store.name, description="Updated description" + name=memory_store.name, + description="Updated description", + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"Updated: {updated_store.name} ({updated_store.id}): {updated_store.description}") # List Memory Store memory_stores = [] - async for store in project_client.memory_stores.list(limit=10): + async for store in project_client.memory_stores.list( + limit=10, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ): memory_stores.append(store) print(f"Found {len(memory_stores)} memory stores") for store in memory_stores: print(f" - {store.name} ({store.id}): {store.description}") # Delete Memory Store - delete_response = await project_client.memory_stores.delete(memory_store.name) + delete_response = await project_client.memory_stores.delete( + memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print(f"Deleted: {delete_response.deleted}") diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search.py index bef4555d04fb..78941a4951d2 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search.py @@ -11,6 +11,7 @@ from devtools_testutils import recorded_by_proxy, RecordedTransport, is_live, is_live_and_not_recording from azure.core.exceptions import ResourceNotFoundError from azure.ai.projects.models import ( + FoundryPreviewOptInKeys, MemoryStoreDefaultDefinition, MemorySearchPreviewTool, PromptAgentDefinition, @@ -81,7 +82,9 @@ def test_agent_memory_search(self, **kwargs): # in live mode so we don't get logs of this call in test recordings. if is_live_and_not_recording(): try: - project_client.memory_stores.delete(memory_store_name) + project_client.memory_stores.delete( + memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -97,6 +100,7 @@ def test_agent_memory_search(self, **kwargs): name=memory_store_name, description="Test memory store for agent conversations", definition=definition, + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"\nMemory store created: {memory_store.name} (id: {memory_store.id})") assert memory_store.name == memory_store_name @@ -206,7 +210,9 @@ def test_agent_memory_search(self, **kwargs): if memory_store: try: - project_client.memory_stores.delete(memory_store.name) + project_client.memory_stores.delete( + memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print("Memory store deleted") except Exception as e: print(f"Failed to delete memory store: {e}") diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search_async.py index 4b9e64c8ce02..6dcde3194195 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search_async.py @@ -12,6 +12,7 @@ from devtools_testutils import RecordedTransport, is_live, is_live_and_not_recording from azure.core.exceptions import ResourceNotFoundError from azure.ai.projects.models import ( + FoundryPreviewOptInKeys, MemoryStoreDefaultDefinition, MemorySearchPreviewTool, PromptAgentDefinition, @@ -56,7 +57,9 @@ async def test_agent_memory_search_async(self, **kwargs): # in live mode so we don't get logs of this call in test recordings. if is_live_and_not_recording(): try: - await project_client.memory_stores.delete(memory_store_name) + await project_client.memory_stores.delete( + memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -72,6 +75,7 @@ async def test_agent_memory_search_async(self, **kwargs): name=memory_store_name, description="Test memory store for agent conversations", definition=definition, + foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, ) print(f"\nMemory store created: {memory_store.name} (id: {memory_store.id})") assert memory_store.name == memory_store_name @@ -181,7 +185,9 @@ async def test_agent_memory_search_async(self, **kwargs): if memory_store: try: - await project_client.memory_stores.delete(memory_store.name) + await project_client.memory_stores.delete( + memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + ) print("Memory store deleted") except Exception as e: print(f"Failed to delete memory store: {e}") From 941079635d487fae5ca759e26e3dd3ecd0544176 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Mon, 2 Feb 2026 13:21:20 -0800 Subject: [PATCH 07/22] Restore Schedules variable name --- .../ai/projects/aio/operations/_operations.py | 30 +++++++++---------- .../ai/projects/operations/_operations.py | 30 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) 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 1c70bca2abbf..23f5adc0fe04 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 @@ -7325,14 +7325,14 @@ async def get_next(next_link=None): @overload async def create_or_update( - self, id: str, resource: _models.Schedule, *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, id: str, schedule: _models.Schedule, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Schedule: """Create or update operation template. :param id: Identifier of the schedule. Required. :type id: str - :param resource: The resource instance. Required. - :type resource: ~azure.ai.projects.models.Schedule + :param schedule: The resource instance. Required. + :type schedule: ~azure.ai.projects.models.Schedule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -7343,14 +7343,14 @@ async def create_or_update( @overload async def create_or_update( - self, id: str, resource: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, id: str, schedule: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Schedule: """Create or update operation template. :param id: Identifier of the schedule. Required. :type id: str - :param resource: The resource instance. Required. - :type resource: JSON + :param schedule: The resource instance. Required. + :type schedule: 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 @@ -7361,14 +7361,14 @@ async def create_or_update( @overload async def create_or_update( - self, id: str, resource: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, id: str, schedule: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Schedule: """Create or update operation template. :param id: Identifier of the schedule. Required. :type id: str - :param resource: The resource instance. Required. - :type resource: IO[bytes] + :param schedule: The resource instance. Required. + :type schedule: 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 @@ -7379,15 +7379,15 @@ async def create_or_update( @distributed_trace_async async def create_or_update( - self, id: str, resource: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any + self, id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any ) -> _models.Schedule: """Create or update operation template. :param id: Identifier of the schedule. Required. :type id: str - :param resource: The resource instance. Is one of the following types: Schedule, JSON, + :param schedule: The resource instance. Is one of the following types: Schedule, JSON, IO[bytes] Required. - :type resource: ~azure.ai.projects.models.Schedule or JSON or IO[bytes] + :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: @@ -7408,10 +7408,10 @@ async def create_or_update( content_type = content_type or "application/merge-patch+json" _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource + if isinstance(schedule, (IOBase, bytes)): + _content = schedule else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(schedule, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_schedules_create_or_update_request( id=id, 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 7454a3583ef0..b7d1de8628b8 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 @@ -9050,14 +9050,14 @@ def get_next(next_link=None): @overload def create_or_update( - self, id: str, resource: _models.Schedule, *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, id: str, schedule: _models.Schedule, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Schedule: """Create or update operation template. :param id: Identifier of the schedule. Required. :type id: str - :param resource: The resource instance. Required. - :type resource: ~azure.ai.projects.models.Schedule + :param schedule: The resource instance. Required. + :type schedule: ~azure.ai.projects.models.Schedule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -9068,14 +9068,14 @@ def create_or_update( @overload def create_or_update( - self, id: str, resource: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, id: str, schedule: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Schedule: """Create or update operation template. :param id: Identifier of the schedule. Required. :type id: str - :param resource: The resource instance. Required. - :type resource: JSON + :param schedule: The resource instance. Required. + :type schedule: 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 @@ -9086,14 +9086,14 @@ def create_or_update( @overload def create_or_update( - self, id: str, resource: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any + self, id: str, schedule: IO[bytes], *, content_type: str = "application/merge-patch+json", **kwargs: Any ) -> _models.Schedule: """Create or update operation template. :param id: Identifier of the schedule. Required. :type id: str - :param resource: The resource instance. Required. - :type resource: IO[bytes] + :param schedule: The resource instance. Required. + :type schedule: 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 @@ -9104,15 +9104,15 @@ def create_or_update( @distributed_trace def create_or_update( - self, id: str, resource: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any + self, id: str, schedule: Union[_models.Schedule, JSON, IO[bytes]], **kwargs: Any ) -> _models.Schedule: """Create or update operation template. :param id: Identifier of the schedule. Required. :type id: str - :param resource: The resource instance. Is one of the following types: Schedule, JSON, + :param schedule: The resource instance. Is one of the following types: Schedule, JSON, IO[bytes] Required. - :type resource: ~azure.ai.projects.models.Schedule or JSON or IO[bytes] + :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: @@ -9133,10 +9133,10 @@ def create_or_update( content_type = content_type or "application/merge-patch+json" _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource + if isinstance(schedule, (IOBase, bytes)): + _content = schedule else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(schedule, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_schedules_create_or_update_request( id=id, From 971bc2e34c33bad3f75b99a82c9c504b07641797 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Mon, 2 Feb 2026 17:50:52 -0800 Subject: [PATCH 08/22] Fix some mypy errors --- sdk/ai/azure-ai-projects/CHANGELOG.md | 6 ++++-- .../evaluations/sample_eval_catalog.py | 21 ++++++++++++++----- ...mple_eval_catalog_code_based_evaluators.py | 4 +++- ...le_eval_catalog_prompt_based_evaluators.py | 4 +++- .../sample_evaluation_cluster_insight.py | 20 ++++++++++++------ .../sample_evaluation_compare_insight.py | 19 +++++++++++------ 6 files changed, 53 insertions(+), 21 deletions(-) diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 17e88a5355f7..2677e1708856 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -20,8 +20,10 @@ * Rename class `MemorySearchTool` to `MemorySearchPreviewTool`. * Rename class `MicrosoftFabricAgentTool` to `MicrosoftFabricPreviewTool`. * Rename class `SharepointAgentTool` to `SharepointPreviewTool`. -* Rename class `ItemParam` to `InputItem`. -* Rename class `PromptAgentDefinitionText` to `PromptAgentDefinitionTextOptions` +* Other class renames: + * Rename class `ItemParam` to `InputItem`. + * Rename class `PromptAgentDefinitionText` to `PromptAgentDefinitionTextOptions` + * Rnname class `EvaluationComparisonRequest` to `InsightRequest` * Tracing: workflow actions in conversation item listings are now emitted as "gen_ai.conversation.item" events (with role="workflow") instead of "gen_ai.workflow.action" events in the list_conversation_items span. * Tracing: response generation span names changed from "responses {model_name}" to "chat {model_name}" for model calls and from "responses {agent_name}" to "invoke_agent {agent_name}" for agent calls. diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog.py index 6cf957e50952..1887241bcd6a 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog.py @@ -26,6 +26,7 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( + FoundryPreviewOptInKeys, EvaluatorVersion, EvaluatorCategory, PromptBasedEvaluatorDefinition, @@ -99,6 +100,7 @@ prompt_evaluator = project_client.evaluators.create_version( name="my_custom_evaluator_code_prompt_based", evaluator_version=evaluator_version, + foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, ) pprint(prompt_evaluator) @@ -134,14 +136,15 @@ ), ) code_evaluator = project_client.evaluators.create_version( - name="my_custom_evaluator_code_based", evaluator_version=evaluator_version + name="my_custom_evaluator_code_based", + evaluator_version=evaluator_version, + foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, ) pprint(code_evaluator) print("Get code based evaluator version") code_evaluator_latest = project_client.evaluators.get_version( - name=code_evaluator.name, - version=code_evaluator.version, + name=code_evaluator.name, version=code_evaluator.version, foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1 ) pprint(code_evaluator_latest) @@ -149,6 +152,7 @@ prompt_evaluator_latest = project_client.evaluators.get_version( name=prompt_evaluator.name, version=prompt_evaluator.version, + foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, ) pprint(prompt_evaluator_latest) @@ -161,6 +165,7 @@ "display_name": "my_custom_evaluator_updated", "description": "Custom evaluator description changed", }, + foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, ) pprint(updated_evaluator) @@ -168,21 +173,27 @@ project_client.evaluators.delete_version( name=code_evaluator_latest.name, version=code_evaluator_latest.version, + foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, ) project_client.evaluators.delete_version( name=prompt_evaluator_latest.name, version=prompt_evaluator_latest.version, + foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, ) print("Getting list of builtin evaluator versions") - evaluators = project_client.evaluators.list_latest_versions(type="builtin") + evaluators = project_client.evaluators.list_latest_versions( + type="builtin", foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1 + ) print("List of builtin evaluator versions") for evaluator in evaluators: pprint(evaluator) print("Getting list of custom evaluator versions") - evaluators = project_client.evaluators.list_latest_versions(type="custom") + evaluators = project_client.evaluators.list_latest_versions( + type="custom", foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1 + ) print("List of custom evaluator versions") for evaluator in evaluators: pprint(evaluator) diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_code_based_evaluators.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_code_based_evaluators.py index 81a4ccee2f89..f0a30560005e 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_code_based_evaluators.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_code_based_evaluators.py @@ -26,7 +26,7 @@ import os from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import EvaluatorCategory, EvaluatorDefinitionType +from azure.ai.projects.models import EvaluatorCategory, EvaluatorDefinitionType, FoundryPreviewOptInKeys from openai.types.evals.create_eval_jsonl_run_data_source_param import ( CreateEvalJSONLRunDataSourceParam, @@ -97,6 +97,7 @@ }, }, }, + foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, ) data_source_config = DataSourceConfigCustom( @@ -202,6 +203,7 @@ project_client.evaluators.delete_version( name=code_evaluator.name, version=code_evaluator.version, + foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, ) client.evals.delete(eval_id=eval_object.id) diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_prompt_based_evaluators.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_prompt_based_evaluators.py index 0669329711bc..a74f6a4d0e6c 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_prompt_based_evaluators.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_prompt_based_evaluators.py @@ -59,7 +59,7 @@ import os from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import EvaluatorCategory, EvaluatorDefinitionType +from azure.ai.projects.models import EvaluatorCategory, EvaluatorDefinitionType, FoundryPreviewOptInKeys from openai.types.evals.create_eval_jsonl_run_data_source_param import ( CreateEvalJSONLRunDataSourceParam, @@ -154,6 +154,7 @@ }, }, }, + foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, ) pprint(prompt_evaluator) @@ -268,6 +269,7 @@ project_client.evaluators.delete_version( name=prompt_evaluator.name, version=prompt_evaluator.version, + foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, ) client.evals.delete(eval_id=eval_object.id) diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_cluster_insight.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_cluster_insight.py index 751047c33310..5d1eb54fa370 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_cluster_insight.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_cluster_insight.py @@ -34,8 +34,13 @@ from typing import Union from pprint import pprint from dotenv import load_dotenv -from azure.ai.projects.models._enums import OperationState -from azure.ai.projects.models._models import EvaluationRunClusterInsightsRequest, Insight, InsightModelConfiguration +from azure.ai.projects.models import ( + FoundryPreviewOptInKeys, + OperationState, + EvaluationRunClusterInsightRequest, + Insight, + InsightModelConfiguration, +) from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from openai.types.eval_create_params import DataSourceConfigCustom, TestingCriterionLabelModel @@ -130,20 +135,23 @@ print(f"Evaluation run result counts: {eval_run.result_counts}") clusterInsight = project_client.insights.generate( - Insight( + insight=Insight( display_name="Cluster analysis", - request=EvaluationRunClusterInsightsRequest( + request=EvaluationRunClusterInsightRequest( eval_id=eval_object.id, run_ids=[eval_run.id], model_configuration=InsightModelConfiguration(model_deployment_name=model_deployment_name), ), - ) + ), + foundry_beta=FoundryPreviewOptInKeys.INSIGHTS_V1, ) print(f"Started insight generation (id: {clusterInsight.id})") while clusterInsight.state not in [OperationState.SUCCEEDED, OperationState.FAILED]: print(f"Waiting for insight to be generated...") - clusterInsight = project_client.insights.get(id=clusterInsight.id) + clusterInsight = project_client.insights.get( + id=clusterInsight.id, foundry_beta=FoundryPreviewOptInKeys.INSIGHTS_V1 + ) print(f"Insight status: {clusterInsight.state}") time.sleep(5) diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_compare_insight.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_compare_insight.py index 45b4686f3bf1..9f0dd5ca6430 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_compare_insight.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_compare_insight.py @@ -31,8 +31,12 @@ import time from pprint import pprint from dotenv import load_dotenv -from azure.ai.projects.models._enums import OperationState -from azure.ai.projects.models._models import EvaluationComparisonRequest, Insight +from azure.ai.projects.models import ( + FoundryPreviewOptInKeys, + OperationState, + EvaluationComparisonInsightRequest, + Insight, +) from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from openai.types.eval_create_params import DataSourceConfigCustom, TestingCriterionLabelModel @@ -132,17 +136,20 @@ # Generate comparison insights compareInsight = project_client.insights.generate( - Insight( + insight=Insight( display_name="Comparison of Evaluation Runs", - request=EvaluationComparisonRequest( + request=EvaluationComparisonInsightRequest( eval_id=eval_object.id, baseline_run_id=eval_run_1.id, treatment_run_ids=[eval_run_2.id] ), - ) + ), + foundry_beta=FoundryPreviewOptInKeys.INSIGHTS_V1, ) print(f"Started insight generation (id: {compareInsight.id})") while compareInsight.state not in [OperationState.SUCCEEDED, OperationState.FAILED]: - compareInsight = project_client.insights.get(id=compareInsight.id) + compareInsight = project_client.insights.get( + id=compareInsight.id, foundry_beta=FoundryPreviewOptInKeys.INSIGHTS_V1 + ) print(f"Waiting for insight to be generated...current status: {compareInsight.state}") time.sleep(5) From 01eba32b1aad4cf25f3c7635d1757b99c4dfe368 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Tue, 3 Feb 2026 09:46:01 -0800 Subject: [PATCH 09/22] Fix missing import. Comment out debug flag --- .../samples/agents/sample_workflow_multi_agent.py | 6 ++++-- .../samples/agents/sample_workflow_multi_agent_async.py | 2 +- .../telemetry/test_responses_instrumentor_workflow.py | 8 ++++---- .../test_responses_instrumentor_workflow_async.py | 8 ++++---- 4 files changed, 13 insertions(+), 11 deletions(-) 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 e733a206ff1f..abb5270b0bad 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 @@ -29,9 +29,10 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( + FoundryPreviewOptInKeys, + ItemResourceType, PromptAgentDefinition, WorkflowAgentDefinition, - ItemResourceType, ) load_dotenv() @@ -138,6 +139,7 @@ workflow = project_client.agents.create_version( agent_name="student-teacher-workflow", definition=WorkflowAgentDefinition(workflow=workflow_yaml), + foundry_beta=FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1, ) print(f"Agent created (id: {workflow.id}, name: {workflow.name}, version: {workflow.version})") @@ -150,7 +152,7 @@ extra_body={"agent": {"name": workflow.name, "type": "agent_reference"}}, input="1 + 1 = ?", stream=True, - metadata={"x-ms-debug-mode-enabled": "1"}, + # REMOVE ME? metadata={"x-ms-debug-mode-enabled": "1"}, ) for event in stream: 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 bb4042abecf1..95adcae568cf 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 @@ -152,7 +152,7 @@ async def main(): extra_body={"agent": {"name": workflow.name, "type": "agent_reference"}}, input="1 + 1 = ?", stream=True, - metadata={"x-ms-debug-mode-enabled": "1"}, + # Remove me? metadata={"x-ms-debug-mode-enabled": "1"}, ) async for event in stream: diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_workflow.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_workflow.py index dca9a911fd75..24f9e62148c6 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_workflow.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_workflow.py @@ -240,7 +240,7 @@ def test_sync_workflow_non_streaming_with_content_recording(self, **kwargs): extra_body={"agent": AgentReference(name=workflow.name).as_dict()}, input="1 + 1 = ?", stream=False, - metadata={"x-ms-debug-mode-enabled": "1"}, + # Remove me? metadata={"x-ms-debug-mode-enabled": "1"}, ) # Verify response has output @@ -404,7 +404,7 @@ def test_sync_workflow_non_streaming_without_content_recording(self, **kwargs): extra_body={"agent": AgentReference(name=workflow.name).as_dict()}, input="1 + 1 = ?", stream=False, - metadata={"x-ms-debug-mode-enabled": "1"}, + # Remove me? metadata={"x-ms-debug-mode-enabled": "1"}, ) # Verify response has output @@ -570,7 +570,7 @@ def test_sync_workflow_streaming_with_content_recording(self, **kwargs): extra_body={"agent": AgentReference(name=workflow.name).as_dict()}, input="1 + 1 = ?", stream=True, - metadata={"x-ms-debug-mode-enabled": "1"}, + # Remove me? metadata={"x-ms-debug-mode-enabled": "1"}, ) # Consume stream @@ -737,7 +737,7 @@ def test_sync_workflow_streaming_without_content_recording(self, **kwargs): extra_body={"agent": AgentReference(name=workflow.name).as_dict()}, input="1 + 1 = ?", stream=True, - metadata={"x-ms-debug-mode-enabled": "1"}, + # Remove me? metadata={"x-ms-debug-mode-enabled": "1"}, ) # Consume stream diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_workflow_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_workflow_async.py index fcb55113a0eb..4bc87460f417 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_workflow_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_workflow_async.py @@ -239,7 +239,7 @@ async def test_async_workflow_non_streaming_with_content_recording(self, **kwarg extra_body={"agent": AgentReference(name=workflow.name).as_dict()}, input="1 + 1 = ?", stream=False, - metadata={"x-ms-debug-mode-enabled": "1"}, + # Remove me? metadata={"x-ms-debug-mode-enabled": "1"}, ) # Verify response has output @@ -399,7 +399,7 @@ async def test_async_workflow_non_streaming_without_content_recording(self, **kw extra_body={"agent": AgentReference(name=workflow.name).as_dict()}, input="1 + 1 = ?", stream=False, - metadata={"x-ms-debug-mode-enabled": "1"}, + # Remove me? metadata={"x-ms-debug-mode-enabled": "1"}, ) # Verify response has output @@ -563,7 +563,7 @@ async def test_async_workflow_streaming_with_content_recording(self, **kwargs): extra_body={"agent": AgentReference(name=workflow.name).as_dict()}, input="1 + 1 = ?", stream=True, - metadata={"x-ms-debug-mode-enabled": "1"}, + # Remove me? metadata={"x-ms-debug-mode-enabled": "1"}, ) # Consume stream @@ -728,7 +728,7 @@ async def test_async_workflow_streaming_without_content_recording(self, **kwargs extra_body={"agent": AgentReference(name=workflow.name).as_dict()}, input="1 + 1 = ?", stream=True, - metadata={"x-ms-debug-mode-enabled": "1"}, + # Remove me? metadata={"x-ms-debug-mode-enabled": "1"}, ) # Consume stream From 0f6788ec301ff615c0c11615b06e5a944b1e46e3 Mon Sep 17 00:00:00 2001 From: Howie Leung Date: Tue, 3 Feb 2026 12:41:28 -0800 Subject: [PATCH 10/22] web search samples (#44981) * web search samples * Remove redundant print statements from web search sample scripts * update change log --- sdk/ai/azure-ai-projects/CHANGELOG.md | 4 + sdk/ai/azure-ai-projects/README.md | 34 +++++- .../agents/tools/sample_agent_to_agent.py | 4 +- .../agents/tools/sample_agent_web_search.py | 40 +++++-- .../tools/sample_agent_web_search_preview.py | 95 +++++++++++++++ ...ple_agent_web_search_with_custom_search.py | 111 ++++++++++++++++++ .../tests/samples/test_samples.py | 4 + .../tests/samples/test_samples_async.py | 3 +- 8 files changed, 283 insertions(+), 12 deletions(-) create mode 100644 sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py create mode 100644 sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 2677e1708856..aca4689f53e5 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -27,6 +27,10 @@ * Tracing: workflow actions in conversation item listings are now emitted as "gen_ai.conversation.item" events (with role="workflow") instead of "gen_ai.workflow.action" events in the list_conversation_items span. * Tracing: response generation span names changed from "responses {model_name}" to "chat {model_name}" for model calls and from "responses {agent_name}" to "invoke_agent {agent_name}" for agent calls. +### Sample updates + +* Add and update samples for `WebSearchTool` and `WebSearchPreviewTool` + ## 2.0.0b3 (2026-01-06) ### Features Added diff --git a/sdk/ai/azure-ai-projects/README.md b/sdk/ai/azure-ai-projects/README.md index cb157d7f8454..45ac8e70c8bf 100644 --- a/sdk/ai/azure-ai-projects/README.md +++ b/sdk/ai/azure-ai-projects/README.md @@ -20,7 +20,7 @@ resources in your Microsoft Foundry Project. Use it to: * Model Context Protocol (MCP) * OpenAPI * SharePoint - * Web Search + * Web Search/Web Search Preview * **Get an OpenAI client** using `.get_openai_client()` method to run Responses, Conversations, Evals and FineTuning operations with your Agent. * **Manage memory stores** for Agent conversations, using the `.memory_stores` operations. * **Explore additional evaluation tools** to assess the performance of your generative AI application, using the `.evaluation_rules`, @@ -282,9 +282,9 @@ if image_data and image_data[0]: See the full sample in file `\agents\tools\sample_agent_image_generation.py` in the [Samples][samples] folder. -**Web Search** +**Web Search/Web Search Preview** -Perform general web searches to retrieve current information from the internet. [OpenAI Documentation](https://platform.openai.com/docs/guides/tools-web-search) +Discover up-to-date web content with the GA Web Search tool or try the Web Search Preview tool for the latest enhancements. Guidance on when to use each option is in the documentation: https://learn.microsoft.com/azure/ai-foundry/agents/how-to/tools/web-overview?view=foundry#determine-the-best-tool-for-your-use-cases. @@ -296,6 +296,34 @@ tool = WebSearchPreviewTool(user_location=ApproximateLocation(country="GB", city See the full sample in file `\agents\tools\sample_agent_web_search.py` in the [Samples][samples] folder. + + +```python +tool = WebSearchPreviewTool(user_location=ApproximateLocation(country="GB", city="London", region="London")) +``` + + + +See the full sample in file `\agents\tools\sample_agent_web_search_preview.py` in the [Samples][samples] folder. + +Use the GA Web Search tool with a Bing Custom Search connection to scope results to your custom search instance: + + + +```python +tool = WebSearchTool( + custom_search_configuration=WebSearchConfiguration( + project_connection_id=os.environ["BING_CUSTOM_SEARCH_PROJECT_CONNECTION_ID"], + instance_name=os.environ["BING_CUSTOM_SEARCH_INSTANCE_NAME"], + ) +) +``` + + + +See the full sample in file `\agents\tools\sample_agent_web_search_with_custom_search.py` in the [Samples][samples] folder. + + **Computer Use** Enable agents to interact directly with computer systems for task automation and system operations: diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_to_agent.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_to_agent.py index 8ec7df5d3902..87fa94ab0649 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_to_agent.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_to_agent.py @@ -68,7 +68,9 @@ ) print(f"Agent created (id: {agent.id}, name: {agent.name}, version: {agent.version})") - user_input = input("Enter your question (e.g., 'What can the secondary agent do?'): \n") + user_input = os.environ.get("A2A_USER_INPUT") or input( + "Enter your question (e.g., 'What can the secondary agent do?'): \n" + ) stream_response = openai_client.responses.create( stream=True, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py index b83844e28db7..e522f691c40e 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search.py @@ -27,7 +27,11 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, WebSearchPreviewTool, ApproximateLocation +from azure.ai.projects.models import ( + PromptAgentDefinition, + WebSearchTool, + WebSearchApproximateLocation, +) load_dotenv() @@ -40,9 +44,8 @@ project_client.get_openai_client() as openai_client, ): # [START tool_declaration] - tool = WebSearchPreviewTool(user_location=ApproximateLocation(country="GB", city="London", region="London")) + tool = WebSearchTool(user_location=WebSearchApproximateLocation(country="GB", city="London", region="London")) # [END tool_declaration] - # Create Agent with web search tool agent = project_client.agents.create_version( agent_name="MyAgent", @@ -60,13 +63,36 @@ print(f"Created conversation (id: {conversation.id})") # Send a query to search the web - response = openai_client.responses.create( - conversation=conversation.id, - input="Show me the latest London Underground service updates", + user_input = "Show me the latest London Underground service updates" + stream_response = openai_client.responses.create( + stream=True, + input=user_input, + tool_choice="required", extra_body={"agent": {"name": agent.name, "type": "agent_reference"}}, ) - print(f"Agent response: {response.output_text}") + for event in stream_response: + if event.type == "response.created": + print(f"Follow-up response created with ID: {event.response.id}") + elif event.type == "response.output_text.delta": + print(f"Delta: {event.delta}") + elif event.type == "response.text.done": + print(f"\nFollow-up response done!") + elif event.type == "response.output_item.done": + if event.item.type == "message": + item = event.item + if item.content[-1].type == "output_text": + text_content = item.content[-1] + for annotation in text_content.annotations: + if annotation.type == "url_citation": + print( + f"URL Citation: {annotation.url}, " + f"Start index: {annotation.start_index}, " + f"End index: {annotation.end_index}" + ) + elif event.type == "response.completed": + print(f"\nFollow-up completed!") + print(f"Full response: {event.response.output_text}") print("\nCleaning up...") project_client.agents.delete_version(agent_name=agent.name, agent_version=agent.version) print("Agent deleted") diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py new file mode 100644 index 000000000000..ef21027f64a3 --- /dev/null +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py @@ -0,0 +1,95 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + This sample demonstrates how to run Prompt Agent operations + using the Web Search Preview Tool and a synchronous client. + +USAGE: + python sample_agent_web_search_preview.py + + Before running the sample: + + pip install "azure-ai-projects>=2.0.0b1" python-dotenv + + Set these environment variables with your own values: + 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview + page of your Microsoft Foundry portal. + 2) AZURE_AI_MODEL_DEPLOYMENT_NAME - The deployment name of the AI model, as found under the "Name" column in + the "Models + endpoints" tab in your Microsoft Foundry project. +""" + +import os +from dotenv import load_dotenv + +from azure.identity import DefaultAzureCredential +from azure.ai.projects import AIProjectClient +from azure.ai.projects.models import PromptAgentDefinition, WebSearchPreviewTool, ApproximateLocation + +load_dotenv() + + +endpoint = os.environ["AZURE_AI_PROJECT_ENDPOINT"] + +with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + project_client.get_openai_client() as openai_client, +): + # [START tool_declaration] + tool = WebSearchPreviewTool(user_location=ApproximateLocation(country="GB", city="London", region="London")) + # [END tool_declaration] + # Create Agent with web search tool + agent = project_client.agents.create_version( + agent_name="MyAgent105", + definition=PromptAgentDefinition( + model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"], + instructions="You are a helpful assistant that can search the web", + tools=[tool], + ), + description="Agent for web search.", + ) + print(f"Agent created (id: {agent.id}, name: {agent.name}, version: {agent.version})") + + # Create a conversation for the agent interaction + conversation = openai_client.conversations.create() + print(f"Created conversation (id: {conversation.id})") + + # Send a query to search the web + user_input = "Show me the latest London Underground service updates" + stream_response = openai_client.responses.create( + stream=True, + input=user_input, + tool_choice="required", + extra_body={"agent": {"name": agent.name, "type": "agent_reference"}}, + ) + + for event in stream_response: + if event.type == "response.created": + print(f"Follow-up response created with ID: {event.response.id}") + elif event.type == "response.output_text.delta": + print(f"Delta: {event.delta}") + elif event.type == "response.text.done": + print(f"\nFollow-up response done!") + elif event.type == "response.output_item.done": + if event.item.type == "message": + item = event.item + if item.content[-1].type == "output_text": + text_content = item.content[-1] + for annotation in text_content.annotations: + if annotation.type == "url_citation": + print( + f"URL Citation: {annotation.url}, " + f"Start index: {annotation.start_index}, " + f"End index: {annotation.end_index}" + ) + elif event.type == "response.completed": + print(f"\nFollow-up completed!") + print(f"Full response: {event.response.output_text}") + + print("\nCleaning up...") + project_client.agents.delete_version(agent_name=agent.name, agent_version=agent.version) + print("Agent deleted") diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py new file mode 100644 index 000000000000..9ff7d94f89cb --- /dev/null +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py @@ -0,0 +1,111 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +""" +DESCRIPTION: + Demonstrates Prompt Agent operations that use the Web Search Tool configured + with a Bing Custom Search connection. The agent runs synchronously and + pulls results from your specified custom search instance. + +USAGE: + python sample_agent_web_search_with_custom_search.py + + Before running the sample: + + pip install "azure-ai-projects>=2.0.0b1" python-dotenv + + Set these environment variables with your own values: + 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview + page of your Microsoft Foundry portal. + 2) AZURE_AI_MODEL_DEPLOYMENT_NAME - The deployment name of the AI model, as found under the "Name" column in + the "Models + endpoints" tab in your Microsoft Foundry project. + 3) BING_CUSTOM_SEARCH_PROJECT_CONNECTION_ID - The Bing Custom Search project connection ID, + as found in the "Connections" tab in your Microsoft Foundry project. + 4) BING_CUSTOM_SEARCH_INSTANCE_NAME - The Bing Custom Search instance name + 5) BING_CUSTOM_USER_INPUT - (Optional) The question to ask. If not set, you will be prompted. +""" + +import os +from dotenv import load_dotenv + +from azure.identity import DefaultAzureCredential +from azure.ai.projects import AIProjectClient +from azure.ai.projects.models import ( + PromptAgentDefinition, + WebSearchTool, + WebSearchConfiguration, +) + +load_dotenv() + + +endpoint = os.environ["AZURE_AI_PROJECT_ENDPOINT"] + +with ( + DefaultAzureCredential() as credential, + AIProjectClient(endpoint=endpoint, credential=credential) as project_client, + project_client.get_openai_client() as openai_client, +): + # [START tool_declaration] + tool = WebSearchTool( + custom_search_configuration=WebSearchConfiguration( + project_connection_id=os.environ["BING_CUSTOM_SEARCH_PROJECT_CONNECTION_ID"], + instance_name=os.environ["BING_CUSTOM_SEARCH_INSTANCE_NAME"], + ) + ) + # [END tool_declaration] + # Create Agent with web search tool + agent = project_client.agents.create_version( + agent_name="MyAgent", + definition=PromptAgentDefinition( + model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"], + instructions="You are a helpful assistant that can search the web and bing", + tools=[tool], + ), + description="Agent for web search.", + ) + print(f"Agent created (id: {agent.id}, name: {agent.name}, version: {agent.version})") + + # Create a conversation for the agent interaction + conversation = openai_client.conversations.create() + print(f"Created conversation (id: {conversation.id})") + + user_input = os.environ.get("BING_CUSTOM_USER_INPUT") or input("Enter your question: \n") + + # Send a query to search the web + # Send initial request that will trigger the Bing Custom Search tool + stream_response = openai_client.responses.create( + stream=True, + input=user_input, + tool_choice="required", + extra_body={"agent": {"name": agent.name, "type": "agent_reference"}}, + ) + + for event in stream_response: + if event.type == "response.created": + print(f"Follow-up response created with ID: {event.response.id}") + elif event.type == "response.output_text.delta": + print(f"Delta: {event.delta}") + elif event.type == "response.text.done": + print(f"\nFollow-up response done!") + elif event.type == "response.output_item.done": + if event.item.type == "message": + item = event.item + if item.content[-1].type == "output_text": + text_content = item.content[-1] + for annotation in text_content.annotations: + if annotation.type == "url_citation": + print( + f"URL Citation: {annotation.url}, " + f"Start index: {annotation.start_index}, " + f"End index: {annotation.end_index}" + ) + elif event.type == "response.completed": + print(f"\nFollow-up completed!") + print(f"Full response: {event.response.output_text}") + + print("\nCleaning up...") + project_client.agents.delete_version(agent_name=agent.name, agent_version=agent.version) + print("Agent deleted") 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 999b884f865e..5225fe5d9251 100644 --- a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py +++ b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py @@ -41,6 +41,9 @@ class TestSamples(AzureRecordedTestCase): "sample_agent_mcp_with_project_connection.py", "sample_agent_openapi_with_project_connection.py", "sample_agent_to_agent.py", + "sample_agent_web_search.py", + "sample_agent_web_search_preview.py", + "sample_agent_web_search_with_custom_search.py", ], ), ) @@ -53,4 +56,5 @@ def test_agent_tools_samples(self, sample_path: str, **kwargs) -> None: executor.validate_print_calls_by_llm( instructions=agent_tools_instructions, project_endpoint=kwargs["azure_ai_project_endpoint"], + model=kwargs["azure_ai_model_deployment_name"], ) 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 d836afd2351e..61e8fe907ea6 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 @@ -25,7 +25,7 @@ class TestSamplesAsync(AzureRecordedTestCase): "sample_path", get_async_sample_paths( "agents/tools", - samples_to_skip=["sample_agent_mcp_with_project_connection_async.py"], + samples_to_skip=[], ), ) @SamplePathPasser() @@ -42,4 +42,5 @@ async def test_agent_tools_samples_async(self, sample_path: str, **kwargs) -> No await executor.validate_print_calls_by_llm_async( instructions=agent_tools_instructions, project_endpoint=kwargs["azure_ai_project_endpoint"], + model=kwargs["azure_ai_model_deployment_name"], ) From a28537ee3169a965a424bc8b9d043db8558cf4ee Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Tue, 3 Feb 2026 17:14:50 -0800 Subject: [PATCH 11/22] Re-emit from my TypeSpec branch dargilco/rename-optin-http-request-header --- .../azure-ai-projects/apiview-properties.json | 106 +- .../azure/ai/projects/_utils/model_base.py | 4 +- .../ai/projects/aio/operations/_operations.py | 792 +-- .../azure/ai/projects/models/__init__.py | 204 +- .../azure/ai/projects/models/_enums.py | 139 +- .../azure/ai/projects/models/_models.py | 5699 +++++++++++++++-- .../ai/projects/operations/_operations.py | 965 +-- 7 files changed, 6447 insertions(+), 1462 deletions(-) diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index dbfee8e01162..80741d4b4756 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -79,6 +79,7 @@ "azure.ai.projects.models.ContainerFileCitationBody": "OpenAI.ContainerFileCitationBody", "azure.ai.projects.models.EvaluationRuleAction": "Azure.AI.Projects.EvaluationRuleAction", "azure.ai.projects.models.ContinuousEvaluationRuleAction": "Azure.AI.Projects.ContinuousEvaluationRuleAction", + "azure.ai.projects.models.ConversationReference": "OpenAI.ConversationReference", "azure.ai.projects.models.CosmosDBIndex": "Azure.AI.Projects.CosmosDBIndex", "azure.ai.projects.models.Trigger": "Azure.AI.Projects.Trigger", "azure.ai.projects.models.CronTrigger": "Azure.AI.Projects.CronTrigger", @@ -154,7 +155,9 @@ "azure.ai.projects.models.InputContentInputFileContent": "OpenAI.InputContentInputFileContent", "azure.ai.projects.models.InputContentInputImageContent": "OpenAI.InputContentInputImageContent", "azure.ai.projects.models.InputContentInputTextContent": "OpenAI.InputContentInputTextContent", + "azure.ai.projects.models.InputFileContent": "OpenAI.InputFileContent", "azure.ai.projects.models.InputFileContentParam": "OpenAI.InputFileContentParam", + "azure.ai.projects.models.InputImageContent": "OpenAI.InputImageContent", "azure.ai.projects.models.InputImageContentParamAutoParam": "OpenAI.InputImageContentParamAutoParam", "azure.ai.projects.models.InputItemApplyPatchToolCallItemParam": "OpenAI.InputItemApplyPatchToolCallItemParam", "azure.ai.projects.models.InputItemApplyPatchToolCallOutputItemParam": "OpenAI.InputItemApplyPatchToolCallOutputItemParam", @@ -181,6 +184,7 @@ "azure.ai.projects.models.InputItemWebSearchToolCall": "OpenAI.InputItemWebSearchToolCall", "azure.ai.projects.models.ItemResource": "OpenAI.ItemResource", "azure.ai.projects.models.InputMessageResource": "OpenAI.InputMessageResource", + "azure.ai.projects.models.InputTextContent": "OpenAI.InputTextContent", "azure.ai.projects.models.InputTextContentParam": "OpenAI.InputTextContentParam", "azure.ai.projects.models.Insight": "Azure.AI.Projects.Insight", "azure.ai.projects.models.InsightCluster": "Azure.AI.Projects.InsightCluster", @@ -223,6 +227,7 @@ "azure.ai.projects.models.MemorySearchItem": "Azure.AI.Projects.MemorySearchItem", "azure.ai.projects.models.MemorySearchOptions": "Azure.AI.Projects.MemorySearchOptions", "azure.ai.projects.models.MemorySearchPreviewTool": "Azure.AI.Projects.MemorySearchPreviewTool", + "azure.ai.projects.models.OutputItem": "OpenAI.OutputItem", "azure.ai.projects.models.MemorySearchToolCallItemResource": "Azure.AI.Projects.MemorySearchToolCallItemResource", "azure.ai.projects.models.MemoryStoreDefinition": "Azure.AI.Projects.MemoryStoreDefinition", "azure.ai.projects.models.MemoryStoreDefaultDefinition": "Azure.AI.Projects.MemoryStoreDefaultDefinition", @@ -233,6 +238,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.ModelDeployment": "Azure.AI.Projects.ModelDeployment", "azure.ai.projects.models.ModelDeploymentSku": "Azure.AI.Projects.Sku", @@ -240,7 +246,7 @@ "azure.ai.projects.models.MonthlyRecurrenceSchedule": "Azure.AI.Projects.MonthlyRecurrenceSchedule", "azure.ai.projects.models.Move": "OpenAI.Move", "azure.ai.projects.models.NoAuthenticationCredentials": "Azure.AI.Projects.NoAuthenticationCredentials", - "azure.ai.projects.models.OAuthConsentRequestItemResource": "Azure.AI.Projects.OAuthConsentRequestItemResource", + "azure.ai.projects.models.OAuthConsentRequestOutputItem": "Azure.AI.Projects.OAuthConsentRequestOutputItem", "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", @@ -252,11 +258,33 @@ "azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme": "Azure.AI.Projects.OpenApiProjectConnectionSecurityScheme", "azure.ai.projects.models.OpenApiTool": "Azure.AI.Projects.OpenApiTool", "azure.ai.projects.models.OutputContent": "OpenAI.OutputContent", + "azure.ai.projects.models.OutputContentOutputTextContent": "OpenAI.OutputContentOutputTextContent", + "azure.ai.projects.models.OutputContentReasoningTextContent": "OpenAI.OutputContentReasoningTextContent", + "azure.ai.projects.models.OutputContentRefusalContent": "OpenAI.OutputContentRefusalContent", + "azure.ai.projects.models.OutputItemApplyPatchToolCall": "OpenAI.OutputItemApplyPatchToolCall", + "azure.ai.projects.models.OutputItemApplyPatchToolCallOutput": "OpenAI.OutputItemApplyPatchToolCallOutput", + "azure.ai.projects.models.OutputItemCodeInterpreterToolCall": "OpenAI.OutputItemCodeInterpreterToolCall", + "azure.ai.projects.models.OutputItemCompactionBody": "OpenAI.OutputItemCompactionBody", + "azure.ai.projects.models.OutputItemComputerToolCall": "OpenAI.OutputItemComputerToolCall", + "azure.ai.projects.models.OutputItemCustomToolCall": "OpenAI.OutputItemCustomToolCall", + "azure.ai.projects.models.OutputItemFileSearchToolCall": "OpenAI.OutputItemFileSearchToolCall", + "azure.ai.projects.models.OutputItemFunctionShellCall": "OpenAI.OutputItemFunctionShellCall", + "azure.ai.projects.models.OutputItemFunctionShellCallOutput": "OpenAI.OutputItemFunctionShellCallOutput", + "azure.ai.projects.models.OutputItemFunctionToolCall": "OpenAI.OutputItemFunctionToolCall", + "azure.ai.projects.models.OutputItemImageGenToolCall": "OpenAI.OutputItemImageGenToolCall", + "azure.ai.projects.models.OutputItemLocalShellToolCall": "OpenAI.OutputItemLocalShellToolCall", + "azure.ai.projects.models.OutputItemMcpApprovalRequest": "OpenAI.OutputItemMcpApprovalRequest", + "azure.ai.projects.models.OutputItemMcpListTools": "OpenAI.OutputItemMcpListTools", + "azure.ai.projects.models.OutputItemMcpToolCall": "OpenAI.OutputItemMcpToolCall", + "azure.ai.projects.models.OutputItemOutputMessage": "OpenAI.OutputItemOutputMessage", + "azure.ai.projects.models.OutputItemReasoningItem": "OpenAI.OutputItemReasoningItem", + "azure.ai.projects.models.OutputItemWebSearchToolCall": "OpenAI.OutputItemWebSearchToolCall", "azure.ai.projects.models.OutputMessageContent": "OpenAI.OutputMessageContent", "azure.ai.projects.models.OutputMessageContentOutputTextContent": "OpenAI.OutputMessageContentOutputTextContent", "azure.ai.projects.models.OutputMessageContentRefusalContent": "OpenAI.OutputMessageContentRefusalContent", "azure.ai.projects.models.PendingUploadRequest": "Azure.AI.Projects.PendingUploadRequest", "azure.ai.projects.models.PendingUploadResponse": "Azure.AI.Projects.PendingUploadResponse", + "azure.ai.projects.models.Prompt": "OpenAI.Prompt", "azure.ai.projects.models.PromptAgentDefinition": "Azure.AI.Projects.PromptAgentDefinition", "azure.ai.projects.models.PromptAgentDefinitionTextOptions": "Azure.AI.Projects.PromptAgentDefinitionTextOptions", "azure.ai.projects.models.PromptBasedEvaluatorDefinition": "Azure.AI.Projects.PromptBasedEvaluatorDefinition", @@ -267,8 +295,71 @@ "azure.ai.projects.models.ReasoningTextContent": "OpenAI.ReasoningTextContent", "azure.ai.projects.models.RecurrenceTrigger": "Azure.AI.Projects.RecurrenceTrigger", "azure.ai.projects.models.RedTeam": "Azure.AI.Projects.RedTeam", + "azure.ai.projects.models.Response": "OpenAI.Response", + "azure.ai.projects.models.ResponseAudioDeltaEvent": "OpenAI.ResponseAudioDeltaEvent", + "azure.ai.projects.models.ResponseAudioDoneEvent": "OpenAI.ResponseAudioDoneEvent", + "azure.ai.projects.models.ResponseAudioTranscriptDeltaEvent": "OpenAI.ResponseAudioTranscriptDeltaEvent", + "azure.ai.projects.models.ResponseAudioTranscriptDoneEvent": "OpenAI.ResponseAudioTranscriptDoneEvent", + "azure.ai.projects.models.ResponseCodeInterpreterCallCodeDeltaEvent": "OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent", + "azure.ai.projects.models.ResponseCodeInterpreterCallCodeDoneEvent": "OpenAI.ResponseCodeInterpreterCallCodeDoneEvent", + "azure.ai.projects.models.ResponseCodeInterpreterCallCompletedEvent": "OpenAI.ResponseCodeInterpreterCallCompletedEvent", + "azure.ai.projects.models.ResponseCodeInterpreterCallInProgressEvent": "OpenAI.ResponseCodeInterpreterCallInProgressEvent", + "azure.ai.projects.models.ResponseCodeInterpreterCallInterpretingEvent": "OpenAI.ResponseCodeInterpreterCallInterpretingEvent", + "azure.ai.projects.models.ResponseCompletedEvent": "OpenAI.ResponseCompletedEvent", + "azure.ai.projects.models.ResponseContentPartAddedEvent": "OpenAI.ResponseContentPartAddedEvent", + "azure.ai.projects.models.ResponseContentPartDoneEvent": "OpenAI.ResponseContentPartDoneEvent", + "azure.ai.projects.models.ResponseCreatedEvent": "OpenAI.ResponseCreatedEvent", + "azure.ai.projects.models.ResponseCustomToolCallInputDeltaEvent": "OpenAI.ResponseCustomToolCallInputDeltaEvent", + "azure.ai.projects.models.ResponseCustomToolCallInputDoneEvent": "OpenAI.ResponseCustomToolCallInputDoneEvent", + "azure.ai.projects.models.ResponseError": "OpenAI.ResponseError", + "azure.ai.projects.models.ResponseErrorEvent": "OpenAI.ResponseErrorEvent", + "azure.ai.projects.models.ResponseFailedEvent": "OpenAI.ResponseFailedEvent", + "azure.ai.projects.models.ResponseFileSearchCallCompletedEvent": "OpenAI.ResponseFileSearchCallCompletedEvent", + "azure.ai.projects.models.ResponseFileSearchCallInProgressEvent": "OpenAI.ResponseFileSearchCallInProgressEvent", + "azure.ai.projects.models.ResponseFileSearchCallSearchingEvent": "OpenAI.ResponseFileSearchCallSearchingEvent", + "azure.ai.projects.models.ResponseFunctionCallArgumentsDeltaEvent": "OpenAI.ResponseFunctionCallArgumentsDeltaEvent", + "azure.ai.projects.models.ResponseFunctionCallArgumentsDoneEvent": "OpenAI.ResponseFunctionCallArgumentsDoneEvent", + "azure.ai.projects.models.ResponseImageGenCallCompletedEvent": "OpenAI.ResponseImageGenCallCompletedEvent", + "azure.ai.projects.models.ResponseImageGenCallGeneratingEvent": "OpenAI.ResponseImageGenCallGeneratingEvent", + "azure.ai.projects.models.ResponseImageGenCallInProgressEvent": "OpenAI.ResponseImageGenCallInProgressEvent", + "azure.ai.projects.models.ResponseImageGenCallPartialImageEvent": "OpenAI.ResponseImageGenCallPartialImageEvent", + "azure.ai.projects.models.ResponseIncompleteDetails": "OpenAI.ResponseIncompleteDetails", + "azure.ai.projects.models.ResponseIncompleteEvent": "OpenAI.ResponseIncompleteEvent", + "azure.ai.projects.models.ResponseInProgressEvent": "OpenAI.ResponseInProgressEvent", + "azure.ai.projects.models.ResponseLogProb": "OpenAI.ResponseLogProb", + "azure.ai.projects.models.ResponseLogProbTopLogprobs": "OpenAI.ResponseLogProbTopLogprobs", + "azure.ai.projects.models.ResponseMCPCallArgumentsDeltaEvent": "OpenAI.ResponseMCPCallArgumentsDeltaEvent", + "azure.ai.projects.models.ResponseMCPCallArgumentsDoneEvent": "OpenAI.ResponseMCPCallArgumentsDoneEvent", + "azure.ai.projects.models.ResponseMCPCallCompletedEvent": "OpenAI.ResponseMCPCallCompletedEvent", + "azure.ai.projects.models.ResponseMCPCallFailedEvent": "OpenAI.ResponseMCPCallFailedEvent", + "azure.ai.projects.models.ResponseMCPCallInProgressEvent": "OpenAI.ResponseMCPCallInProgressEvent", + "azure.ai.projects.models.ResponseMCPListToolsCompletedEvent": "OpenAI.ResponseMCPListToolsCompletedEvent", + "azure.ai.projects.models.ResponseMCPListToolsFailedEvent": "OpenAI.ResponseMCPListToolsFailedEvent", + "azure.ai.projects.models.ResponseMCPListToolsInProgressEvent": "OpenAI.ResponseMCPListToolsInProgressEvent", + "azure.ai.projects.models.ResponseOutputItemAddedEvent": "OpenAI.ResponseOutputItemAddedEvent", + "azure.ai.projects.models.ResponseOutputItemDoneEvent": "OpenAI.ResponseOutputItemDoneEvent", + "azure.ai.projects.models.ResponseOutputTextAnnotationAddedEvent": "OpenAI.ResponseOutputTextAnnotationAddedEvent", + "azure.ai.projects.models.ResponsePromptVariables": "OpenAI.ResponsePromptVariables", + "azure.ai.projects.models.ResponseQueuedEvent": "OpenAI.ResponseQueuedEvent", + "azure.ai.projects.models.ResponseReasoningSummaryPartAddedEvent": "OpenAI.ResponseReasoningSummaryPartAddedEvent", + "azure.ai.projects.models.ResponseReasoningSummaryPartAddedEventPart": "OpenAI.ResponseReasoningSummaryPartAddedEventPart", + "azure.ai.projects.models.ResponseReasoningSummaryPartDoneEvent": "OpenAI.ResponseReasoningSummaryPartDoneEvent", + "azure.ai.projects.models.ResponseReasoningSummaryPartDoneEventPart": "OpenAI.ResponseReasoningSummaryPartDoneEventPart", + "azure.ai.projects.models.ResponseReasoningSummaryTextDeltaEvent": "OpenAI.ResponseReasoningSummaryTextDeltaEvent", + "azure.ai.projects.models.ResponseReasoningSummaryTextDoneEvent": "OpenAI.ResponseReasoningSummaryTextDoneEvent", + "azure.ai.projects.models.ResponseReasoningTextDeltaEvent": "OpenAI.ResponseReasoningTextDeltaEvent", + "azure.ai.projects.models.ResponseReasoningTextDoneEvent": "OpenAI.ResponseReasoningTextDoneEvent", + "azure.ai.projects.models.ResponseRefusalDeltaEvent": "OpenAI.ResponseRefusalDeltaEvent", + "azure.ai.projects.models.ResponseRefusalDoneEvent": "OpenAI.ResponseRefusalDoneEvent", + "azure.ai.projects.models.ResponseTextDeltaEvent": "OpenAI.ResponseTextDeltaEvent", + "azure.ai.projects.models.ResponseTextDoneEvent": "OpenAI.ResponseTextDoneEvent", + "azure.ai.projects.models.ResponseTextParam": "OpenAI.ResponseTextParam", + "azure.ai.projects.models.ResponseUsage": "OpenAI.ResponseUsage", "azure.ai.projects.models.ResponseUsageInputTokensDetails": "OpenAI.ResponseUsageInputTokensDetails", "azure.ai.projects.models.ResponseUsageOutputTokensDetails": "OpenAI.ResponseUsageOutputTokensDetails", + "azure.ai.projects.models.ResponseWebSearchCallCompletedEvent": "OpenAI.ResponseWebSearchCallCompletedEvent", + "azure.ai.projects.models.ResponseWebSearchCallInProgressEvent": "OpenAI.ResponseWebSearchCallInProgressEvent", + "azure.ai.projects.models.ResponseWebSearchCallSearchingEvent": "OpenAI.ResponseWebSearchCallSearchingEvent", "azure.ai.projects.models.SASCredentials": "Azure.AI.Projects.SASCredentials", "azure.ai.projects.models.Schedule": "Azure.AI.Projects.Schedule", "azure.ai.projects.models.ScheduleRun": "Azure.AI.Projects.ScheduleRun", @@ -281,7 +372,7 @@ "azure.ai.projects.models.SpecificFunctionShellParam": "OpenAI.SpecificFunctionShellParam", "azure.ai.projects.models.StructuredInputDefinition": "Azure.AI.Projects.StructuredInputDefinition", "azure.ai.projects.models.StructuredOutputDefinition": "Azure.AI.Projects.StructuredOutputDefinition", - "azure.ai.projects.models.StructuredOutputsItemResource": "Azure.AI.Projects.StructuredOutputsItemResource", + "azure.ai.projects.models.StructuredOutputsOutputItem": "Azure.AI.Projects.StructuredOutputsOutputItem", "azure.ai.projects.models.Summary": "OpenAI.Summary", "azure.ai.projects.models.TaxonomyCategory": "Azure.AI.Projects.TaxonomyCategory", "azure.ai.projects.models.TaxonomySubCategory": "Azure.AI.Projects.TaxonomySubCategory", @@ -318,7 +409,7 @@ "azure.ai.projects.models.WebSearchToolFilters": "OpenAI.WebSearchToolFilters", "azure.ai.projects.models.WeeklyRecurrenceSchedule": "Azure.AI.Projects.WeeklyRecurrenceSchedule", "azure.ai.projects.models.WorkflowAgentDefinition": "Azure.AI.Projects.WorkflowAgentDefinition", - "azure.ai.projects.models.WorkflowPreviewActionOutputItemResource": "Azure.AI.Projects.WorkflowPreviewActionOutputItemResource", + "azure.ai.projects.models.WorkflowPreviewActionOutputItem": "Azure.AI.Projects.WorkflowPreviewActionOutputItem", "azure.ai.projects.models.AgentKind": "Azure.AI.Projects.AgentKind", "azure.ai.projects.models.AgentProtocol": "Azure.AI.Projects.AgentProtocol", "azure.ai.projects.models.ToolType": "OpenAI.ToolType", @@ -333,7 +424,7 @@ "azure.ai.projects.models.SearchContextSize": "OpenAI.SearchContextSize", "azure.ai.projects.models.ToolChoiceParamType": "OpenAI.ToolChoiceParamType", "azure.ai.projects.models.TextResponseFormatConfigurationType": "OpenAI.TextResponseFormatConfigurationType", - "azure.ai.projects.models.FoundryPreviewOptInKeys": "Azure.AI.Projects.FoundryPreviewOptInKeys", + "azure.ai.projects.models.FoundryFeaturesOptInKeys": "Azure.AI.Projects.FoundryFeaturesOptInKeys", "azure.ai.projects.models.PageOrder": "Azure.AI.Projects.PageOrder", "azure.ai.projects.models.ContainerLogKind": "Azure.AI.Projects.ContainerLogKind", "azure.ai.projects.models.ConnectionType": "Azure.AI.Projects.ConnectionType", @@ -371,7 +462,6 @@ "azure.ai.projects.models.InputContentType": "OpenAI.InputContentType", "azure.ai.projects.models.OutputMessageContentType": "OpenAI.OutputMessageContentType", "azure.ai.projects.models.AnnotationType": "OpenAI.AnnotationType", - "azure.ai.projects.models.OutputContentType": "OpenAI.OutputContentType", "azure.ai.projects.models.FunctionShellCallItemStatus": "OpenAI.FunctionShellCallItemStatus", "azure.ai.projects.models.FunctionShellCallOutputOutcomeParamType": "OpenAI.FunctionShellCallOutputOutcomeParamType", "azure.ai.projects.models.MemoryOperationKind": "Azure.AI.Projects.MemoryOperationKind", @@ -382,12 +472,16 @@ "azure.ai.projects.models.DayOfWeek": "Azure.AI.Projects.DayOfWeek", "azure.ai.projects.models.ScheduleTaskType": "Azure.AI.Projects.ScheduleTaskType", "azure.ai.projects.models.MemoryStoreUpdateStatus": "Azure.AI.Projects.MemoryStoreUpdateStatus", - "azure.ai.projects.models.ItemResourceType": "OpenAI.ItemResourceType", + "azure.ai.projects.models.OutputItemType": "OpenAI.OutputItemType", "azure.ai.projects.models.ApplyPatchCallStatus": "OpenAI.ApplyPatchCallStatus", "azure.ai.projects.models.ApplyPatchFileOperationType": "OpenAI.ApplyPatchFileOperationType", "azure.ai.projects.models.ApplyPatchCallOutputStatus": "OpenAI.ApplyPatchCallOutputStatus", "azure.ai.projects.models.LocalShellCallStatus": "OpenAI.LocalShellCallStatus", "azure.ai.projects.models.FunctionShellCallOutputOutcomeType": "OpenAI.FunctionShellCallOutputOutcomeType", + "azure.ai.projects.models.ToolChoiceOptions": "OpenAI.ToolChoiceOptions", + "azure.ai.projects.models.ResponseErrorCode": "OpenAI.ResponseErrorCode", + "azure.ai.projects.models.OutputContentType": "OpenAI.OutputContentType", + "azure.ai.projects.models.ItemResourceType": "OpenAI.ItemResourceType", "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.create": "Azure.AI.Projects.Agents.createAgent", 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 5e1a2d0fa5ec..4f7316e3cba1 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 @@ -1037,7 +1037,7 @@ def _failsafe_deserialize( ) -> typing.Any: try: return _deserialize(deserializer, response.json(), module, rf, format) - except DeserializationError: + except Exception: # pylint: disable=broad-except _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -1050,7 +1050,7 @@ def _failsafe_deserialize_xml( ) -> typing.Any: try: return _deserialize_xml(deserializer, response.text()) - except DeserializationError: + except Exception: # pylint: disable=broad-except _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) 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 23f5adc0fe04..eec4058bfcb6 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 @@ -35,7 +35,7 @@ from ... import models as _models from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer -from ...models._enums import FoundryPreviewOptInKeys +from ...models._enums import FoundryFeaturesOptInKeys from ...operations._operations import ( build_agents_create_from_manifest_request, build_agents_create_request, @@ -199,11 +199,11 @@ async def create( *, name: str, definition: _models.AgentDefinition, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, content_type: str = "application/json", @@ -223,14 +223,14 @@ async def create( :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 foundry_beta: A feature flag opt-in required when using preview operations or + :keyword foundry_features: A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -253,11 +253,11 @@ async def create( self, body: JSON, *, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, content_type: str = "application/json", @@ -267,14 +267,14 @@ async def create( :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or + :keyword foundry_features: A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -288,11 +288,11 @@ async def create( self, body: IO[bytes], *, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, content_type: str = "application/json", @@ -302,14 +302,14 @@ async def create( :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or + :keyword foundry_features: A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -325,11 +325,11 @@ async def create( *, name: str = _Unset, definition: _models.AgentDefinition = _Unset, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, metadata: Optional[dict[str, str]] = None, @@ -350,14 +350,14 @@ async def create( :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 foundry_beta: A feature flag opt-in required when using preview operations or + :keyword foundry_features: A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :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. @@ -400,7 +400,7 @@ async def create( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_agents_create_request( - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -448,6 +448,13 @@ async def update( agent_name: str, *, definition: _models.AgentDefinition, + foundry_features: Optional[ + Union[ + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], + ] + ] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, @@ -461,6 +468,14 @@ async def update( :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 foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -480,7 +495,19 @@ async def update( @overload async def update( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: JSON, + *, + foundry_features: Optional[ + Union[ + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], + ] + ] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: """Updates the agent by adding a new version if there are any changes to the agent definition. If no changes, returns the existing agent version. @@ -489,6 +516,14 @@ async def update( :type agent_name: str :param body: Required. :type body: JSON + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -499,7 +534,19 @@ async def update( @overload async def update( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: IO[bytes], + *, + foundry_features: Optional[ + Union[ + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], + ] + ] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: """Updates the agent by adding a new version if there are any changes to the agent definition. If no changes, returns the existing agent version. @@ -508,6 +555,14 @@ async def update( :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. Is one of the following types: + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -523,6 +578,13 @@ async def update( body: Union[JSON, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, + foundry_features: Optional[ + Union[ + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], + ] + ] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any @@ -537,6 +599,14 @@ async def update( :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 foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :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. @@ -578,6 +648,7 @@ async def update( _request = build_agents_update_request( agent_name=agent_name, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -626,11 +697,6 @@ async def create_from_manifest( name: str, manifest_id: str, parameter_values: dict[str, Any], - foundry_beta: Optional[ - Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] - ] - ] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, @@ -650,12 +716,6 @@ async def create_from_manifest( :keyword parameter_values: The inputs to the manifest that will result in a fully materialized Agent. Required. :paramtype parameter_values: dict[str, any] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is either a - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -675,27 +735,12 @@ async def create_from_manifest( @overload async def create_from_manifest( - self, - body: JSON, - *, - foundry_beta: Optional[ - Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] - ] - ] = None, - content_type: str = "application/json", - **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentDetails: """Creates an agent from a manifest. :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is either a - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -706,27 +751,12 @@ async def create_from_manifest( @overload async def create_from_manifest( - self, - body: IO[bytes], - *, - foundry_beta: Optional[ - Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] - ] - ] = None, - content_type: str = "application/json", - **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentDetails: """Creates an agent from a manifest. :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is either a - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -743,11 +773,6 @@ async def create_from_manifest( name: str = _Unset, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, - foundry_beta: Optional[ - Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] - ] - ] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any @@ -768,12 +793,6 @@ async def create_from_manifest( :keyword parameter_values: The inputs to the manifest that will result in a fully materialized Agent. Required. :paramtype parameter_values: dict[str, any] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is either a - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 :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. @@ -824,7 +843,6 @@ async def create_from_manifest( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_agents_create_from_manifest_request( - foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -1218,11 +1236,11 @@ async def create_version( agent_name: str, *, definition: _models.AgentDefinition, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, content_type: str = "application/json", @@ -1242,14 +1260,14 @@ async def create_version( :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 foundry_beta: A feature flag opt-in required when using preview operations or + :keyword foundry_features: A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -1273,11 +1291,11 @@ async def create_version( agent_name: str, body: JSON, *, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, content_type: str = "application/json", @@ -1294,14 +1312,14 @@ async def create_version( :type agent_name: str :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or + :keyword foundry_features: A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -1316,11 +1334,11 @@ async def create_version( agent_name: str, body: IO[bytes], *, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, content_type: str = "application/json", @@ -1337,14 +1355,14 @@ async def create_version( :type agent_name: str :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or + :keyword foundry_features: A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -1360,11 +1378,11 @@ async def create_version( body: Union[JSON, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, metadata: Optional[dict[str, str]] = None, @@ -1385,14 +1403,14 @@ async def create_version( :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 foundry_beta: A feature flag opt-in required when using preview operations or + :keyword foundry_features: A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :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. @@ -1434,7 +1452,7 @@ async def create_version( _request = build_agents_create_version_request( agent_name=agent_name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -1751,16 +1769,7 @@ async def get_version(self, agent_name: str, agent_version: str, **kwargs: Any) @distributed_trace_async async def delete_version( - self, - agent_name: str, - agent_version: str, - *, - foundry_beta: Optional[ - Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] - ] - ] = None, - **kwargs: Any + self, agent_name: str, agent_version: str, **kwargs: Any ) -> _models.DeleteAgentVersionResponse: """Deletes a specific version of an agent. @@ -1768,12 +1777,6 @@ async def delete_version( :type agent_name: str :param agent_version: The version of the agent to delete. Required. :type agent_version: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is either a - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 :return: DeleteAgentVersionResponse. The DeleteAgentVersionResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DeleteAgentVersionResponse @@ -1795,7 +1798,6 @@ async def delete_version( _request = build_agents_delete_version_request( agent_name=agent_name, agent_version=agent_version, - foundry_beta=foundry_beta, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1932,7 +1934,7 @@ async def stream_agent_container_logs( agent_name: str, agent_version: str, *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW]] = None, kind: Optional[Union[str, _models.ContainerLogKind]] = None, replica_name: Optional[str] = None, tail: Optional[int] = None, @@ -1968,9 +1970,9 @@ async def stream_agent_container_logs( :type agent_name: str :param agent_version: The version of the agent. Required. :type agent_version: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. CONTAINER_AGENTS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. CONTAINER_AGENTS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW :keyword kind: console returns container stdout/stderr, system returns container app event stream. defaults to console. Known values are: "console" and "system". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.ContainerLogKind @@ -2000,7 +2002,7 @@ async def stream_agent_container_logs( _request = build_agents_stream_agent_container_logs_request( agent_name=agent_name, agent_version=agent_version, - foundry_beta=foundry_beta, + foundry_features=foundry_features, kind=kind, replica_name=replica_name, tail=tail, @@ -3372,7 +3374,7 @@ async def create( name: str, body: _models.EvaluationTaxonomy, *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -3382,9 +3384,9 @@ async def create( :type name: str :param body: The evaluation taxonomy. Required. :type body: ~azure.ai.projects.models.EvaluationTaxonomy - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3399,7 +3401,7 @@ async def create( name: str, body: JSON, *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -3409,9 +3411,9 @@ async def create( :type name: str :param body: The evaluation taxonomy. Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3426,7 +3428,7 @@ async def create( name: str, body: IO[bytes], *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -3436,9 +3438,9 @@ async def create( :type name: str :param body: The evaluation taxonomy. Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -3453,7 +3455,7 @@ async def create( name: str, body: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -3463,9 +3465,9 @@ async def create( :param body: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, JSON, IO[bytes] Required. :type body: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -3493,7 +3495,7 @@ async def create( _request = build_evaluation_taxonomies_create_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -3537,7 +3539,7 @@ async def update( name: str, body: _models.EvaluationTaxonomy, *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -3547,9 +3549,9 @@ async def update( :type name: str :param body: The evaluation taxonomy. Required. :type body: ~azure.ai.projects.models.EvaluationTaxonomy - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3564,7 +3566,7 @@ async def update( name: str, body: JSON, *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -3574,9 +3576,9 @@ async def update( :type name: str :param body: The evaluation taxonomy. Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3591,7 +3593,7 @@ async def update( name: str, body: IO[bytes], *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -3601,9 +3603,9 @@ async def update( :type name: str :param body: The evaluation taxonomy. Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -3618,7 +3620,7 @@ async def update( name: str, body: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -3628,9 +3630,9 @@ async def update( :param body: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, JSON, IO[bytes] Required. :type body: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -3658,7 +3660,7 @@ async def update( _request = build_evaluation_taxonomies_update_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -4083,7 +4085,7 @@ def list_versions( self, name: str, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, limit: Optional[int] = None, **kwargs: Any @@ -4092,9 +4094,9 @@ def list_versions( :param name: The name of the resource. Required. :type name: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default value is None. @@ -4124,7 +4126,7 @@ def prepare_request(next_link=None): _request = build_evaluators_list_versions_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, type=type, limit=limit, api_version=self._config.api_version, @@ -4188,16 +4190,16 @@ async def get_next(next_link=None): def list_latest_versions( self, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, limit: Optional[int] = None, **kwargs: Any ) -> AsyncItemPaged["_models.EvaluatorVersion"]: """List the latest version of each evaluator. - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default value is None. @@ -4226,7 +4228,7 @@ def prepare_request(next_link=None): if not next_link: _request = build_evaluators_list_latest_versions_request( - foundry_beta=foundry_beta, + foundry_features=foundry_features, type=type, limit=limit, api_version=self._config.api_version, @@ -4288,7 +4290,12 @@ async def get_next(next_link=None): @distributed_trace_async async def get_version( - self, name: str, version: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], **kwargs: Any + self, + name: str, + version: str, + *, + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + **kwargs: Any ) -> _models.EvaluatorVersion: """Get the specific version of the EvaluatorVersion. The service returns 404 Not Found error if the EvaluatorVersion does not exist. @@ -4297,9 +4304,9 @@ async def get_version( :type name: str :param version: The specific version id of the EvaluatorVersion to retrieve. Required. :type version: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -4320,7 +4327,7 @@ async def get_version( _request = build_evaluators_get_version_request( name=name, version=version, - foundry_beta=foundry_beta, + foundry_features=foundry_features, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4358,7 +4365,12 @@ async def get_version( @distributed_trace_async async def delete_version( - self, name: str, version: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], **kwargs: Any + self, + name: str, + version: str, + *, + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + **kwargs: Any ) -> None: """Delete the specific version of the EvaluatorVersion. The service returns 204 No Content if the EvaluatorVersion was deleted successfully or if the EvaluatorVersion does not exist. @@ -4367,9 +4379,9 @@ async def delete_version( :type name: str :param version: The version of the EvaluatorVersion to delete. Required. :type version: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -4390,7 +4402,7 @@ async def delete_version( _request = build_evaluators_delete_version_request( name=name, version=version, - foundry_beta=foundry_beta, + foundry_features=foundry_features, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4420,7 +4432,7 @@ async def create_version( name: str, evaluator_version: _models.EvaluatorVersion, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -4430,9 +4442,9 @@ async def create_version( :type name: str :param evaluator_version: Required. :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4447,7 +4459,7 @@ async def create_version( name: str, evaluator_version: JSON, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -4457,9 +4469,9 @@ async def create_version( :type name: str :param evaluator_version: Required. :type evaluator_version: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4474,7 +4486,7 @@ async def create_version( name: str, evaluator_version: IO[bytes], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -4484,9 +4496,9 @@ async def create_version( :type name: str :param evaluator_version: Required. :type evaluator_version: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -4501,7 +4513,7 @@ async def create_version( name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], **kwargs: Any ) -> _models.EvaluatorVersion: """Create a new EvaluatorVersion with auto incremented version id. @@ -4511,9 +4523,9 @@ async def create_version( :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] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -4541,7 +4553,7 @@ async def create_version( _request = build_evaluators_create_version_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -4586,7 +4598,7 @@ async def update_version( version: str, evaluator_version: _models.EvaluatorVersion, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -4598,9 +4610,9 @@ async def update_version( :type version: str :param evaluator_version: Evaluator resource. Required. :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4616,7 +4628,7 @@ async def update_version( version: str, evaluator_version: JSON, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -4628,9 +4640,9 @@ async def update_version( :type version: str :param evaluator_version: Evaluator resource. Required. :type evaluator_version: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4646,7 +4658,7 @@ async def update_version( version: str, evaluator_version: IO[bytes], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -4658,9 +4670,9 @@ async def update_version( :type version: str :param evaluator_version: Evaluator resource. Required. :type evaluator_version: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -4676,7 +4688,7 @@ async def update_version( version: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], **kwargs: Any ) -> _models.EvaluatorVersion: """Update an existing EvaluatorVersion with the given version id. @@ -4688,9 +4700,9 @@ async def update_version( :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] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -4719,7 +4731,7 @@ async def update_version( _request = build_evaluators_update_version_request( name=name, version=version, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -5231,7 +5243,7 @@ async def generate( self, insight: _models.Insight, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: @@ -5240,9 +5252,9 @@ async def generate( :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. :type insight: ~azure.ai.projects.models.Insight - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5256,7 +5268,7 @@ async def generate( self, insight: JSON, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: @@ -5265,9 +5277,9 @@ async def generate( :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. :type insight: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5281,7 +5293,7 @@ async def generate( self, insight: IO[bytes], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: @@ -5290,9 +5302,9 @@ async def generate( :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. :type insight: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -5306,7 +5318,7 @@ async def generate( self, insight: Union[_models.Insight, JSON, IO[bytes]], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], **kwargs: Any ) -> _models.Insight: """Generate Insights. @@ -5314,9 +5326,9 @@ async def generate( :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] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :return: Insight. The Insight is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: @@ -5343,7 +5355,7 @@ async def generate( _content = json.dumps(insight, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_insights_generate_request( - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -5580,7 +5592,7 @@ def __init__(self, *args, **kwargs) -> None: async def create( self, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], name: str, definition: _models.MemoryStoreDefinition, content_type: str = "application/json", @@ -5590,9 +5602,9 @@ async def create( ) -> _models.MemoryStoreDetails: """Create a memory store. - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -5615,7 +5627,7 @@ async def create( self, body: JSON, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: @@ -5623,9 +5635,9 @@ async def create( :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5639,7 +5651,7 @@ async def create( self, body: IO[bytes], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: @@ -5647,9 +5659,9 @@ async def create( :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -5663,7 +5675,7 @@ async def create( self, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], name: str = _Unset, definition: _models.MemoryStoreDefinition = _Unset, description: Optional[str] = None, @@ -5674,9 +5686,9 @@ async def create( :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -5719,7 +5731,7 @@ async def create( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_memory_stores_create_request( - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -5766,7 +5778,7 @@ async def update( self, name: str, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, @@ -5776,9 +5788,9 @@ async def update( :param name: The name of the memory store to update. Required. :type name: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5798,7 +5810,7 @@ async def update( name: str, body: JSON, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: @@ -5808,9 +5820,9 @@ async def update( :type name: str :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5825,7 +5837,7 @@ async def update( name: str, body: IO[bytes], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: @@ -5835,9 +5847,9 @@ async def update( :type name: str :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -5852,7 +5864,7 @@ async def update( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, **kwargs: Any @@ -5863,9 +5875,9 @@ async def update( :type name: str :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :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 @@ -5901,7 +5913,7 @@ async def update( _request = build_memory_stores_update_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -5945,15 +5957,15 @@ async def update( @distributed_trace_async async def get( - self, name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **kwargs: Any + self, name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any ) -> _models.MemoryStoreDetails: """Retrieve a memory store. :param name: The name of the memory store to retrieve. Required. :type name: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: @@ -5973,7 +5985,7 @@ async def get( _request = build_memory_stores_get_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6017,7 +6029,7 @@ async def get( def list( self, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, @@ -6025,9 +6037,9 @@ def list( ) -> AsyncItemPaged["_models.MemoryStoreDetails"]: """List all memory stores. - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_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. @@ -6062,7 +6074,7 @@ def list( def prepare_request(_continuation_token=None): _request = build_memory_stores_list_request( - foundry_beta=foundry_beta, + foundry_features=foundry_features, limit=limit, order=order, after=_continuation_token, @@ -6107,15 +6119,15 @@ async def get_next(_continuation_token=None): @distributed_trace_async async def delete( - self, name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **kwargs: Any + self, name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any ) -> _models.DeleteMemoryStoreResult: """Delete a memory store. :param name: The name of the memory store to delete. Required. :type name: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :return: DeleteMemoryStoreResult. The DeleteMemoryStoreResult is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DeleteMemoryStoreResult :raises ~azure.core.exceptions.HttpResponseError: @@ -6135,7 +6147,7 @@ async def delete( _request = build_memory_stores_delete_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6180,7 +6192,7 @@ async def search_memories( self, name: str, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str, content_type: str = "application/json", items: Optional[List[_models.InputItem]] = None, @@ -6192,9 +6204,9 @@ async def search_memories( :param name: The name of the memory store to search. Required. :type name: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -6219,7 +6231,7 @@ async def search_memories( name: str, body: JSON, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: @@ -6229,9 +6241,9 @@ async def search_memories( :type name: str :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6246,7 +6258,7 @@ async def search_memories( name: str, body: IO[bytes], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: @@ -6256,9 +6268,9 @@ async def search_memories( :type name: str :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -6273,7 +6285,7 @@ async def search_memories( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str = _Unset, items: Optional[List[_models.InputItem]] = None, previous_search_id: Optional[str] = None, @@ -6286,9 +6298,9 @@ async def search_memories( :type name: str :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -6336,7 +6348,7 @@ async def search_memories( _request = build_memory_stores_search_memories_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -6383,7 +6395,7 @@ async def _update_memories_initial( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str = _Unset, items: Optional[List[_models.InputItem]] = None, previous_update_id: Optional[str] = None, @@ -6423,7 +6435,7 @@ async def _update_memories_initial( _request = build_memory_stores_update_memories_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -6469,7 +6481,7 @@ async def _begin_update_memories( self, name: str, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str, content_type: str = "application/json", items: Optional[List[_models.InputItem]] = None, @@ -6483,7 +6495,7 @@ async def _begin_update_memories( name: str, body: JSON, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @@ -6493,7 +6505,7 @@ async def _begin_update_memories( name: str, body: IO[bytes], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @@ -6504,7 +6516,7 @@ async def _begin_update_memories( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str = _Unset, items: Optional[List[_models.InputItem]] = None, previous_update_id: Optional[str] = None, @@ -6517,9 +6529,9 @@ async def _begin_update_memories( :type name: str :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -6552,7 +6564,7 @@ async def _begin_update_memories( raw_result = await self._update_memories_initial( name=name, body=body, - foundry_beta=foundry_beta, + foundry_features=foundry_features, scope=scope, items=items, previous_update_id=previous_update_id, @@ -6607,7 +6619,7 @@ async def delete_scope( self, name: str, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str, content_type: str = "application/json", **kwargs: Any @@ -6616,9 +6628,9 @@ async def delete_scope( :param name: The name of the memory store. Required. :type name: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -6637,7 +6649,7 @@ async def delete_scope( name: str, body: JSON, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: @@ -6647,9 +6659,9 @@ async def delete_scope( :type name: str :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6665,7 +6677,7 @@ async def delete_scope( name: str, body: IO[bytes], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: @@ -6675,9 +6687,9 @@ async def delete_scope( :type name: str :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -6693,7 +6705,7 @@ async def delete_scope( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str = _Unset, **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: @@ -6703,9 +6715,9 @@ async def delete_scope( :type name: str :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -6742,7 +6754,7 @@ async def delete_scope( _request = build_memory_stores_delete_scope_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -6954,7 +6966,7 @@ async def create( self, red_team: _models.RedTeam, *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: @@ -6962,9 +6974,9 @@ async def create( :param red_team: Redteam to be run. Required. :type red_team: ~azure.ai.projects.models.RedTeam - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. RED_TEAMS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.RED_TEAMS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. RED_TEAMS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6978,7 +6990,7 @@ async def create( self, red_team: JSON, *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: @@ -6986,9 +6998,9 @@ async def create( :param red_team: Redteam to be run. Required. :type red_team: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. RED_TEAMS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.RED_TEAMS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. RED_TEAMS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7002,7 +7014,7 @@ async def create( self, red_team: IO[bytes], *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: @@ -7010,9 +7022,9 @@ async def create( :param red_team: Redteam to be run. Required. :type red_team: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. RED_TEAMS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.RED_TEAMS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. RED_TEAMS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -7026,7 +7038,7 @@ async def create( self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, **kwargs: Any ) -> _models.RedTeam: """Creates a redteam run. @@ -7034,9 +7046,9 @@ async def create( :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] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. RED_TEAMS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.RED_TEAMS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. RED_TEAMS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW :return: RedTeam. The RedTeam is compatible with MutableMapping :rtype: ~azure.ai.projects.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: @@ -7063,7 +7075,7 @@ async def create( _content = json.dumps(red_team, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_red_teams_create_request( - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -7463,7 +7475,7 @@ async def get_run( schedule_id: str, run_id: str, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], **kwargs: Any ) -> _models.ScheduleRun: """Get a schedule run by id. @@ -7472,9 +7484,9 @@ async def get_run( :type schedule_id: str :param run_id: The unique identifier of the schedule run. Required. :type run_id: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :return: ScheduleRun. The ScheduleRun is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ScheduleRun :raises ~azure.core.exceptions.HttpResponseError: @@ -7495,7 +7507,7 @@ async def get_run( _request = build_schedules_get_run_request( schedule_id=schedule_id, run_id=run_id, - foundry_beta=foundry_beta, + foundry_features=foundry_features, api_version=self._config.api_version, headers=_headers, params=_params, 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 342360a55764..d2c39425059f 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 @@ -82,6 +82,7 @@ ContainerAppAgentDefinition, ContainerFileCitationBody, ContinuousEvaluationRuleAction, + ConversationReference, CosmosDBIndex, CronTrigger, CustomCredential, @@ -156,7 +157,9 @@ InputContentInputFileContent, InputContentInputImageContent, InputContentInputTextContent, + InputFileContent, InputFileContentParam, + InputImageContent, InputImageContentParamAutoParam, InputItem, InputItemApplyPatchToolCallItemParam, @@ -183,6 +186,7 @@ InputItemReasoningItem, InputItemWebSearchToolCall, InputMessageResource, + InputTextContent, InputTextContentParam, Insight, InsightCluster, @@ -240,6 +244,7 @@ MemoryStoreSearchResult, MemoryStoreUpdateCompletedResult, MemoryStoreUpdateResult, + Metadata, MicrosoftFabricPreviewTool, ModelDeployment, ModelDeploymentSku, @@ -247,7 +252,7 @@ MonthlyRecurrenceSchedule, Move, NoAuthenticationCredentials, - OAuthConsentRequestItemResource, + OAuthConsentRequestOutputItem, OneTimeTrigger, OpenApiAnonymousAuthDetails, OpenApiAuthDetails, @@ -259,11 +264,34 @@ OpenApiProjectConnectionSecurityScheme, OpenApiTool, OutputContent, + OutputContentOutputTextContent, + OutputContentReasoningTextContent, + OutputContentRefusalContent, + OutputItem, + OutputItemApplyPatchToolCall, + OutputItemApplyPatchToolCallOutput, + OutputItemCodeInterpreterToolCall, + OutputItemCompactionBody, + OutputItemComputerToolCall, + OutputItemCustomToolCall, + OutputItemFileSearchToolCall, + OutputItemFunctionShellCall, + OutputItemFunctionShellCallOutput, + OutputItemFunctionToolCall, + OutputItemImageGenToolCall, + OutputItemLocalShellToolCall, + OutputItemMcpApprovalRequest, + OutputItemMcpListTools, + OutputItemMcpToolCall, + OutputItemOutputMessage, + OutputItemReasoningItem, + OutputItemWebSearchToolCall, OutputMessageContent, OutputMessageContentOutputTextContent, OutputMessageContentRefusalContent, PendingUploadRequest, PendingUploadResponse, + Prompt, PromptAgentDefinition, PromptAgentDefinitionTextOptions, PromptBasedEvaluatorDefinition, @@ -275,8 +303,71 @@ RecurrenceSchedule, RecurrenceTrigger, RedTeam, + Response, + ResponseAudioDeltaEvent, + ResponseAudioDoneEvent, + ResponseAudioTranscriptDeltaEvent, + ResponseAudioTranscriptDoneEvent, + ResponseCodeInterpreterCallCodeDeltaEvent, + ResponseCodeInterpreterCallCodeDoneEvent, + ResponseCodeInterpreterCallCompletedEvent, + ResponseCodeInterpreterCallInProgressEvent, + ResponseCodeInterpreterCallInterpretingEvent, + ResponseCompletedEvent, + ResponseContentPartAddedEvent, + ResponseContentPartDoneEvent, + ResponseCreatedEvent, + ResponseCustomToolCallInputDeltaEvent, + ResponseCustomToolCallInputDoneEvent, + ResponseError, + ResponseErrorEvent, + ResponseFailedEvent, + ResponseFileSearchCallCompletedEvent, + ResponseFileSearchCallInProgressEvent, + ResponseFileSearchCallSearchingEvent, + ResponseFunctionCallArgumentsDeltaEvent, + ResponseFunctionCallArgumentsDoneEvent, + ResponseImageGenCallCompletedEvent, + ResponseImageGenCallGeneratingEvent, + ResponseImageGenCallInProgressEvent, + ResponseImageGenCallPartialImageEvent, + ResponseInProgressEvent, + ResponseIncompleteDetails, + ResponseIncompleteEvent, + ResponseLogProb, + ResponseLogProbTopLogprobs, + ResponseMCPCallArgumentsDeltaEvent, + ResponseMCPCallArgumentsDoneEvent, + ResponseMCPCallCompletedEvent, + ResponseMCPCallFailedEvent, + ResponseMCPCallInProgressEvent, + ResponseMCPListToolsCompletedEvent, + ResponseMCPListToolsFailedEvent, + ResponseMCPListToolsInProgressEvent, + ResponseOutputItemAddedEvent, + ResponseOutputItemDoneEvent, + ResponseOutputTextAnnotationAddedEvent, + ResponsePromptVariables, + ResponseQueuedEvent, + ResponseReasoningSummaryPartAddedEvent, + ResponseReasoningSummaryPartAddedEventPart, + ResponseReasoningSummaryPartDoneEvent, + ResponseReasoningSummaryPartDoneEventPart, + ResponseReasoningSummaryTextDeltaEvent, + ResponseReasoningSummaryTextDoneEvent, + ResponseReasoningTextDeltaEvent, + ResponseReasoningTextDoneEvent, + ResponseRefusalDeltaEvent, + ResponseRefusalDoneEvent, + ResponseTextDeltaEvent, + ResponseTextDoneEvent, + ResponseTextParam, + ResponseUsage, ResponseUsageInputTokensDetails, ResponseUsageOutputTokensDetails, + ResponseWebSearchCallCompletedEvent, + ResponseWebSearchCallInProgressEvent, + ResponseWebSearchCallSearchingEvent, SASCredentials, Schedule, ScheduleRun, @@ -289,7 +380,7 @@ SpecificFunctionShellParam, StructuredInputDefinition, StructuredOutputDefinition, - StructuredOutputsItemResource, + StructuredOutputsOutputItem, Summary, Target, TargetConfig, @@ -331,7 +422,7 @@ WebSearchToolFilters, WeeklyRecurrenceSchedule, WorkflowAgentDefinition, - WorkflowPreviewActionOutputItemResource, + WorkflowPreviewActionOutputItem, ) from ._enums import ( # type: ignore @@ -366,7 +457,7 @@ EvaluatorMetricDirection, EvaluatorMetricType, EvaluatorType, - FoundryPreviewOptInKeys, + FoundryFeaturesOptInKeys, FunctionAndCustomToolCallOutputType, FunctionCallItemStatus, FunctionShellCallItemStatus, @@ -389,17 +480,20 @@ OpenApiAuthType, OperationState, OutputContentType, + OutputItemType, OutputMessageContentType, PageOrder, PendingUploadType, RankerVersionType, RecurrenceType, + ResponseErrorCode, RiskCategory, SampleType, ScheduleProvisioningStatus, ScheduleTaskType, SearchContextSize, TextResponseFormatConfigurationType, + ToolChoiceOptions, ToolChoiceParamType, ToolType, TreatmentEffectType, @@ -478,6 +572,7 @@ "ContainerAppAgentDefinition", "ContainerFileCitationBody", "ContinuousEvaluationRuleAction", + "ConversationReference", "CosmosDBIndex", "CronTrigger", "CustomCredential", @@ -552,7 +647,9 @@ "InputContentInputFileContent", "InputContentInputImageContent", "InputContentInputTextContent", + "InputFileContent", "InputFileContentParam", + "InputImageContent", "InputImageContentParamAutoParam", "InputItem", "InputItemApplyPatchToolCallItemParam", @@ -579,6 +676,7 @@ "InputItemReasoningItem", "InputItemWebSearchToolCall", "InputMessageResource", + "InputTextContent", "InputTextContentParam", "Insight", "InsightCluster", @@ -636,6 +734,7 @@ "MemoryStoreSearchResult", "MemoryStoreUpdateCompletedResult", "MemoryStoreUpdateResult", + "Metadata", "MicrosoftFabricPreviewTool", "ModelDeployment", "ModelDeploymentSku", @@ -643,7 +742,7 @@ "MonthlyRecurrenceSchedule", "Move", "NoAuthenticationCredentials", - "OAuthConsentRequestItemResource", + "OAuthConsentRequestOutputItem", "OneTimeTrigger", "OpenApiAnonymousAuthDetails", "OpenApiAuthDetails", @@ -655,11 +754,34 @@ "OpenApiProjectConnectionSecurityScheme", "OpenApiTool", "OutputContent", + "OutputContentOutputTextContent", + "OutputContentReasoningTextContent", + "OutputContentRefusalContent", + "OutputItem", + "OutputItemApplyPatchToolCall", + "OutputItemApplyPatchToolCallOutput", + "OutputItemCodeInterpreterToolCall", + "OutputItemCompactionBody", + "OutputItemComputerToolCall", + "OutputItemCustomToolCall", + "OutputItemFileSearchToolCall", + "OutputItemFunctionShellCall", + "OutputItemFunctionShellCallOutput", + "OutputItemFunctionToolCall", + "OutputItemImageGenToolCall", + "OutputItemLocalShellToolCall", + "OutputItemMcpApprovalRequest", + "OutputItemMcpListTools", + "OutputItemMcpToolCall", + "OutputItemOutputMessage", + "OutputItemReasoningItem", + "OutputItemWebSearchToolCall", "OutputMessageContent", "OutputMessageContentOutputTextContent", "OutputMessageContentRefusalContent", "PendingUploadRequest", "PendingUploadResponse", + "Prompt", "PromptAgentDefinition", "PromptAgentDefinitionTextOptions", "PromptBasedEvaluatorDefinition", @@ -671,8 +793,71 @@ "RecurrenceSchedule", "RecurrenceTrigger", "RedTeam", + "Response", + "ResponseAudioDeltaEvent", + "ResponseAudioDoneEvent", + "ResponseAudioTranscriptDeltaEvent", + "ResponseAudioTranscriptDoneEvent", + "ResponseCodeInterpreterCallCodeDeltaEvent", + "ResponseCodeInterpreterCallCodeDoneEvent", + "ResponseCodeInterpreterCallCompletedEvent", + "ResponseCodeInterpreterCallInProgressEvent", + "ResponseCodeInterpreterCallInterpretingEvent", + "ResponseCompletedEvent", + "ResponseContentPartAddedEvent", + "ResponseContentPartDoneEvent", + "ResponseCreatedEvent", + "ResponseCustomToolCallInputDeltaEvent", + "ResponseCustomToolCallInputDoneEvent", + "ResponseError", + "ResponseErrorEvent", + "ResponseFailedEvent", + "ResponseFileSearchCallCompletedEvent", + "ResponseFileSearchCallInProgressEvent", + "ResponseFileSearchCallSearchingEvent", + "ResponseFunctionCallArgumentsDeltaEvent", + "ResponseFunctionCallArgumentsDoneEvent", + "ResponseImageGenCallCompletedEvent", + "ResponseImageGenCallGeneratingEvent", + "ResponseImageGenCallInProgressEvent", + "ResponseImageGenCallPartialImageEvent", + "ResponseInProgressEvent", + "ResponseIncompleteDetails", + "ResponseIncompleteEvent", + "ResponseLogProb", + "ResponseLogProbTopLogprobs", + "ResponseMCPCallArgumentsDeltaEvent", + "ResponseMCPCallArgumentsDoneEvent", + "ResponseMCPCallCompletedEvent", + "ResponseMCPCallFailedEvent", + "ResponseMCPCallInProgressEvent", + "ResponseMCPListToolsCompletedEvent", + "ResponseMCPListToolsFailedEvent", + "ResponseMCPListToolsInProgressEvent", + "ResponseOutputItemAddedEvent", + "ResponseOutputItemDoneEvent", + "ResponseOutputTextAnnotationAddedEvent", + "ResponsePromptVariables", + "ResponseQueuedEvent", + "ResponseReasoningSummaryPartAddedEvent", + "ResponseReasoningSummaryPartAddedEventPart", + "ResponseReasoningSummaryPartDoneEvent", + "ResponseReasoningSummaryPartDoneEventPart", + "ResponseReasoningSummaryTextDeltaEvent", + "ResponseReasoningSummaryTextDoneEvent", + "ResponseReasoningTextDeltaEvent", + "ResponseReasoningTextDoneEvent", + "ResponseRefusalDeltaEvent", + "ResponseRefusalDoneEvent", + "ResponseTextDeltaEvent", + "ResponseTextDoneEvent", + "ResponseTextParam", + "ResponseUsage", "ResponseUsageInputTokensDetails", "ResponseUsageOutputTokensDetails", + "ResponseWebSearchCallCompletedEvent", + "ResponseWebSearchCallInProgressEvent", + "ResponseWebSearchCallSearchingEvent", "SASCredentials", "Schedule", "ScheduleRun", @@ -685,7 +870,7 @@ "SpecificFunctionShellParam", "StructuredInputDefinition", "StructuredOutputDefinition", - "StructuredOutputsItemResource", + "StructuredOutputsOutputItem", "Summary", "Target", "TargetConfig", @@ -727,7 +912,7 @@ "WebSearchToolFilters", "WeeklyRecurrenceSchedule", "WorkflowAgentDefinition", - "WorkflowPreviewActionOutputItemResource", + "WorkflowPreviewActionOutputItem", "AgentKind", "AgentProtocol", "AnnotationType", @@ -759,7 +944,7 @@ "EvaluatorMetricDirection", "EvaluatorMetricType", "EvaluatorType", - "FoundryPreviewOptInKeys", + "FoundryFeaturesOptInKeys", "FunctionAndCustomToolCallOutputType", "FunctionCallItemStatus", "FunctionShellCallItemStatus", @@ -782,17 +967,20 @@ "OpenApiAuthType", "OperationState", "OutputContentType", + "OutputItemType", "OutputMessageContentType", "PageOrder", "PendingUploadType", "RankerVersionType", "RecurrenceType", + "ResponseErrorCode", "RiskCategory", "SampleType", "ScheduleProvisioningStatus", "ScheduleTaskType", "SearchContextSize", "TextResponseFormatConfigurationType", + "ToolChoiceOptions", "ToolChoiceParamType", "ToolType", "TreatmentEffectType", 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 ac757d285013..c4f8ed609fa7 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 @@ -448,23 +448,23 @@ class EvaluatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Custom evaluator.""" -class FoundryPreviewOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of FoundryPreviewOptInKeys.""" - - CONTAINER_AGENTS_V1 = "ContainerAgents=v1" - """CONTAINER_AGENTS_V1.""" - HOSTED_AGENTS_V1 = "HostedAgents=v1" - """HOSTED_AGENTS_V1.""" - WORKFLOW_AGENTS_V1 = "WorkflowAgents=v1" - """WORKFLOW_AGENTS_V1.""" - EVALUATIONS_V1 = "Evaluations=v1" - """EVALUATIONS_V1.""" - RED_TEAMS_V1 = "RedTeams=v1" - """RED_TEAMS_V1.""" - INSIGHTS_V1 = "Insights=v1" - """INSIGHTS_V1.""" - MEMORY_STORES_V1 = "MemoryStores=v1" - """MEMORY_STORES_V1.""" +class FoundryFeaturesOptInKeys(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of FoundryFeaturesOptInKeys.""" + + CONTAINER_AGENTS_V1_PREVIEW = "ContainerAgents=V1Preview" + """CONTAINER_AGENTS_V1_PREVIEW.""" + HOSTED_AGENTS_V1_PREVIEW = "HostedAgents=V1Preview" + """HOSTED_AGENTS_V1_PREVIEW.""" + WORKFLOW_AGENTS_V1_PREVIEW = "WorkflowAgents=V1Preview" + """WORKFLOW_AGENTS_V1_PREVIEW.""" + EVALUATIONS_V1_PREVIEW = "Evaluations=V1Preview" + """EVALUATIONS_V1_PREVIEW.""" + RED_TEAMS_V1_PREVIEW = "RedTeams=V1Preview" + """RED_TEAMS_V1_PREVIEW.""" + INSIGHTS_V1_PREVIEW = "Insights=V1Preview" + """INSIGHTS_V1_PREVIEW.""" + MEMORY_STORES_V1_PREVIEW = "MemoryStores=V1Preview" + """MEMORY_STORES_V1_PREVIEW.""" class FunctionAndCustomToolCallOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -687,8 +687,8 @@ class ItemResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """OAUTH_CONSENT_REQUEST.""" MEMORY_SEARCH_CALL = "memory_search_call" """MEMORY_SEARCH_CALL.""" - WORKFLOW_PREVIEW_ACTION = "workflow_preview_action" - """WORKFLOW_PREVIEW_ACTION.""" + WORKFLOW_ACTION = "workflow_action" + """WORKFLOW_ACTION.""" class LocalShellCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -801,6 +801,55 @@ class OutputContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """REASONING_TEXT.""" +class OutputItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of OutputItemType.""" + + OUTPUT_MESSAGE = "output_message" + """OUTPUT_MESSAGE.""" + FILE_SEARCH_CALL = "file_search_call" + """FILE_SEARCH_CALL.""" + FUNCTION_CALL = "function_call" + """FUNCTION_CALL.""" + WEB_SEARCH_CALL = "web_search_call" + """WEB_SEARCH_CALL.""" + COMPUTER_CALL = "computer_call" + """COMPUTER_CALL.""" + REASONING = "reasoning" + """REASONING.""" + COMPACTION = "compaction" + """COMPACTION.""" + IMAGE_GENERATION_CALL = "image_generation_call" + """IMAGE_GENERATION_CALL.""" + CODE_INTERPRETER_CALL = "code_interpreter_call" + """CODE_INTERPRETER_CALL.""" + LOCAL_SHELL_CALL = "local_shell_call" + """LOCAL_SHELL_CALL.""" + SHELL_CALL = "shell_call" + """SHELL_CALL.""" + SHELL_CALL_OUTPUT = "shell_call_output" + """SHELL_CALL_OUTPUT.""" + APPLY_PATCH_CALL = "apply_patch_call" + """APPLY_PATCH_CALL.""" + APPLY_PATCH_CALL_OUTPUT = "apply_patch_call_output" + """APPLY_PATCH_CALL_OUTPUT.""" + MCP_CALL = "mcp_call" + """MCP_CALL.""" + MCP_LIST_TOOLS = "mcp_list_tools" + """MCP_LIST_TOOLS.""" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + """MCP_APPROVAL_REQUEST.""" + CUSTOM_TOOL_CALL = "custom_tool_call" + """CUSTOM_TOOL_CALL.""" + STRUCTURED_OUTPUTS = "structured_outputs" + """STRUCTURED_OUTPUTS.""" + OAUTH_CONSENT_REQUEST = "oauth_consent_request" + """OAUTH_CONSENT_REQUEST.""" + MEMORY_SEARCH_CALL = "memory_search_call" + """MEMORY_SEARCH_CALL.""" + WORKFLOW_ACTION = "workflow_action" + """WORKFLOW_ACTION.""" + + class OutputMessageContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of OutputMessageContentType.""" @@ -850,6 +899,47 @@ class RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Monthly recurrence pattern.""" +class ResponseErrorCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The error code for the response.""" + + SERVER_ERROR = "server_error" + """SERVER_ERROR.""" + RATE_LIMIT_EXCEEDED = "rate_limit_exceeded" + """RATE_LIMIT_EXCEEDED.""" + INVALID_PROMPT = "invalid_prompt" + """INVALID_PROMPT.""" + VECTOR_STORE_TIMEOUT = "vector_store_timeout" + """VECTOR_STORE_TIMEOUT.""" + INVALID_IMAGE = "invalid_image" + """INVALID_IMAGE.""" + INVALID_IMAGE_FORMAT = "invalid_image_format" + """INVALID_IMAGE_FORMAT.""" + INVALID_BASE64_IMAGE = "invalid_base64_image" + """INVALID_BASE64_IMAGE.""" + INVALID_IMAGE_URL = "invalid_image_url" + """INVALID_IMAGE_URL.""" + IMAGE_TOO_LARGE = "image_too_large" + """IMAGE_TOO_LARGE.""" + IMAGE_TOO_SMALL = "image_too_small" + """IMAGE_TOO_SMALL.""" + IMAGE_PARSE_ERROR = "image_parse_error" + """IMAGE_PARSE_ERROR.""" + IMAGE_CONTENT_POLICY_VIOLATION = "image_content_policy_violation" + """IMAGE_CONTENT_POLICY_VIOLATION.""" + INVALID_IMAGE_MODE = "invalid_image_mode" + """INVALID_IMAGE_MODE.""" + IMAGE_FILE_TOO_LARGE = "image_file_too_large" + """IMAGE_FILE_TOO_LARGE.""" + UNSUPPORTED_IMAGE_MEDIA_TYPE = "unsupported_image_media_type" + """UNSUPPORTED_IMAGE_MEDIA_TYPE.""" + EMPTY_IMAGE_FILE = "empty_image_file" + """EMPTY_IMAGE_FILE.""" + FAILED_TO_DOWNLOAD_IMAGE = "failed_to_download_image" + """FAILED_TO_DOWNLOAD_IMAGE.""" + IMAGE_FILE_NOT_FOUND = "image_file_not_found" + """IMAGE_FILE_NOT_FOUND.""" + + class RiskCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Risk category for the attack objective.""" @@ -928,6 +1018,17 @@ class TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEn """JSON_OBJECT.""" +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.""" 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 9bd3ccd9367e..8191caa3b78f 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 @@ -37,6 +37,7 @@ MemoryStoreKind, OpenApiAuthType, OutputContentType, + OutputItemType, OutputMessageContentType, PendingUploadType, RecurrenceType, @@ -3210,6 +3211,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = EvaluationRuleActionType.CONTINUOUS_EVALUATION # type: ignore +class ConversationReference(_Model): + """Conversation. + + :ivar id: The unique ID of the conversation that this response was associated with. Required. + :vartype id: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the conversation that this response was associated with. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class CosmosDBIndex(Index, discriminator="CosmosDBNoSqlVectorStore"): """CosmosDB Vector Store Index Definition. @@ -4168,9 +4197,9 @@ class Error(_Model): :vartype code: str :ivar message: Required. :vartype message: str - :ivar param: Required. + :ivar param: :vartype param: str - :ivar type: Required. + :ivar type: :vartype type: str :ivar details: :vartype details: list[~azure.ai.projects.models.Error] @@ -4184,10 +4213,8 @@ class Error(_Model): """Required.""" message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" - param: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - type: 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"] @@ -4202,8 +4229,8 @@ def __init__( *, code: str, message: str, - param: str, - type: 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, @@ -6470,6 +6497,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = InputContentType.INPUT_TEXT # type: ignore +class InputFileContent(_Model): + """Input file. + + :ivar type: The type of the input item. Always ``input_file``. Required. Default value is + "input_file". + :vartype type: str + :ivar file_id: + :vartype file_id: str + :ivar filename: The name of the file to be sent to the model. + :vartype filename: str + :ivar file_url: The URL of the file to be sent to the model. + :vartype file_url: str + :ivar file_data: The content of the file to be sent to the model. + :vartype file_data: str + """ + + type: Literal["input_file"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the input item. Always ``input_file``. Required. Default value is \"input_file\".""" + file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + filename: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the file to be sent to the model.""" + file_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL of the file to be sent to the model.""" + file_data: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The content of the file to be sent to the model.""" + + @overload + def __init__( + self, + *, + file_id: Optional[str] = None, + filename: Optional[str] = None, + file_url: Optional[str] = None, + file_data: 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["input_file"] = "input_file" + + class InputFileContentParam(_Model): """Input file. @@ -6515,6 +6590,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["input_file"] = "input_file" +class InputImageContent(_Model): + """Input image. + + :ivar type: The type of the input item. Always ``input_image``. Required. Default value is + "input_image". + :vartype type: str + :ivar image_url: + :vartype image_url: str + :ivar file_id: + :vartype file_id: str + :ivar detail: The detail level of the image to be sent to the model. One of ``high``, ``low``, + or ``auto``. Defaults to ``auto``. Required. Known values are: "low", "high", and "auto". + :vartype detail: str or ~azure.ai.projects.models.ImageDetail + """ + + type: Literal["input_image"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the input item. Always ``input_image``. Required. Default value is \"input_image\".""" + image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + detail: Union[str, "_models.ImageDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The detail level of the image to be sent to the model. One of ``high``, ``low``, or ``auto``. + Defaults to ``auto``. Required. Known values are: \"low\", \"high\", and \"auto\".""" + + @overload + def __init__( + self, + *, + detail: Union[str, "_models.ImageDetail"], + 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) + self.type: Literal["input_image"] = "input_image" + + class InputImageContentParamAutoParam(_Model): """Input image. @@ -7830,10 +7949,8 @@ class ItemResource(_Model): ItemResourceImageGenToolCall, ItemResourceLocalShellToolCall, ItemResourceLocalShellToolCallOutput, ItemResourceMcpApprovalRequest, ItemResourceMcpApprovalResponseResource, ItemResourceMcpToolCall, ItemResourceMcpListTools, - MemorySearchToolCallItemResource, InputMessageResource, OAuthConsentRequestItemResource, - ItemResourceOutputMessage, ItemResourceFunctionShellCall, ItemResourceFunctionShellCallOutput, - StructuredOutputsItemResource, ItemResourceWebSearchToolCall, - WorkflowPreviewActionOutputItemResource + InputMessageResource, ItemResourceOutputMessage, ItemResourceFunctionShellCall, + ItemResourceFunctionShellCallOutput, ItemResourceWebSearchToolCall :ivar type: Required. Known values are: "message", "output_message", "file_search_call", "computer_call", "computer_call_output", "web_search_call", "function_call", @@ -7841,12 +7958,8 @@ class ItemResource(_Model): "local_shell_call_output", "shell_call", "shell_call_output", "apply_patch_call", "apply_patch_call_output", "mcp_list_tools", "mcp_approval_request", "mcp_approval_response", "mcp_call", "structured_outputs", "oauth_consent_request", "memory_search_call", and - "workflow_preview_action". + "workflow_action". :vartype type: str or ~azure.ai.projects.models.ItemResourceType - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str """ __mapping__: dict[str, _Model] = {} @@ -7857,21 +7970,13 @@ class ItemResource(_Model): \"local_shell_call\", \"local_shell_call_output\", \"shell_call\", \"shell_call_output\", \"apply_patch_call\", \"apply_patch_call_output\", \"mcp_list_tools\", \"mcp_approval_request\", \"mcp_approval_response\", \"mcp_call\", \"structured_outputs\", - \"oauth_consent_request\", \"memory_search_call\", and \"workflow_preview_action\".""" - agent_reference: Optional["_models.AgentReference"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The agent that created the item.""" - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The response on which the item is created.""" + \"oauth_consent_request\", \"memory_search_call\", and \"workflow_action\".""" @overload def __init__( self, *, type: str, - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, ) -> None: ... @overload @@ -7888,10 +7993,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class InputMessageResource(ItemResource, discriminator="message"): """InputMessageResource. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str :ivar type: The type of the message input. Always set to ``message``. Required. MESSAGE. :vartype type: str or ~azure.ai.projects.models.MESSAGE :ivar role: The role of the message input. One of ``user``, ``system``, or ``developer``. @@ -7933,8 +8034,6 @@ def __init__( role: Literal["user", "system", "developer"], content: list["_models.InputContent"], id: str, # pylint: disable=redefined-builtin - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, ) -> None: ... @@ -7950,6 +8049,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ItemResourceType.MESSAGE # type: ignore +class InputTextContent(_Model): + """Input text. + + :ivar type: The type of the input item. Always ``input_text``. Required. Default value is + "input_text". + :vartype type: str + :ivar text: The text input to the model. Required. + :vartype text: str + """ + + type: Literal["input_text"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the input item. Always ``input_text``. Required. Default value is \"input_text\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text input to the model. Required.""" + + @overload + def __init__( + self, + *, + 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["input_text"] = "input_text" + + class InputTextContentParam(_Model): """Input text. @@ -8300,10 +8433,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceApplyPatchToolCall(ItemResource, discriminator="apply_patch_call"): """Apply patch tool call. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str :ivar type: The type of the item. Always ``apply_patch_call``. Required. APPLY_PATCH_CALL. :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH_CALL :ivar id: The unique ID of the apply patch tool call. Populated when this item is returned via @@ -8349,8 +8478,6 @@ def __init__( call_id: str, status: Union[str, "_models.ApplyPatchCallStatus"], operation: "_models.ApplyPatchFileOperation", - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, created_by: Optional[str] = None, ) -> None: ... @@ -8369,10 +8496,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceApplyPatchToolCallOutput(ItemResource, discriminator="apply_patch_call_output"): """Apply patch tool call output. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str :ivar type: The type of the item. Always ``apply_patch_call_output``. Required. APPLY_PATCH_CALL_OUTPUT. :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH_CALL_OUTPUT @@ -8413,8 +8536,6 @@ def __init__( id: str, # pylint: disable=redefined-builtin call_id: str, status: Union[str, "_models.ApplyPatchCallOutputStatus"], - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, output: Optional[str] = None, created_by: Optional[str] = None, ) -> None: ... @@ -8434,10 +8555,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceCodeInterpreterToolCall(ItemResource, discriminator="code_interpreter_call"): """Code interpreter tool call. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str :ivar type: The type of the code interpreter tool call. Always ``code_interpreter_call``. Required. CODE_INTERPRETER_CALL. :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER_CALL @@ -8487,8 +8604,6 @@ def __init__( container_id: str, code: str, outputs: list[Union["_models.CodeInterpreterOutputLogs", "_models.CodeInterpreterOutputImage"]], - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, ) -> None: ... @overload @@ -8506,10 +8621,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceComputerToolCall(ItemResource, discriminator="computer_call"): """Computer tool call. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str :ivar type: The type of the computer call. Always ``computer_call``. Required. COMPUTER_CALL. :vartype type: str or ~azure.ai.projects.models.COMPUTER_CALL :ivar id: The unique ID of the computer call. Required. @@ -8554,8 +8665,6 @@ def __init__( action: "_models.ComputerAction", pending_safety_checks: list["_models.ComputerCallSafetyCheckParam"], status: Literal["in_progress", "completed", "incomplete"], - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, ) -> None: ... @overload @@ -8575,10 +8684,6 @@ class ItemResourceComputerToolCallOutputResource( ): # pylint: disable=name-too-long """ItemResourceComputerToolCallOutputResource. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str :ivar type: The type of the computer tool call output. Always ``computer_call_output``. Required. COMPUTER_CALL_OUTPUT. :vartype type: str or ~azure.ai.projects.models.COMPUTER_CALL_OUTPUT @@ -8624,8 +8729,6 @@ def __init__( *, call_id: str, output: "_models.ComputerScreenshotImage", - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, id: Optional[str] = None, # pylint: disable=redefined-builtin acknowledged_safety_checks: Optional[list["_models.ComputerCallSafetyCheckParam"]] = None, status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, @@ -8646,10 +8749,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceFileSearchToolCall(ItemResource, discriminator="file_search_call"): """File search tool call. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str :ivar id: The unique ID of the file search tool call. Required. :vartype id: str :ivar type: The type of the file search tool call. Always ``file_search_call``. Required. @@ -8688,8 +8787,6 @@ def __init__( id: str, # pylint: disable=redefined-builtin status: Literal["in_progress", "searching", "completed", "incomplete", "failed"], queries: list[str], - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, results: Optional[list["_models.FileSearchToolCallResults"]] = None, ) -> None: ... @@ -8708,10 +8805,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceFunctionShellCall(ItemResource, discriminator="shell_call"): """Shell tool call. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str :ivar type: The type of the item. Always ``shell_call``. Required. SHELL_CALL. :vartype type: str or ~azure.ai.projects.models.SHELL_CALL :ivar id: The unique ID of the shell tool call. Populated when this item is returned via API. @@ -8752,8 +8845,6 @@ def __init__( call_id: str, action: "_models.FunctionShellAction", status: Union[str, "_models.LocalShellCallStatus"], - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, created_by: Optional[str] = None, ) -> None: ... @@ -8772,10 +8863,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceFunctionShellCallOutput(ItemResource, discriminator="shell_call_output"): """Shell call output. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str :ivar type: The type of the shell call output. Always ``shell_call_output``. Required. SHELL_CALL_OUTPUT. :vartype type: str or ~azure.ai.projects.models.SHELL_CALL_OUTPUT @@ -8815,8 +8902,6 @@ def __init__( call_id: str, output: list["_models.FunctionShellCallOutputContent"], max_output_length: int, - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, created_by: Optional[str] = None, ) -> None: ... @@ -8837,10 +8922,6 @@ class ItemResourceFunctionToolCallOutputResource( ): # pylint: disable=name-too-long """ItemResourceFunctionToolCallOutputResource. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str :ivar id: The unique ID of the function tool call output. Populated when this item is returned via API. :vartype id: str @@ -8884,8 +8965,6 @@ def __init__( *, call_id: str, output: Union[str, list["_models.FunctionAndCustomToolCallOutput"]], - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, id: Optional[str] = None, # pylint: disable=redefined-builtin status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, ) -> None: ... @@ -8905,10 +8984,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceFunctionToolCallResource(ItemResource, discriminator="function_call"): """ItemResourceFunctionToolCallResource. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str :ivar id: The unique ID of the function tool call. :vartype id: str :ivar type: The type of the function tool call. Always ``function_call``. Required. @@ -8950,8 +9025,6 @@ def __init__( call_id: str, name: str, arguments: str, - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, id: Optional[str] = None, # pylint: disable=redefined-builtin status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, ) -> None: ... @@ -8971,10 +9044,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceImageGenToolCall(ItemResource, discriminator="image_generation_call"): """Image generation call. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str :ivar type: The type of the image generation call. Always ``image_generation_call``. Required. IMAGE_GENERATION_CALL. :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION_CALL @@ -9007,8 +9076,6 @@ def __init__( id: str, # pylint: disable=redefined-builtin status: Literal["in_progress", "completed", "generating", "failed"], result: str, - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, ) -> None: ... @overload @@ -9026,10 +9093,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceLocalShellToolCall(ItemResource, discriminator="local_shell_call"): """Local shell call. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str :ivar type: The type of the local shell call. Always ``local_shell_call``. Required. LOCAL_SHELL_CALL. :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL_CALL @@ -9066,8 +9129,6 @@ def __init__( call_id: str, action: "_models.LocalShellExecAction", status: Literal["in_progress", "completed", "incomplete"], - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, ) -> None: ... @overload @@ -9085,10 +9146,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceLocalShellToolCallOutput(ItemResource, discriminator="local_shell_call_output"): """Local shell call output. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str :ivar type: The type of the local shell tool call output. Always ``local_shell_call_output``. Required. LOCAL_SHELL_CALL_OUTPUT. :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL_CALL_OUTPUT @@ -9120,8 +9177,6 @@ def __init__( *, id: str, # pylint: disable=redefined-builtin output: str, - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, ) -> None: ... @@ -9140,10 +9195,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceMcpApprovalRequest(ItemResource, discriminator="mcp_approval_request"): """MCP approval request. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :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 @@ -9176,8 +9227,6 @@ def __init__( server_label: str, name: str, arguments: str, - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, ) -> None: ... @overload @@ -9195,10 +9244,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceMcpApprovalResponseResource(ItemResource, discriminator="mcp_approval_response"): """MCP approval response. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :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 @@ -9229,8 +9274,6 @@ def __init__( id: str, # pylint: disable=redefined-builtin approval_request_id: str, approve: bool, - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, reason: Optional[str] = None, ) -> None: ... @@ -9249,10 +9292,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceMcpListTools(ItemResource, discriminator="mcp_list_tools"): """MCP list tools. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :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. Required. @@ -9282,8 +9321,6 @@ def __init__( id: str, # pylint: disable=redefined-builtin server_label: str, tools: list["_models.MCPListToolsTool"], - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, error: Optional[str] = None, ) -> None: ... @@ -9302,10 +9339,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceMcpToolCall(ItemResource, discriminator="mcp_call"): """MCP tool call. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :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. @@ -9356,8 +9389,6 @@ def __init__( server_label: str, name: str, arguments: str, - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, output: Optional[str] = None, error: Optional[str] = None, status: Optional[Union[str, "_models.MCPToolCallStatus"]] = None, @@ -9379,10 +9410,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceOutputMessage(ItemResource, discriminator="output_message"): """Output message. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str :ivar id: The unique ID of the output message. Required. :vartype id: str :ivar type: The type of the output message. Always ``message``. Required. OUTPUT_MESSAGE. @@ -9422,8 +9449,6 @@ def __init__( id: str, # pylint: disable=redefined-builtin content: list["_models.OutputMessageContent"], status: Literal["in_progress", "completed", "incomplete"], - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, ) -> None: ... @overload @@ -9442,10 +9467,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ItemResourceWebSearchToolCall(ItemResource, discriminator="web_search_call"): """Web search tool call. - :ivar agent_reference: The agent that created the item. - :vartype agent_reference: ~azure.ai.projects.models.AgentReference - :ivar response_id: The response on which the item is created. - :vartype response_id: str :ivar id: The unique ID of the web search tool call. Required. :vartype id: str :ivar type: The type of the web search tool call. Always ``web_search_call``. Required. @@ -9487,8 +9508,6 @@ def __init__( action: Union[ "_models.WebSearchActionSearch", "_models.WebSearchActionOpenPage", "_models.WebSearchActionFind" ], - agent_reference: Optional["_models.AgentReference"] = None, - response_id: Optional[str] = None, ) -> None: ... @overload @@ -10119,7 +10138,68 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.MEMORY_SEARCH_PREVIEW # type: ignore -class MemorySearchToolCallItemResource(ItemResource, discriminator="memory_search_call"): +class OutputItem(_Model): + """OutputItem. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + OutputItemApplyPatchToolCall, OutputItemApplyPatchToolCallOutput, + OutputItemCodeInterpreterToolCall, OutputItemCompactionBody, OutputItemComputerToolCall, + OutputItemCustomToolCall, OutputItemFileSearchToolCall, OutputItemFunctionToolCall, + OutputItemImageGenToolCall, OutputItemLocalShellToolCall, OutputItemMcpApprovalRequest, + OutputItemMcpToolCall, OutputItemMcpListTools, MemorySearchToolCallItemResource, + OAuthConsentRequestOutputItem, OutputItemOutputMessage, OutputItemReasoningItem, + OutputItemFunctionShellCall, OutputItemFunctionShellCallOutput, StructuredOutputsOutputItem, + OutputItemWebSearchToolCall, WorkflowPreviewActionOutputItem + + :ivar type: Required. Known values are: "output_message", "file_search_call", "function_call", + "web_search_call", "computer_call", "reasoning", "compaction", "image_generation_call", + "code_interpreter_call", "local_shell_call", "shell_call", "shell_call_output", + "apply_patch_call", "apply_patch_call_output", "mcp_call", "mcp_list_tools", + "mcp_approval_request", "custom_tool_call", "structured_outputs", "oauth_consent_request", + "memory_search_call", and "workflow_action". + :vartype type: str or ~azure.ai.projects.models.OutputItemType + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"output_message\", \"file_search_call\", \"function_call\", + \"web_search_call\", \"computer_call\", \"reasoning\", \"compaction\", + \"image_generation_call\", \"code_interpreter_call\", \"local_shell_call\", \"shell_call\", + \"shell_call_output\", \"apply_patch_call\", \"apply_patch_call_output\", \"mcp_call\", + \"mcp_list_tools\", \"mcp_approval_request\", \"custom_tool_call\", \"structured_outputs\", + \"oauth_consent_request\", \"memory_search_call\", and \"workflow_action\".""" + agent_reference: Optional["_models.AgentReference"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The agent that created the item.""" + response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The response on which the item is created.""" + + @overload + def __init__( + self, + *, + type: str, + agent_reference: Optional["_models.AgentReference"] = 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 MemorySearchToolCallItemResource(OutputItem, discriminator="memory_search_call"): """MemorySearchToolCallItemResource. :ivar agent_reference: The agent that created the item. @@ -10137,7 +10217,7 @@ class MemorySearchToolCallItemResource(ItemResource, discriminator="memory_searc :vartype results: list[~azure.ai.projects.models.MemorySearchItem] """ - type: Literal[ItemResourceType.MEMORY_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + type: Literal[OutputItemType.MEMORY_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Required. MEMORY_SEARCH_CALL.""" status: Literal["in_progress", "searching", "completed", "incomplete", "failed"] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -10170,7 +10250,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemResourceType.MEMORY_SEARCH_CALL # type: ignore + self.type = OutputItemType.MEMORY_SEARCH_CALL # type: ignore class MemoryStoreDefinition(_Model): @@ -10599,6 +10679,15 @@ 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"): """The input definition information for a Microsoft Fabric tool as used to configure an agent. @@ -10883,7 +10972,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = CredentialType.NONE # type: ignore -class OAuthConsentRequestItemResource(ItemResource, discriminator="oauth_consent_request"): +class OAuthConsentRequestOutputItem(OutputItem, discriminator="oauth_consent_request"): """Request from the service for the user to perform OAuth consent. :ivar agent_reference: The agent that created the item. @@ -10902,7 +10991,7 @@ class OAuthConsentRequestItemResource(ItemResource, discriminator="oauth_consent id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" - type: Literal[ItemResourceType.OAUTH_CONSENT_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + type: Literal[OutputItemType.OAUTH_CONSENT_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Required. OAUTH_CONSENT_REQUEST.""" consent_link: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The link the user can use to perform OAuth consent. Required.""" @@ -10929,7 +11018,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemResourceType.OAUTH_CONSENT_REQUEST # type: ignore + self.type = OutputItemType.OAUTH_CONSENT_REQUEST # type: ignore class OneTimeTrigger(Trigger, discriminator="OneTime"): @@ -11292,7 +11381,7 @@ class OutputContent(_Model): """OutputContent. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - OutputContentOutputTextContent, ReasoningTextContent, OutputContentRefusalContent + OutputContentOutputTextContent, OutputContentReasoningTextContent, OutputContentRefusalContent :ivar type: Required. Known values are: "output_text", "refusal", and "reasoning_text". :vartype type: str or ~azure.ai.projects.models.OutputContentType @@ -11320,39 +11409,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OutputMessageContent(_Model): - """OutputMessageContent. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - OutputMessageContentOutputTextContent, OutputMessageContentRefusalContent - - :ivar type: Required. Known values are: "output_text" and "refusal". - :vartype type: str or ~azure.ai.projects.models.OutputMessageContentType - """ - - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"output_text\" and \"refusal\".""" - - @overload - def __init__( - self, - *, - type: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OutputMessageContentOutputTextContent(OutputMessageContent, discriminator="output_text"): +class OutputContentOutputTextContent(OutputContent, discriminator="output_text"): """Output text. :ivar type: The type of the output text. Always ``output_text``. Required. OUTPUT_TEXT. @@ -11365,7 +11422,7 @@ class OutputMessageContentOutputTextContent(OutputMessageContent, discriminator= :vartype logprobs: list[~azure.ai.projects.models.LogProb] """ - type: Literal[OutputMessageContentType.OUTPUT_TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + type: Literal[OutputContentType.OUTPUT_TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The type of the output text. Always ``output_text``. Required. OUTPUT_TEXT.""" text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The text output from the model. Required.""" @@ -11391,28 +11448,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OutputMessageContentType.OUTPUT_TEXT # type: ignore + self.type = OutputContentType.OUTPUT_TEXT # type: ignore -class OutputMessageContentRefusalContent(OutputMessageContent, discriminator="refusal"): - """Refusal. +class OutputContentReasoningTextContent(OutputContent, discriminator="reasoning_text"): + """ReasoningTextContent. - :ivar type: The type of the refusal. Always ``refusal``. Required. REFUSAL. - :vartype type: str or ~azure.ai.projects.models.REFUSAL - :ivar refusal: The refusal explanation from the model. Required. - :vartype refusal: str + :ivar type: The type of the reasoning text. Always ``reasoning_text``. Required. + REASONING_TEXT. + :vartype type: str or ~azure.ai.projects.models.REASONING_TEXT + :ivar text: The reasoning text from the model. Required. + :vartype text: str """ - type: Literal[OutputMessageContentType.REFUSAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the refusal. Always ``refusal``. Required. REFUSAL.""" - refusal: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The refusal explanation from the model. Required.""" + type: Literal[OutputContentType.REASONING_TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the reasoning text. Always ``reasoning_text``. Required. REASONING_TEXT.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reasoning text from the model. Required.""" @overload def __init__( self, *, - refusal: str, + text: str, ) -> None: ... @overload @@ -11424,42 +11482,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OutputMessageContentType.REFUSAL # type: ignore + self.type = OutputContentType.REASONING_TEXT # type: ignore -class PendingUploadRequest(_Model): - """Represents a request for a pending upload. +class OutputContentRefusalContent(OutputContent, discriminator="refusal"): + """Refusal. - :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: BlobReference is the only supported type. Required. Blob Reference - is the only supported type. - :vartype pending_upload_type: str or ~azure.ai.projects.models.BLOB_REFERENCE + :ivar type: The type of the refusal. Always ``refusal``. Required. REFUSAL. + :vartype type: str or ~azure.ai.projects.models.REFUSAL + :ivar refusal: The refusal explanation from the model. Required. + :vartype refusal: str """ - pending_upload_id: Optional[str] = rest_field( - name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] - ) - """If PendingUploadId is not provided, a random GUID will be used.""" - connection_name: Optional[str] = rest_field( - name="connectionName", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure Storage Account connection name to use for generating temporary SAS token.""" - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE] = rest_field( - name="pendingUploadType", visibility=["read", "create", "update", "delete", "query"] - ) - """BlobReference is the only supported type. Required. Blob Reference is the only supported type.""" + type: Literal[OutputContentType.REFUSAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the refusal. Always ``refusal``. Required. REFUSAL.""" + refusal: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The refusal explanation from the model. Required.""" @overload def __init__( self, *, - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], - pending_upload_id: Optional[str] = None, - connection_name: Optional[str] = None, + refusal: str, ) -> None: ... @overload @@ -11471,46 +11515,64 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = OutputContentType.REFUSAL # type: ignore -class PendingUploadResponse(_Model): - """Represents the response for a pending upload request. +class OutputItemApplyPatchToolCall(OutputItem, discriminator="apply_patch_call"): + """Apply patch tool call. - :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: BlobReference is the only supported type. Required. Blob Reference - is the only supported type. - :vartype pending_upload_type: str or ~azure.ai.projects.models.BLOB_REFERENCE + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: The type of the item. Always ``apply_patch_call``. Required. APPLY_PATCH_CALL. + :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH_CALL + :ivar id: The unique ID of the apply patch tool call. Populated when this item is returned via + API. Required. + :vartype id: str + :ivar call_id: The unique ID of the apply patch tool call generated by the model. Required. + :vartype call_id: str + :ivar status: The status of the apply patch tool call. One of ``in_progress`` or ``completed``. + Required. Known values are: "in_progress" and "completed". + :vartype status: str or ~azure.ai.projects.models.ApplyPatchCallStatus + :ivar operation: One of the create_file, delete_file, or update_file operations applied via + apply_patch. Required. + :vartype operation: ~azure.ai.projects.models.ApplyPatchFileOperation + :ivar created_by: The ID of the entity that created this tool call. + :vartype created_by: str """ - blob_reference: "_models.BlobReference" = rest_field( - name="blobReference", visibility=["read", "create", "update", "delete", "query"] - ) - """Container-level read, write, list SAS. Required.""" - pending_upload_id: str = rest_field( - name="pendingUploadId", visibility=["read", "create", "update", "delete", "query"] + type: Literal[OutputItemType.APPLY_PATCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``apply_patch_call``. Required. APPLY_PATCH_CALL.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the apply patch tool call. Populated when this item is returned via API. + Required.""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the apply patch tool call generated by the model. Required.""" + status: Union[str, "_models.ApplyPatchCallStatus"] = 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"] + """The status of the apply patch tool call. One of ``in_progress`` or ``completed``. Required. + Known values are: \"in_progress\" and \"completed\".""" + operation: "_models.ApplyPatchFileOperation" = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """BlobReference is the only supported type. Required. Blob Reference is the only supported type.""" + """One of the create_file, delete_file, or update_file operations applied via apply_patch. + Required.""" + created_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the entity that created this tool call.""" @overload def __init__( self, *, - blob_reference: "_models.BlobReference", - pending_upload_id: str, - pending_upload_type: Literal[PendingUploadType.BLOB_REFERENCE], - version: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + call_id: str, + status: Union[str, "_models.ApplyPatchCallStatus"], + operation: "_models.ApplyPatchFileOperation", + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, + created_by: Optional[str] = None, ) -> None: ... @overload @@ -11522,99 +11584,4367 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = OutputItemType.APPLY_PATCH_CALL # type: ignore -class PromptAgentDefinition(AgentDefinition, discriminator="prompt"): - """The prompt agent definition. +class OutputItemApplyPatchToolCallOutput(OutputItem, discriminator="apply_patch_call_output"): + """Apply patch tool call output. - :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. - :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 + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: The type of the item. Always ``apply_patch_call_output``. Required. + APPLY_PATCH_CALL_OUTPUT. + :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH_CALL_OUTPUT + :ivar id: The unique ID of the apply patch tool call output. Populated when this item is + returned via API. Required. + :vartype id: str + :ivar call_id: The unique ID of the apply patch tool call generated by the model. Required. + :vartype call_id: str + :ivar status: The status of the apply patch tool call output. One of ``completed`` or + ``failed``. Required. Known values are: "completed" and "failed". + :vartype status: str or ~azure.ai.projects.models.ApplyPatchCallOutputStatus + :ivar output: + :vartype output: str + :ivar created_by: The ID of the entity that created this tool call output. + :vartype created_by: str + """ + + type: Literal[OutputItemType.APPLY_PATCH_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``apply_patch_call_output``. Required. APPLY_PATCH_CALL_OUTPUT.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the apply patch tool call output. Populated when this item is returned via + API. Required.""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the apply patch tool call generated by the model. Required.""" + status: Union[str, "_models.ApplyPatchCallOutputStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the apply patch tool call output. One of ``completed`` or ``failed``. Required. + Known values are: \"completed\" and \"failed\".""" + output: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + created_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the entity that created this tool call output.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + call_id: str, + status: Union[str, "_models.ApplyPatchCallOutputStatus"], + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, + output: Optional[str] = None, + created_by: 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 = OutputItemType.APPLY_PATCH_CALL_OUTPUT # type: ignore + + +class OutputItemCodeInterpreterToolCall(OutputItem, discriminator="code_interpreter_call"): + """Code interpreter tool call. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: The type of the code interpreter tool call. Always ``code_interpreter_call``. + Required. CODE_INTERPRETER_CALL. + :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER_CALL + :ivar id: The unique ID of the code interpreter tool call. Required. + :vartype id: str + :ivar status: The status of the code interpreter tool call. Valid values are ``in_progress``, + ``completed``, ``incomplete``, ``interpreting``, and ``failed``. Required. Is one of the + following types: Literal["in_progress"], Literal["completed"], Literal["incomplete"], + Literal["interpreting"], Literal["failed"] + :vartype status: str or str or str or str or str + :ivar container_id: The ID of the container used to run the code. Required. + :vartype container_id: str + :ivar code: Required. + :vartype code: str + :ivar outputs: Required. + :vartype outputs: list[~azure.ai.projects.models.CodeInterpreterOutputLogs or + ~azure.ai.projects.models.CodeInterpreterOutputImage] + """ + + type: Literal[OutputItemType.CODE_INTERPRETER_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the code interpreter tool call. Always ``code_interpreter_call``. Required. + CODE_INTERPRETER_CALL.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the code interpreter tool call. Required.""" + status: Literal["in_progress", "completed", "incomplete", "interpreting", "failed"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the code interpreter tool call. Valid values are ``in_progress``, ``completed``, + ``incomplete``, ``interpreting``, and ``failed``. Required. Is one of the following types: + Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"], + Literal[\"interpreting\"], Literal[\"failed\"]""" + container_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the container used to run the code. Required.""" + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + outputs: list[Union["_models.CodeInterpreterOutputLogs", "_models.CodeInterpreterOutputImage"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + status: Literal["in_progress", "completed", "incomplete", "interpreting", "failed"], + container_id: str, + code: str, + outputs: list[Union["_models.CodeInterpreterOutputLogs", "_models.CodeInterpreterOutputImage"]], + agent_reference: Optional["_models.AgentReference"] = 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 = OutputItemType.CODE_INTERPRETER_CALL # type: ignore + + +class OutputItemCompactionBody(OutputItem, discriminator="compaction"): + """Compaction item. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: The type of the item. Always ``compaction``. Required. COMPACTION. + :vartype type: str or ~azure.ai.projects.models.COMPACTION + :ivar id: The unique ID of the compaction item. Required. + :vartype id: str + :ivar encrypted_content: The encrypted content that was produced by compaction. Required. + :vartype encrypted_content: str + :ivar created_by: The identifier of the actor that created the item. + :vartype created_by: str + """ + + type: Literal[OutputItemType.COMPACTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``compaction``. Required. COMPACTION.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the compaction item. Required.""" + encrypted_content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The encrypted content that was produced by compaction. Required.""" + created_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the actor that created the item.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + encrypted_content: str, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, + created_by: 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 = OutputItemType.COMPACTION # type: ignore + + +class OutputItemComputerToolCall(OutputItem, discriminator="computer_call"): + """Computer tool call. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: The type of the computer call. Always ``computer_call``. Required. COMPUTER_CALL. + :vartype type: str or ~azure.ai.projects.models.COMPUTER_CALL + :ivar id: The unique ID of the computer call. Required. + :vartype id: str + :ivar call_id: An identifier used when responding to the tool call with output. Required. + :vartype call_id: str + :ivar action: Required. + :vartype action: ~azure.ai.projects.models.ComputerAction + :ivar pending_safety_checks: The pending safety checks for the computer call. Required. + :vartype pending_safety_checks: list[~azure.ai.projects.models.ComputerCallSafetyCheckParam] + :ivar status: The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. + Populated when items are returned via API. Required. Is one of the following types: + Literal["in_progress"], Literal["completed"], Literal["incomplete"] + :vartype status: str or str or str + """ + + type: Literal[OutputItemType.COMPUTER_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the computer call. Always ``computer_call``. Required. COMPUTER_CALL.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the computer call. Required.""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An identifier used when responding to the tool call with output. Required.""" + action: "_models.ComputerAction" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + pending_safety_checks: list["_models.ComputerCallSafetyCheckParam"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The pending safety checks for the computer call. Required.""" + status: Literal["in_progress", "completed", "incomplete"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. Populated + when items are returned via API. Required. Is one of the following types: + Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + call_id: str, + action: "_models.ComputerAction", + pending_safety_checks: list["_models.ComputerCallSafetyCheckParam"], + status: Literal["in_progress", "completed", "incomplete"], + agent_reference: Optional["_models.AgentReference"] = 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 = OutputItemType.COMPUTER_CALL # type: ignore + + +class OutputItemCustomToolCall(OutputItem, discriminator="custom_tool_call"): + """Custom tool call. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: The type of the custom tool call. Always ``custom_tool_call``. Required. + CUSTOM_TOOL_CALL. + :vartype type: str or ~azure.ai.projects.models.CUSTOM_TOOL_CALL + :ivar id: The unique ID of the custom tool call in the OpenAI platform. + :vartype id: str + :ivar call_id: An identifier used to map this custom tool call to a tool call output. Required. + :vartype call_id: str + :ivar name: The name of the custom tool being called. Required. + :vartype name: str + :ivar input: The input for the custom tool call generated by the model. Required. + :vartype input: str + """ + + type: Literal[OutputItemType.CUSTOM_TOOL_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the custom tool call. Always ``custom_tool_call``. Required. CUSTOM_TOOL_CALL.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the custom tool call in the OpenAI platform.""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An identifier used to map this custom tool call to a tool call output. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the custom tool being called. Required.""" + input: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The input for the custom tool call generated by the model. Required.""" + + @overload + def __init__( + self, + *, + call_id: str, + name: str, + input: str, + agent_reference: Optional["_models.AgentReference"] = 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 = OutputItemType.CUSTOM_TOOL_CALL # type: ignore + + +class OutputItemFileSearchToolCall(OutputItem, discriminator="file_search_call"): + """File search tool call. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar id: The unique ID of the file search tool call. Required. + :vartype id: str + :ivar type: The type of the file search tool call. Always ``file_search_call``. Required. + FILE_SEARCH_CALL. + :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH_CALL + :ivar status: The status of the file search tool call. One of ``in_progress``, ``searching``, + ``incomplete`` or ``failed``,. Required. Is one of the following types: Literal["in_progress"], + Literal["searching"], Literal["completed"], Literal["incomplete"], Literal["failed"] + :vartype status: str or str or str or str or str + :ivar queries: The queries used to search for files. Required. + :vartype queries: list[str] + :ivar results: + :vartype results: list[~azure.ai.projects.models.FileSearchToolCallResults] + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the file search tool call. Required.""" + type: Literal[OutputItemType.FILE_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the file search tool call. Always ``file_search_call``. Required. FILE_SEARCH_CALL.""" + status: Literal["in_progress", "searching", "completed", "incomplete", "failed"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the file search tool call. One of ``in_progress``, ``searching``, ``incomplete`` + or ``failed``,. Required. Is one of the following types: Literal[\"in_progress\"], + Literal[\"searching\"], Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"failed\"]""" + queries: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The queries used to search for files. Required.""" + results: Optional[list["_models.FileSearchToolCallResults"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + status: Literal["in_progress", "searching", "completed", "incomplete", "failed"], + queries: list[str], + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, + results: Optional[list["_models.FileSearchToolCallResults"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = OutputItemType.FILE_SEARCH_CALL # type: ignore + + +class OutputItemFunctionShellCall(OutputItem, discriminator="shell_call"): + """Shell tool call. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: The type of the item. Always ``shell_call``. Required. SHELL_CALL. + :vartype type: str or ~azure.ai.projects.models.SHELL_CALL + :ivar id: The unique ID of the shell tool call. Populated when this item is returned via API. + Required. + :vartype id: str + :ivar call_id: The unique ID of the shell tool call generated by the model. Required. + :vartype call_id: str + :ivar action: The shell commands and limits that describe how to run the tool call. Required. + :vartype action: ~azure.ai.projects.models.FunctionShellAction + :ivar status: The status of the shell call. One of ``in_progress``, ``completed``, or + ``incomplete``. Required. Known values are: "in_progress", "completed", and "incomplete". + :vartype status: str or ~azure.ai.projects.models.LocalShellCallStatus + :ivar created_by: The ID of the entity that created this tool call. + :vartype created_by: str + """ + + type: Literal[OutputItemType.SHELL_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``shell_call``. Required. SHELL_CALL.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the shell tool call. Populated when this item is returned via API. Required.""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the shell tool call generated by the model. Required.""" + action: "_models.FunctionShellAction" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The shell commands and limits that describe how to run the tool call. Required.""" + status: Union[str, "_models.LocalShellCallStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the shell call. One of ``in_progress``, ``completed``, or ``incomplete``. + Required. Known values are: \"in_progress\", \"completed\", and \"incomplete\".""" + created_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the entity that created this tool call.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + call_id: str, + action: "_models.FunctionShellAction", + status: Union[str, "_models.LocalShellCallStatus"], + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, + created_by: 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 = OutputItemType.SHELL_CALL # type: ignore + + +class OutputItemFunctionShellCallOutput(OutputItem, discriminator="shell_call_output"): + """Shell call output. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: The type of the shell call output. Always ``shell_call_output``. Required. + SHELL_CALL_OUTPUT. + :vartype type: str or ~azure.ai.projects.models.SHELL_CALL_OUTPUT + :ivar id: The unique ID of the shell call output. Populated when this item is returned via API. + Required. + :vartype id: str + :ivar call_id: The unique ID of the shell tool call generated by the model. Required. + :vartype call_id: str + :ivar output: An array of shell call output contents. Required. + :vartype output: list[~azure.ai.projects.models.FunctionShellCallOutputContent] + :ivar max_output_length: Required. + :vartype max_output_length: int + :ivar created_by: The identifier of the actor that created the item. + :vartype created_by: str + """ + + type: Literal[OutputItemType.SHELL_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the shell call output. Always ``shell_call_output``. Required. SHELL_CALL_OUTPUT.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the shell call output. Populated when this item is returned via API. Required.""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the shell tool call generated by the model. Required.""" + output: list["_models.FunctionShellCallOutputContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """An array of shell call output contents. Required.""" + max_output_length: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + created_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The identifier of the actor that created the item.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + call_id: str, + output: list["_models.FunctionShellCallOutputContent"], + max_output_length: int, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, + created_by: 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 = OutputItemType.SHELL_CALL_OUTPUT # type: ignore + + +class OutputItemFunctionToolCall(OutputItem, discriminator="function_call"): + """Function tool call. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar id: The unique ID of the function tool call. + :vartype id: str + :ivar type: The type of the function tool call. Always ``function_call``. Required. + FUNCTION_CALL. + :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL + :ivar call_id: The unique ID of the function tool call generated by the model. Required. + :vartype call_id: str + :ivar name: The name of the function to run. Required. + :vartype name: str + :ivar arguments: A JSON string of the arguments to pass to the function. Required. + :vartype arguments: str + :ivar status: The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. + Populated when items are returned via API. Is one of the following types: + Literal["in_progress"], Literal["completed"], Literal["incomplete"] + :vartype status: str or str or str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the function tool call.""" + type: Literal[OutputItemType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the function tool call. Always ``function_call``. Required. FUNCTION_CALL.""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the function tool call generated by the model. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function to run. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A JSON string of the arguments to pass to the function. Required.""" + status: Optional[Literal["in_progress", "completed", "incomplete"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. Populated + when items are returned via API. Is one of the following types: Literal[\"in_progress\"], + Literal[\"completed\"], Literal[\"incomplete\"]""" + + @overload + def __init__( + self, + *, + call_id: str, + name: str, + arguments: str, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = OutputItemType.FUNCTION_CALL # type: ignore + + +class OutputItemImageGenToolCall(OutputItem, discriminator="image_generation_call"): + """Image generation call. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: The type of the image generation call. Always ``image_generation_call``. Required. + IMAGE_GENERATION_CALL. + :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION_CALL + :ivar id: The unique ID of the image generation call. Required. + :vartype id: str + :ivar status: The status of the image generation call. Required. Is one of the following types: + Literal["in_progress"], Literal["completed"], Literal["generating"], Literal["failed"] + :vartype status: str or str or str or str + :ivar result: Required. + :vartype result: str + """ + + type: Literal[OutputItemType.IMAGE_GENERATION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the image generation call. Always ``image_generation_call``. Required. + IMAGE_GENERATION_CALL.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the image generation call. Required.""" + status: Literal["in_progress", "completed", "generating", "failed"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the image generation call. Required. Is one of the following types: + Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"generating\"], Literal[\"failed\"]""" + result: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + status: Literal["in_progress", "completed", "generating", "failed"], + result: str, + agent_reference: Optional["_models.AgentReference"] = 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 = OutputItemType.IMAGE_GENERATION_CALL # type: ignore + + +class OutputItemLocalShellToolCall(OutputItem, discriminator="local_shell_call"): + """Local shell call. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: The type of the local shell call. Always ``local_shell_call``. Required. + LOCAL_SHELL_CALL. + :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL_CALL + :ivar id: The unique ID of the local shell call. Required. + :vartype id: str + :ivar call_id: The unique ID of the local shell tool call generated by the model. Required. + :vartype call_id: str + :ivar action: Required. + :vartype action: ~azure.ai.projects.models.LocalShellExecAction + :ivar status: The status of the local shell call. Required. Is one of the following types: + Literal["in_progress"], Literal["completed"], Literal["incomplete"] + :vartype status: str or str or str + """ + + type: Literal[OutputItemType.LOCAL_SHELL_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the local shell call. Always ``local_shell_call``. Required. LOCAL_SHELL_CALL.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the local shell call. Required.""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the local shell tool call generated by the model. Required.""" + action: "_models.LocalShellExecAction" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + status: Literal["in_progress", "completed", "incomplete"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the local shell call. Required. Is one of the following types: + Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + call_id: str, + action: "_models.LocalShellExecAction", + status: Literal["in_progress", "completed", "incomplete"], + agent_reference: Optional["_models.AgentReference"] = 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 = OutputItemType.LOCAL_SHELL_CALL # type: ignore + + +class OutputItemMcpApprovalRequest(OutputItem, discriminator="mcp_approval_request"): + """MCP approval request. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :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. + :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[OutputItemType.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, + agent_reference: Optional["_models.AgentReference"] = 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 = OutputItemType.MCP_APPROVAL_REQUEST # type: ignore + + +class OutputItemMcpListTools(OutputItem, discriminator="mcp_list_tools"): + """MCP list tools. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :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. 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 error: + :vartype error: str + """ + + type: Literal[OutputItemType.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: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the list. Required.""" + 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.""" + error: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + server_label: str, + tools: list["_models.MCPListToolsTool"], + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, + error: 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 = OutputItemType.MCP_LIST_TOOLS # type: ignore + + +class OutputItemMcpToolCall(OutputItem, discriminator="mcp_call"): + """MCP tool call. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :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. + :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 output: + :vartype output: str + :ivar error: + :vartype error: str + :ivar status: The status of the tool call. One of ``in_progress``, ``completed``, + ``incomplete``, ``calling``, or ``failed``. Known values are: "in_progress", "completed", + "incomplete", "calling", and "failed". + :vartype status: str or ~azure.ai.projects.models.MCPToolCallStatus + :ivar approval_request_id: + :vartype approval_request_id: str + """ + + type: Literal[OutputItemType.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.""" + output: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + error: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + status: Optional[Union[str, "_models.MCPToolCallStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the tool call. One of ``in_progress``, ``completed``, ``incomplete``, + ``calling``, or ``failed``. Known values are: \"in_progress\", \"completed\", \"incomplete\", + \"calling\", and \"failed\".""" + approval_request_id: Optional[str] = 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, + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, + output: Optional[str] = None, + error: Optional[str] = None, + status: Optional[Union[str, "_models.MCPToolCallStatus"]] = None, + approval_request_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 = OutputItemType.MCP_CALL # type: ignore + + +class OutputItemOutputMessage(OutputItem, discriminator="output_message"): + """Output message. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar id: The unique ID of the output message. Required. + :vartype id: str + :ivar type: The type of the output message. Always ``message``. Required. OUTPUT_MESSAGE. + :vartype type: str or ~azure.ai.projects.models.OUTPUT_MESSAGE + :ivar role: The role of the output message. Always ``assistant``. Required. Default value is + "assistant". + :vartype role: str + :ivar content: The content of the output message. Required. + :vartype content: list[~azure.ai.projects.models.OutputMessageContent] + :ivar status: The status of the message input. One of ``in_progress``, ``completed``, or + ``incomplete``. Populated when input items are returned via API. Required. Is one of the + following types: Literal["in_progress"], Literal["completed"], Literal["incomplete"] + :vartype status: str or str or str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the output message. Required.""" + type: Literal[OutputItemType.OUTPUT_MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the output message. Always ``message``. Required. OUTPUT_MESSAGE.""" + role: Literal["assistant"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The role of the output message. Always ``assistant``. Required. Default value is \"assistant\".""" + content: list["_models.OutputMessageContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the output message. Required.""" + status: Literal["in_progress", "completed", "incomplete"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the message input. One of ``in_progress``, ``completed``, or ``incomplete``. + Populated when input items are returned via API. Required. Is one of the following types: + Literal[\"in_progress\"], Literal[\"completed\"], Literal[\"incomplete\"]""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + content: list["_models.OutputMessageContent"], + status: Literal["in_progress", "completed", "incomplete"], + agent_reference: Optional["_models.AgentReference"] = 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 = OutputItemType.OUTPUT_MESSAGE # type: ignore + self.role: Literal["assistant"] = "assistant" + + +class OutputItemReasoningItem(OutputItem, discriminator="reasoning"): + """Reasoning. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar type: The type of the object. Always ``reasoning``. Required. REASONING. + :vartype type: str or ~azure.ai.projects.models.REASONING + :ivar id: The unique identifier of the reasoning content. Required. + :vartype id: str + :ivar encrypted_content: + :vartype encrypted_content: str + :ivar summary: Reasoning summary content. Required. + :vartype summary: list[~azure.ai.projects.models.Summary] + :ivar content: Reasoning text content. + :vartype content: list[~azure.ai.projects.models.ReasoningTextContent] + :ivar status: The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. + Populated when items are returned via API. Is one of the following types: + Literal["in_progress"], Literal["completed"], Literal["incomplete"] + :vartype status: str or str or str + """ + + type: Literal[OutputItemType.REASONING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``reasoning``. Required. REASONING.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the reasoning content. Required.""" + encrypted_content: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + summary: list["_models.Summary"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Reasoning summary content. Required.""" + content: Optional[list["_models.ReasoningTextContent"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Reasoning text content.""" + status: Optional[Literal["in_progress", "completed", "incomplete"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. One of ``in_progress``, ``completed``, or ``incomplete``. Populated + when items are returned via API. Is one of the following types: Literal[\"in_progress\"], + Literal[\"completed\"], Literal[\"incomplete\"]""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + summary: list["_models.Summary"], + agent_reference: Optional["_models.AgentReference"] = None, + response_id: Optional[str] = None, + encrypted_content: Optional[str] = None, + content: Optional[list["_models.ReasoningTextContent"]] = None, + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = OutputItemType.REASONING # type: ignore + + +class OutputItemWebSearchToolCall(OutputItem, discriminator="web_search_call"): + """Web search tool call. + + :ivar agent_reference: The agent that created the item. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + :ivar response_id: The response on which the item is created. + :vartype response_id: str + :ivar id: The unique ID of the web search tool call. Required. + :vartype id: str + :ivar type: The type of the web search tool call. Always ``web_search_call``. Required. + WEB_SEARCH_CALL. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_CALL + :ivar status: The status of the web search tool call. Required. Is one of the following types: + Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["failed"] + :vartype status: str or str or str or str + :ivar action: An object describing the specific action taken in this web search call. Includes + details on how the model used the web (search, open_page, find). Required. Is one of the + following types: WebSearchActionSearch, WebSearchActionOpenPage, WebSearchActionFind + :vartype action: ~azure.ai.projects.models.WebSearchActionSearch or + ~azure.ai.projects.models.WebSearchActionOpenPage or + ~azure.ai.projects.models.WebSearchActionFind + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the web search tool call. Required.""" + type: Literal[OutputItemType.WEB_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the web search tool call. Always ``web_search_call``. Required. WEB_SEARCH_CALL.""" + status: Literal["in_progress", "searching", "completed", "failed"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the web search tool call. Required. Is one of the following types: + Literal[\"in_progress\"], Literal[\"searching\"], Literal[\"completed\"], Literal[\"failed\"]""" + action: Union["_models.WebSearchActionSearch", "_models.WebSearchActionOpenPage", "_models.WebSearchActionFind"] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """An object describing the specific action taken in this web search call. Includes details on how + the model used the web (search, open_page, find). Required. Is one of the following types: + WebSearchActionSearch, WebSearchActionOpenPage, WebSearchActionFind""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + status: Literal["in_progress", "searching", "completed", "failed"], + action: Union[ + "_models.WebSearchActionSearch", "_models.WebSearchActionOpenPage", "_models.WebSearchActionFind" + ], + agent_reference: Optional["_models.AgentReference"] = 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 = OutputItemType.WEB_SEARCH_CALL # type: ignore + + +class OutputMessageContent(_Model): + """OutputMessageContent. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + OutputMessageContentOutputTextContent, OutputMessageContentRefusalContent + + :ivar type: Required. Known values are: "output_text" and "refusal". + :vartype type: str or ~azure.ai.projects.models.OutputMessageContentType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"output_text\" and \"refusal\".""" + + @overload + def __init__( + self, + *, + type: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OutputMessageContentOutputTextContent(OutputMessageContent, discriminator="output_text"): + """Output text. + + :ivar type: The type of the output text. Always ``output_text``. Required. OUTPUT_TEXT. + :vartype type: str or ~azure.ai.projects.models.OUTPUT_TEXT + :ivar text: The text output from the model. Required. + :vartype text: str + :ivar annotations: The annotations of the text output. Required. + :vartype annotations: list[~azure.ai.projects.models.Annotation] + :ivar logprobs: + :vartype logprobs: list[~azure.ai.projects.models.LogProb] + """ + + type: Literal[OutputMessageContentType.OUTPUT_TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the output text. Always ``output_text``. Required. OUTPUT_TEXT.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text output from the model. Required.""" + annotations: list["_models.Annotation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The annotations of the text output. Required.""" + logprobs: Optional[list["_models.LogProb"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + text: str, + annotations: list["_models.Annotation"], + logprobs: Optional[list["_models.LogProb"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = OutputMessageContentType.OUTPUT_TEXT # type: ignore + + +class OutputMessageContentRefusalContent(OutputMessageContent, discriminator="refusal"): + """Refusal. + + :ivar type: The type of the refusal. Always ``refusal``. Required. REFUSAL. + :vartype type: str or ~azure.ai.projects.models.REFUSAL + :ivar refusal: The refusal explanation from the model. Required. + :vartype refusal: str + """ + + type: Literal[OutputMessageContentType.REFUSAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the refusal. Always ``refusal``. Required. REFUSAL.""" + refusal: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The refusal explanation from the model. Required.""" + + @overload + def __init__( + self, + *, + refusal: 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 = OutputMessageContentType.REFUSAL # type: ignore + + +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. + :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: BlobReference is the only supported type. Required. Blob Reference + is the only supported type. + :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"] + ) + """BlobReference is the only supported type. Required. Blob Reference is the only supported type.""" + + @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): + """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: BlobReference is the only supported type. Required. Blob Reference + is the only supported type. + :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"] + ) + """BlobReference is the only supported type. Required. Blob Reference is the only supported type.""" + + @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 Prompt(_Model): + """Reference to a prompt template and its variables. `Learn more + `_. + + :ivar id: The unique identifier of the prompt template to use. Required. + :vartype id: str + :ivar version: + :vartype version: str + :ivar variables: + :vartype variables: ~azure.ai.projects.models.ResponsePromptVariables + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the prompt template to use. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + variables: Optional["_models.ResponsePromptVariables"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + version: Optional[str] = None, + variables: Optional["_models.ResponsePromptVariables"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: 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"): + """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. + :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. + :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.""" + 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.""" + 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): + """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.TextResponseFormatConfiguration + """ + + format: Optional["_models.TextResponseFormatConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + format: Optional["_models.TextResponseFormatConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: 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"): + """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 ProtocolVersionRecord(_Model): + """A record mapping for a single protocol and its version. + + :ivar protocol: The protocol type. Required. Known values are: "activity_protocol" and + "responses". + :vartype protocol: str or ~azure.ai.projects.models.AgentProtocol + :ivar version: The version string for the protocol, e.g. 'v0.1.1'. Required. + :vartype version: str + """ + + protocol: Union[str, "_models.AgentProtocol"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The protocol type. Required. Known values are: \"activity_protocol\" and \"responses\".""" + 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.AgentProtocol"], + 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): + """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): + """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 Reasoning(_Model): + """Reasoning. + + :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 + """ + + 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( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" + + @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, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ReasoningTextContent(_Model): + """ReasoningTextContent. + + :ivar type: The type of the reasoning text. Always ``reasoning_text``. Required. Default value + is "reasoning_text". + :vartype type: str + :ivar text: The reasoning text from the model. Required. + :vartype text: str + """ + + type: Literal["reasoning_text"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the reasoning text. Always ``reasoning_text``. Required. Default value is + \"reasoning_text\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reasoning text from the model. 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["reasoning_text"] = "reasoning_text" + + +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: 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. + :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[str] = rest_field(name="startTime", visibility=["read", "create", "update", "delete", "query"]) + """Start time for the recurrence schedule in ISO 8601 format.""" + end_time: Optional[str] = rest_field(name="endTime", 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.""" + 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[str] = None, + end_time: Optional[str] = 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. Default false, if true the + scan outputs conversation not evaluation result. + :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.TargetConfig + """ + + 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. Default false, if true the scan outputs + conversation not evaluation result.""" + 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.TargetConfig" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Target configuration for the red-team run. Required.""" + + @overload + def __init__( + self, + *, + target: "_models.TargetConfig", + 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 Response(_Model): + """The response object. + + :ivar metadata: + :vartype metadata: ~azure.ai.projects.models.Metadata + :ivar top_logprobs: + :vartype top_logprobs: int + :ivar temperature: + :vartype temperature: float + :ivar top_p: + :vartype top_p: float + :ivar user: This field is being replaced by ``safety_identifier`` and ``prompt_cache_key``. Use + ``prompt_cache_key`` instead to maintain caching optimizations. A stable identifier for your + end-users. Used to boost cache hit rates by better bucketing similar requests and to help + OpenAI detect and prevent abuse. `Learn more + `_. + :vartype user: str + :ivar safety_identifier: A stable identifier used to help detect users of your application that + may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies + each user. We recommend hashing their username or email address, in order to avoid sending us + any identifying information. `Learn more + `_. + :vartype safety_identifier: str + :ivar prompt_cache_key: Used by OpenAI to cache responses for similar requests to optimize your + cache hit rates. Replaces the ``user`` field. `Learn more + `_. + :vartype prompt_cache_key: str + :ivar service_tier: Is one of the following types: Literal["auto"], Literal["default"], + Literal["flex"], Literal["scale"], Literal["priority"] + :vartype service_tier: str or str or str or str or str + :ivar prompt_cache_retention: Is either a Literal["in-memory"] type or a Literal["24h"] type. + :vartype prompt_cache_retention: str or str + :ivar previous_response_id: + :vartype previous_response_id: str + :ivar model: The model deployment to use for the creation of this response. + :vartype model: str + :ivar reasoning: + :vartype reasoning: ~azure.ai.projects.models.Reasoning + :ivar background: + :vartype background: bool + :ivar max_output_tokens: + :vartype max_output_tokens: int + :ivar max_tool_calls: + :vartype max_tool_calls: int + :ivar text: + :vartype text: ~azure.ai.projects.models.ResponseTextParam + :ivar tools: + :vartype tools: list[~azure.ai.projects.models.Tool] + :ivar tool_choice: Is either a Union[str, "_models.ToolChoiceOptions"] type or a + ToolChoiceParam type. + :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceOptions or + ~azure.ai.projects.models.ToolChoiceParam + :ivar prompt: + :vartype prompt: ~azure.ai.projects.models.Prompt + :ivar truncation: Is either a Literal["auto"] type or a Literal["disabled"] type. + :vartype truncation: str or str + :ivar id: Unique identifier for this Response. Required. + :vartype id: str + :ivar object: The object type of this resource - always set to ``response``. Required. Default + value is "response". + :vartype object: str + :ivar status: The status of the response generation. One of ``completed``, ``failed``, + ``in_progress``, ``cancelled``, ``queued``, or ``incomplete``. Is one of the following types: + Literal["completed"], Literal["failed"], Literal["in_progress"], Literal["cancelled"], + Literal["queued"], Literal["incomplete"] + :vartype status: str or str or str or str or str or str + :ivar created_at: Unix timestamp (in seconds) of when this Response was created. Required. + :vartype created_at: ~datetime.datetime + :ivar completed_at: + :vartype completed_at: ~datetime.datetime + :ivar error: Required. + :vartype error: ~azure.ai.projects.models.ResponseError + :ivar incomplete_details: Required. + :vartype incomplete_details: ~azure.ai.projects.models.ResponseIncompleteDetails + :ivar output: An array of content items generated by the model. + + * The length and order of items in the `output` array is dependent + on the model's response. + * Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. Required. + :vartype output: list[~azure.ai.projects.models.OutputItem] + :ivar instructions: Required. Is either a str type or a [InputItem] type. + :vartype instructions: str or list[~azure.ai.projects.models.InputItem] + :ivar output_text: + :vartype output_text: str + :ivar usage: + :vartype usage: ~azure.ai.projects.models.ResponseUsage + :ivar parallel_tool_calls: Whether to allow the model to run tool calls in parallel. Required. + :vartype parallel_tool_calls: bool + :ivar conversation: + :vartype conversation: ~azure.ai.projects.models.ConversationReference + :ivar agent_reference: The agent used for this response. Required. + :vartype agent_reference: ~azure.ai.projects.models.AgentReference + """ + + metadata: Optional["_models.Metadata"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + top_logprobs: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + top_p: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + user: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """This field is being replaced by ``safety_identifier`` and ``prompt_cache_key``. Use + ``prompt_cache_key`` instead to maintain caching optimizations. A stable identifier for your + end-users. Used to boost cache hit rates by better bucketing similar requests and to help + OpenAI detect and prevent abuse. `Learn more + `_.""" + safety_identifier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A stable identifier used to help detect users of your application that may be violating + OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. We + recommend hashing their username or email address, in order to avoid sending us any identifying + information. `Learn more + `_.""" + prompt_cache_key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. + Replaces the ``user`` field. `Learn more + `_.""" + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"auto\"], Literal[\"default\"], Literal[\"flex\"], + Literal[\"scale\"], Literal[\"priority\"]""" + prompt_cache_retention: Optional[Literal["in-memory", "24h"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a Literal[\"in-memory\"] type or a Literal[\"24h\"] type.""" + previous_response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model deployment to use for the creation of this response.""" + reasoning: Optional["_models.Reasoning"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + background: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + max_output_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + max_tool_calls: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + text: Optional["_models.ResponseTextParam"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tools: Optional[list["_models.Tool"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tool_choice: Optional[Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceParam"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a Union[str, \"_models.ToolChoiceOptions\"] type or a ToolChoiceParam type.""" + prompt: Optional["_models.Prompt"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + truncation: Optional[Literal["auto", "disabled"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a Literal[\"auto\"] type or a Literal[\"disabled\"] type.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Unique identifier for this Response. Required.""" + object: Literal["response"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The object type of this resource - always set to ``response``. Required. Default value is + \"response\".""" + status: Optional[Literal["completed", "failed", "in_progress", "cancelled", "queued", "incomplete"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the response generation. One of ``completed``, ``failed``, ``in_progress``, + ``cancelled``, ``queued``, or ``incomplete``. Is one of the following types: + Literal[\"completed\"], Literal[\"failed\"], Literal[\"in_progress\"], Literal[\"cancelled\"], + Literal[\"queued\"], Literal[\"incomplete\"]""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """Unix timestamp (in seconds) of when this Response was created. Required.""" + completed_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + error: "_models.ResponseError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + incomplete_details: "_models.ResponseIncompleteDetails" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + output: list["_models.OutputItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An array of content items generated by the model. + + * The length and order of items in the `output` array is dependent + on the model's response. + * Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. Required.""" + instructions: Union[str, list["_models.InputItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Is either a str type or a [InputItem] type.""" + output_text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + usage: Optional["_models.ResponseUsage"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parallel_tool_calls: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to allow the model to run tool calls in parallel. Required.""" + conversation: Optional["_models.ConversationReference"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + agent_reference: "_models.AgentReference" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The agent used for this response. Required.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + id: str, # pylint: disable=redefined-builtin + created_at: datetime.datetime, + error: "_models.ResponseError", + incomplete_details: "_models.ResponseIncompleteDetails", + output: list["_models.OutputItem"], + instructions: Union[str, list["_models.InputItem"]], + parallel_tool_calls: bool, + agent_reference: "_models.AgentReference", + metadata: Optional["_models.Metadata"] = None, + top_logprobs: Optional[int] = None, + temperature: Optional[float] = None, + top_p: Optional[float] = None, + user: Optional[str] = None, + safety_identifier: Optional[str] = None, + prompt_cache_key: Optional[str] = None, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] = None, + prompt_cache_retention: Optional[Literal["in-memory", "24h"]] = None, + previous_response_id: Optional[str] = None, + model: Optional[str] = None, + reasoning: Optional["_models.Reasoning"] = None, + background: Optional[bool] = None, + max_output_tokens: Optional[int] = None, + max_tool_calls: Optional[int] = None, + text: Optional["_models.ResponseTextParam"] = None, + tools: Optional[list["_models.Tool"]] = None, + tool_choice: Optional[Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceParam"]] = None, + prompt: Optional["_models.Prompt"] = None, + truncation: Optional[Literal["auto", "disabled"]] = None, + status: Optional[Literal["completed", "failed", "in_progress", "cancelled", "queued", "incomplete"]] = None, + completed_at: Optional[datetime.datetime] = None, + output_text: Optional[str] = None, + usage: Optional["_models.ResponseUsage"] = None, + conversation: Optional["_models.ConversationReference"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: 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["response"] = "response" + + +class ResponseAudioDeltaEvent(_Model): + """Emitted when there is a partial audio response. + + :ivar type: The type of the event. Always ``response.audio.delta``. Required. Default value is + "response.audio.delta". + :vartype type: str + :ivar sequence_number: A sequence number for this chunk of the stream response. Required. + :vartype sequence_number: int + :ivar delta: A chunk of Base64 encoded response audio bytes. Required. + :vartype delta: bytes + """ + + type: Literal["response.audio.delta"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always ``response.audio.delta``. Required. Default value is + \"response.audio.delta\".""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A sequence number for this chunk of the stream response. Required.""" + delta: bytes = rest_field(visibility=["read", "create", "update", "delete", "query"], format="base64") + """A chunk of Base64 encoded response audio bytes. Required.""" + + @overload + def __init__( + self, + *, + sequence_number: 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) + self.type: Literal["response.audio.delta"] = "response.audio.delta" + + +class ResponseAudioDoneEvent(_Model): + """Emitted when the audio response is complete. + + :ivar type: The type of the event. Always ``response.audio.done``. Required. Default value is + "response.audio.done". + :vartype type: str + :ivar sequence_number: The sequence number of the delta. Required. + :vartype sequence_number: int + """ + + type: Literal["response.audio.done"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always ``response.audio.done``. Required. Default value is + \"response.audio.done\".""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of the delta. Required.""" + + @overload + def __init__( + self, + *, + sequence_number: 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.done"] = "response.audio.done" + + +class ResponseAudioTranscriptDeltaEvent(_Model): + """Emitted when there is a partial transcript of audio. + + :ivar type: The type of the event. Always ``response.audio.transcript.delta``. Required. + Default value is "response.audio.transcript.delta". + :vartype type: str + :ivar delta: The partial transcript of the audio response. Required. + :vartype delta: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.audio.transcript.delta"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.audio.transcript.delta``. Required. Default value is + \"response.audio.transcript.delta\".""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The partial transcript of the audio response. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + delta: str, + sequence_number: 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.transcript.delta"] = "response.audio.transcript.delta" + + +class ResponseAudioTranscriptDoneEvent(_Model): + """Emitted when the full audio transcript is completed. + + :ivar type: The type of the event. Always ``response.audio.transcript.done``. Required. Default + value is "response.audio.transcript.done". + :vartype type: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.audio.transcript.done"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.audio.transcript.done``. Required. Default value is + \"response.audio.transcript.done\".""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + sequence_number: 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.transcript.done"] = "response.audio.transcript.done" + + +class ResponseCodeInterpreterCallCodeDeltaEvent(_Model): # pylint: disable=name-too-long + """Emitted when a partial code snippet is streamed by the code interpreter. + + :ivar type: The type of the event. Always ``response.code_interpreter_call_code.delta``. + Required. Default value is "response.code_interpreter_call_code.delta". + :vartype type: str + :ivar output_index: The index of the output item in the response for which the code is being + streamed. Required. + :vartype output_index: int + :ivar item_id: The unique identifier of the code interpreter tool call item. Required. + :vartype item_id: str + :ivar delta: The partial code snippet being streamed by the code interpreter. Required. + :vartype delta: str + :ivar sequence_number: The sequence number of this event, used to order streaming events. + Required. + :vartype sequence_number: int + """ + + type: Literal["response.code_interpreter_call_code.delta"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.code_interpreter_call_code.delta``. Required. Default + value is \"response.code_interpreter_call_code.delta\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response for which the code is being streamed. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the code interpreter tool call item. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The partial code snippet being streamed by the code interpreter. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event, used to order streaming events. Required.""" + + @overload + def __init__( + self, + *, + output_index: int, + item_id: str, + delta: str, + sequence_number: 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.code_interpreter_call_code.delta"] = "response.code_interpreter_call_code.delta" + + +class ResponseCodeInterpreterCallCodeDoneEvent(_Model): + """Emitted when the code snippet is finalized by the code interpreter. + + :ivar type: The type of the event. Always ``response.code_interpreter_call_code.done``. + Required. Default value is "response.code_interpreter_call_code.done". + :vartype type: str + :ivar output_index: The index of the output item in the response for which the code is + finalized. Required. + :vartype output_index: int + :ivar item_id: The unique identifier of the code interpreter tool call item. Required. + :vartype item_id: str + :ivar code: The final code snippet output by the code interpreter. Required. + :vartype code: str + :ivar sequence_number: The sequence number of this event, used to order streaming events. + Required. + :vartype sequence_number: int + """ + + type: Literal["response.code_interpreter_call_code.done"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.code_interpreter_call_code.done``. Required. Default + value is \"response.code_interpreter_call_code.done\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response for which the code is finalized. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the code interpreter tool call item. Required.""" + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The final code snippet output by the code interpreter. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event, used to order streaming events. Required.""" + + @overload + def __init__( + self, + *, + output_index: int, + item_id: str, + code: str, + sequence_number: 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.code_interpreter_call_code.done"] = "response.code_interpreter_call_code.done" + + +class ResponseCodeInterpreterCallCompletedEvent(_Model): # pylint: disable=name-too-long + """Emitted when the code interpreter call is completed. + + :ivar type: The type of the event. Always ``response.code_interpreter_call.completed``. + Required. Default value is "response.code_interpreter_call.completed". + :vartype type: str + :ivar output_index: The index of the output item in the response for which the code interpreter + call is completed. Required. + :vartype output_index: int + :ivar item_id: The unique identifier of the code interpreter tool call item. Required. + :vartype item_id: str + :ivar sequence_number: The sequence number of this event, used to order streaming events. + Required. + :vartype sequence_number: int + """ + + type: Literal["response.code_interpreter_call.completed"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.code_interpreter_call.completed``. Required. Default + value is \"response.code_interpreter_call.completed\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response for which the code interpreter call is completed. + Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the code interpreter tool call item. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event, used to order streaming events. Required.""" + + @overload + def __init__( + self, + *, + output_index: int, + item_id: str, + sequence_number: 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.code_interpreter_call.completed"] = "response.code_interpreter_call.completed" + + +class ResponseCodeInterpreterCallInProgressEvent(_Model): # pylint: disable=name-too-long + """Emitted when a code interpreter call is in progress. + + :ivar type: The type of the event. Always ``response.code_interpreter_call.in_progress``. + Required. Default value is "response.code_interpreter_call.in_progress". + :vartype type: str + :ivar output_index: The index of the output item in the response for which the code interpreter + call is in progress. Required. + :vartype output_index: int + :ivar item_id: The unique identifier of the code interpreter tool call item. Required. + :vartype item_id: str + :ivar sequence_number: The sequence number of this event, used to order streaming events. + Required. + :vartype sequence_number: int + """ + + type: Literal["response.code_interpreter_call.in_progress"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.code_interpreter_call.in_progress``. Required. Default + value is \"response.code_interpreter_call.in_progress\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response for which the code interpreter call is in + progress. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the code interpreter tool call item. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event, used to order streaming events. Required.""" + + @overload + def __init__( + self, + *, + output_index: int, + item_id: str, + sequence_number: 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.code_interpreter_call.in_progress"] = "response.code_interpreter_call.in_progress" + + +class ResponseCodeInterpreterCallInterpretingEvent(_Model): # pylint: disable=name-too-long + """Emitted when the code interpreter is actively interpreting the code snippet. + + :ivar type: The type of the event. Always ``response.code_interpreter_call.interpreting``. + Required. Default value is "response.code_interpreter_call.interpreting". + :vartype type: str + :ivar output_index: The index of the output item in the response for which the code interpreter + is interpreting code. Required. + :vartype output_index: int + :ivar item_id: The unique identifier of the code interpreter tool call item. Required. + :vartype item_id: str + :ivar sequence_number: The sequence number of this event, used to order streaming events. + Required. + :vartype sequence_number: int + """ + + type: Literal["response.code_interpreter_call.interpreting"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.code_interpreter_call.interpreting``. Required. + Default value is \"response.code_interpreter_call.interpreting\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response for which the code interpreter is interpreting + code. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the code interpreter tool call item. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event, used to order streaming events. Required.""" + + @overload + def __init__( + self, + *, + output_index: int, + item_id: str, + sequence_number: 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.code_interpreter_call.interpreting"] = ( + "response.code_interpreter_call.interpreting" + ) + + +class ResponseCompletedEvent(_Model): + """Emitted when the model response is complete. + + :ivar type: The type of the event. Always ``response.completed``. Required. Default value is + "response.completed". + :vartype type: str + :ivar response: Properties of the completed response. Required. + :vartype response: ~azure.ai.projects.models.Response + :ivar sequence_number: The sequence number for this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.completed"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always ``response.completed``. Required. Default value is + \"response.completed\".""" + response: "_models.Response" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Properties of the completed response. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number for this event. Required.""" + + @overload + def __init__( + self, + *, + response: "_models.Response", + sequence_number: 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.completed"] = "response.completed" + + +class ResponseContentPartAddedEvent(_Model): + """Emitted when a new content part is added. + + :ivar type: The type of the event. Always ``response.content_part.added``. Required. Default + value is "response.content_part.added". + :vartype type: str + :ivar item_id: The ID of the output item that the content part was added to. Required. + :vartype item_id: str + :ivar output_index: The index of the output item that the content part was added to. Required. + :vartype output_index: int + :ivar content_index: The index of the content part that was added. Required. + :vartype content_index: int + :ivar part: The content part that was added. Required. + :vartype part: ~azure.ai.projects.models.OutputContent + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.content_part.added"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.content_part.added``. Required. Default value is + \"response.content_part.added\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the output item that the content part was added to. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that the content part was added to. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part that was added. Required.""" + part: "_models.OutputContent" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The content part that was added. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + content_index: int, + part: "_models.OutputContent", + sequence_number: 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.content_part.added"] = "response.content_part.added" + + +class ResponseContentPartDoneEvent(_Model): + """Emitted when a content part is done. + + :ivar type: The type of the event. Always ``response.content_part.done``. Required. Default + value is "response.content_part.done". + :vartype type: str + :ivar item_id: The ID of the output item that the content part was added to. Required. + :vartype item_id: str + :ivar output_index: The index of the output item that the content part was added to. Required. + :vartype output_index: int + :ivar content_index: The index of the content part that is done. Required. + :vartype content_index: int + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + :ivar part: The content part that is done. Required. + :vartype part: ~azure.ai.projects.models.OutputContent + """ + + type: Literal["response.content_part.done"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always ``response.content_part.done``. Required. Default value is + \"response.content_part.done\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the output item that the content part was added to. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that the content part was added to. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part that is done. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + part: "_models.OutputContent" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The content part that is done. Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + content_index: int, + sequence_number: int, + part: "_models.OutputContent", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw 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.content_part.done"] = "response.content_part.done" + + +class ResponseCreatedEvent(_Model): + """An event that is emitted when a response is created. + + :ivar type: The type of the event. Always ``response.created``. Required. Default value is + "response.created". + :vartype type: str + :ivar response: The response that was created. Required. + :vartype response: ~azure.ai.projects.models.Response + :ivar sequence_number: The sequence number for this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.created"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always ``response.created``. Required. Default value is + \"response.created\".""" + response: "_models.Response" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The response that was created. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number for this event. Required.""" + + @overload + def __init__( + self, + *, + response: "_models.Response", + sequence_number: 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.created"] = "response.created" + + +class ResponseCustomToolCallInputDeltaEvent(_Model): + """ResponseCustomToolCallInputDelta. + + :ivar type: The event type identifier. Required. Default value is + "response.custom_tool_call_input.delta". + :vartype type: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + :ivar output_index: The index of the output this delta applies to. Required. + :vartype output_index: int + :ivar item_id: Unique identifier for the API item associated with this event. Required. + :vartype item_id: str + :ivar delta: The incremental input data (delta) for the custom tool call. Required. + :vartype delta: str + """ + + type: Literal["response.custom_tool_call_input.delta"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type identifier. Required. Default value is + \"response.custom_tool_call_input.delta\".""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output this delta applies to. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Unique identifier for the API item associated with this event. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The incremental input data (delta) for the custom tool call. Required.""" + + @overload + def __init__( + self, + *, + sequence_number: int, + output_index: int, + item_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) + self.type: Literal["response.custom_tool_call_input.delta"] = "response.custom_tool_call_input.delta" + + +class ResponseCustomToolCallInputDoneEvent(_Model): + """ResponseCustomToolCallInputDone. + + :ivar type: The event type identifier. Required. Default value is + "response.custom_tool_call_input.done". + :vartype type: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + :ivar output_index: The index of the output this event applies to. Required. + :vartype output_index: int + :ivar item_id: Unique identifier for the API item associated with this event. Required. + :vartype item_id: str + :ivar input: The complete input data for the custom tool call. Required. + :vartype input: str + """ + + type: Literal["response.custom_tool_call_input.done"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The event type identifier. Required. Default value is \"response.custom_tool_call_input.done\".""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output this event applies to. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Unique identifier for the API item associated with this event. Required.""" + input: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The complete input data for the custom tool call. Required.""" + + @overload + def __init__( + self, + *, + sequence_number: int, + output_index: int, + item_id: str, + input: 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.custom_tool_call_input.done"] = "response.custom_tool_call_input.done" + + +class ResponseError(_Model): + """An error object returned when the model fails to generate a Response. + + :ivar code: Required. Known values are: "server_error", "rate_limit_exceeded", + "invalid_prompt", "vector_store_timeout", "invalid_image", "invalid_image_format", + "invalid_base64_image", "invalid_image_url", "image_too_large", "image_too_small", + "image_parse_error", "image_content_policy_violation", "invalid_image_mode", + "image_file_too_large", "unsupported_image_media_type", "empty_image_file", + "failed_to_download_image", and "image_file_not_found". + :vartype code: str or ~azure.ai.projects.models.ResponseErrorCode + :ivar message: A human-readable description of the error. Required. + :vartype message: str + """ + + code: Union[str, "_models.ResponseErrorCode"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"server_error\", \"rate_limit_exceeded\", \"invalid_prompt\", + \"vector_store_timeout\", \"invalid_image\", \"invalid_image_format\", + \"invalid_base64_image\", \"invalid_image_url\", \"image_too_large\", \"image_too_small\", + \"image_parse_error\", \"image_content_policy_violation\", \"invalid_image_mode\", + \"image_file_too_large\", \"unsupported_image_media_type\", \"empty_image_file\", + \"failed_to_download_image\", and \"image_file_not_found\".""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the error. Required.""" + + @overload + def __init__( + self, + *, + code: Union[str, "_models.ResponseErrorCode"], + 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) + + +class ResponseErrorEvent(_Model): + """Emitted when an error occurs. + + :ivar type: The type of the event. Always ``error``. Required. Default value is "error". + :vartype type: str + :ivar code: Required. + :vartype code: str + :ivar message: The error message. Required. + :vartype message: str + :ivar param: Required. + :vartype param: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always ``error``. Required. Default value is \"error\".""" + code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error message. Required.""" + param: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + code: str, + message: str, + param: str, + sequence_number: 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["error"] = "error" + + +class ResponseFailedEvent(_Model): + """An event that is emitted when a response fails. + + :ivar type: The type of the event. Always ``response.failed``. Required. Default value is + "response.failed". + :vartype type: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + :ivar response: The response that failed. Required. + :vartype response: ~azure.ai.projects.models.Response + """ + + type: Literal["response.failed"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always ``response.failed``. Required. Default value is + \"response.failed\".""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + response: "_models.Response" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The response that failed. Required.""" + + @overload + def __init__( + self, + *, + sequence_number: int, + response: "_models.Response", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw 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.failed"] = "response.failed" + + +class ResponseFileSearchCallCompletedEvent(_Model): + """Emitted when a file search call is completed (results found). + + :ivar type: The type of the event. Always ``response.file_search_call.completed``. Required. + Default value is "response.file_search_call.completed". + :vartype type: str + :ivar output_index: The index of the output item that the file search call is initiated. + Required. + :vartype output_index: int + :ivar item_id: The ID of the output item that the file search call is initiated. Required. + :vartype item_id: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.file_search_call.completed"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.file_search_call.completed``. Required. Default value + is \"response.file_search_call.completed\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that the file search call is initiated. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the output item that the file search call is initiated. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + output_index: int, + item_id: str, + sequence_number: 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.file_search_call.completed"] = "response.file_search_call.completed" + + +class ResponseFileSearchCallInProgressEvent(_Model): + """Emitted when a file search call is initiated. + + :ivar type: The type of the event. Always ``response.file_search_call.in_progress``. Required. + Default value is "response.file_search_call.in_progress". + :vartype type: str + :ivar output_index: The index of the output item that the file search call is initiated. + Required. + :vartype output_index: int + :ivar item_id: The ID of the output item that the file search call is initiated. Required. + :vartype item_id: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.file_search_call.in_progress"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.file_search_call.in_progress``. Required. Default + value is \"response.file_search_call.in_progress\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that the file search call is initiated. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the output item that the file search call is initiated. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + output_index: int, + item_id: str, + sequence_number: 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.file_search_call.in_progress"] = "response.file_search_call.in_progress" + + +class ResponseFileSearchCallSearchingEvent(_Model): + """Emitted when a file search is currently searching. + + :ivar type: The type of the event. Always ``response.file_search_call.searching``. Required. + Default value is "response.file_search_call.searching". + :vartype type: str + :ivar output_index: The index of the output item that the file search call is searching. + Required. + :vartype output_index: int + :ivar item_id: The ID of the output item that the file search call is initiated. Required. + :vartype item_id: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.file_search_call.searching"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.file_search_call.searching``. Required. Default value + is \"response.file_search_call.searching\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that the file search call is searching. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the output item that the file search call is initiated. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + output_index: int, + item_id: str, + sequence_number: 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.file_search_call.searching"] = "response.file_search_call.searching" + + +class ResponseFunctionCallArgumentsDeltaEvent(_Model): + """Emitted when there is a partial function-call arguments delta. + + :ivar type: The type of the event. Always ``response.function_call_arguments.delta``. Required. + Default value is "response.function_call_arguments.delta". + :vartype type: str + :ivar item_id: The ID of the output item that the function-call arguments delta is added to. + Required. + :vartype item_id: str + :ivar output_index: The index of the output item that the function-call arguments delta is + added to. Required. + :vartype output_index: int + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + :ivar delta: The function-call arguments delta that is added. Required. + :vartype delta: str + """ + + type: Literal["response.function_call_arguments.delta"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.function_call_arguments.delta``. Required. Default + value is \"response.function_call_arguments.delta\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the output item that the function-call arguments delta is added to. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that the function-call arguments delta is added to. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The function-call arguments delta that is added. Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + sequence_number: 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) + self.type: Literal["response.function_call_arguments.delta"] = "response.function_call_arguments.delta" + + +class ResponseFunctionCallArgumentsDoneEvent(_Model): + """Emitted when function-call arguments are finalized. + + :ivar type: Required. Default value is "response.function_call_arguments.done". + :vartype type: str + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar name: The name of the function that was called. Required. + :vartype name: str + :ivar output_index: The index of the output item. Required. + :vartype output_index: int + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + :ivar arguments: The function-call arguments. Required. + :vartype arguments: str + """ + + type: Literal["response.function_call_arguments.done"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Default value is \"response.function_call_arguments.done\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function that was called. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The function-call arguments. Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + name: str, + output_index: int, + sequence_number: 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) + self.type: Literal["response.function_call_arguments.done"] = "response.function_call_arguments.done" + + +class ResponseImageGenCallCompletedEvent(_Model): + """ResponseImageGenCallCompletedEvent. + + :ivar type: The type of the event. Always 'response.image_generation_call.completed'. Required. + Default value is "response.image_generation_call.completed". + :vartype type: str + :ivar output_index: The index of the output item in the response's output array. Required. + :vartype output_index: int + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + :ivar item_id: The unique identifier of the image generation item being processed. Required. + :vartype item_id: str + """ + + type: Literal["response.image_generation_call.completed"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always 'response.image_generation_call.completed'. Required. Default + value is \"response.image_generation_call.completed\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response's output array. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the image generation item being processed. Required.""" + + @overload + def __init__( + self, + *, + output_index: int, + sequence_number: 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) + self.type: Literal["response.image_generation_call.completed"] = "response.image_generation_call.completed" + + +class ResponseImageGenCallGeneratingEvent(_Model): + """ResponseImageGenCallGeneratingEvent. + + :ivar type: The type of the event. Always 'response.image_generation_call.generating'. + Required. Default value is "response.image_generation_call.generating". + :vartype type: str + :ivar output_index: The index of the output item in the response's output array. Required. + :vartype output_index: int + :ivar item_id: The unique identifier of the image generation item being processed. Required. + :vartype item_id: str + :ivar sequence_number: The sequence number of the image generation item being processed. + Required. + :vartype sequence_number: int + """ + + type: Literal["response.image_generation_call.generating"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always 'response.image_generation_call.generating'. Required. Default + value is \"response.image_generation_call.generating\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response's output array. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the image generation item being processed. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of the image generation item being processed. Required.""" + + @overload + def __init__( + self, + *, + output_index: int, + item_id: str, + sequence_number: 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.image_generation_call.generating"] = "response.image_generation_call.generating" + + +class ResponseImageGenCallInProgressEvent(_Model): + """ResponseImageGenCallInProgressEvent. + + :ivar type: The type of the event. Always 'response.image_generation_call.in_progress'. + Required. Default value is "response.image_generation_call.in_progress". + :vartype type: str + :ivar output_index: The index of the output item in the response's output array. Required. + :vartype output_index: int + :ivar item_id: The unique identifier of the image generation item being processed. Required. + :vartype item_id: str + :ivar sequence_number: The sequence number of the image generation item being processed. + Required. + :vartype sequence_number: int + """ + + type: Literal["response.image_generation_call.in_progress"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always 'response.image_generation_call.in_progress'. Required. Default + value is \"response.image_generation_call.in_progress\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response's output array. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the image generation item being processed. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of the image generation item being processed. Required.""" + + @overload + def __init__( + self, + *, + output_index: int, + item_id: str, + sequence_number: 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.image_generation_call.in_progress"] = "response.image_generation_call.in_progress" + + +class ResponseImageGenCallPartialImageEvent(_Model): + """ResponseImageGenCallPartialImageEvent. + + :ivar type: The type of the event. Always 'response.image_generation_call.partial_image'. + Required. Default value is "response.image_generation_call.partial_image". + :vartype type: str + :ivar output_index: The index of the output item in the response's output array. Required. + :vartype output_index: int + :ivar item_id: The unique identifier of the image generation item being processed. Required. + :vartype item_id: str + :ivar sequence_number: The sequence number of the image generation item being processed. + Required. + :vartype sequence_number: int + :ivar partial_image_index: 0-based index for the partial image (backend is 1-based, but this is + 0-based for the user). Required. + :vartype partial_image_index: int + :ivar partial_image_b64: Base64-encoded partial image data, suitable for rendering as an image. + Required. + :vartype partial_image_b64: str + """ + + type: Literal["response.image_generation_call.partial_image"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always 'response.image_generation_call.partial_image'. Required. Default + value is \"response.image_generation_call.partial_image\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response's output array. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the image generation item being processed. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of the image generation item being processed. Required.""" + partial_image_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """0-based index for the partial image (backend is 1-based, but this is 0-based for the user). + Required.""" + partial_image_b64: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded partial image data, suitable for rendering as an image. Required.""" + + @overload + def __init__( + self, + *, + output_index: int, + item_id: str, + sequence_number: int, + partial_image_index: int, + partial_image_b64: 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.image_generation_call.partial_image"] = ( + "response.image_generation_call.partial_image" + ) + + +class ResponseIncompleteDetails(_Model): + """ResponseIncompleteDetails. + + :ivar reason: Is either a Literal["max_output_tokens"] type or a Literal["content_filter"] + type. + :vartype reason: str or str + """ + + reason: Optional[Literal["max_output_tokens", "content_filter"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a Literal[\"max_output_tokens\"] type or a Literal[\"content_filter\"] type.""" + + @overload + def __init__( + self, + *, + reason: Optional[Literal["max_output_tokens", "content_filter"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ResponseIncompleteEvent(_Model): + """An event that is emitted when a response finishes as incomplete. + + :ivar type: The type of the event. Always ``response.incomplete``. Required. Default value is + "response.incomplete". + :vartype type: str + :ivar response: The response that was incomplete. Required. + :vartype response: ~azure.ai.projects.models.Response + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.incomplete"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always ``response.incomplete``. Required. Default value is + \"response.incomplete\".""" + response: "_models.Response" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The response that was incomplete. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + response: "_models.Response", + sequence_number: 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.incomplete"] = "response.incomplete" + + +class ResponseInProgressEvent(_Model): + """Emitted when the response is in progress. + + :ivar type: The type of the event. Always ``response.in_progress``. Required. Default value is + "response.in_progress". + :vartype type: str + :ivar response: The response that is in progress. Required. + :vartype response: ~azure.ai.projects.models.Response + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.in_progress"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always ``response.in_progress``. Required. Default value is + \"response.in_progress\".""" + response: "_models.Response" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The response that is in progress. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + response: "_models.Response", + sequence_number: 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.in_progress"] = "response.in_progress" + + +class ResponseLogProb(_Model): + """A logprob is the logarithmic probability that the model assigns to producing a particular token + at a given position in the sequence. Less-negative (higher) logprob values indicate greater + model confidence in that token choice. + + :ivar token: A possible text token. Required. + :vartype token: str + :ivar logprob: The log probability of this token. Required. + :vartype logprob: float + :ivar top_logprobs: The log probability of the top 20 most likely tokens. + :vartype top_logprobs: list[~azure.ai.projects.models.ResponseLogProbTopLogprobs] + """ + + token: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A possible text token. Required.""" + logprob: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The log probability of this token. Required.""" + top_logprobs: Optional[list["_models.ResponseLogProbTopLogprobs"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The log probability of the top 20 most likely tokens.""" + + @overload + def __init__( + self, + *, + token: str, + logprob: float, + top_logprobs: Optional[list["_models.ResponseLogProbTopLogprobs"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ResponseLogProbTopLogprobs(_Model): + """ResponseLogProbTopLogprobs. + + :ivar token: + :vartype token: str + :ivar logprob: + :vartype logprob: float + """ + + token: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + logprob: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + token: Optional[str] = None, + logprob: 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 ResponseMCPCallArgumentsDeltaEvent(_Model): + """ResponseMCPCallArgumentsDeltaEvent. + + :ivar type: The type of the event. Always 'response.mcp_call_arguments.delta'. Required. + Default value is "response.mcp_call_arguments.delta". + :vartype type: str + :ivar output_index: The index of the output item in the response's output array. Required. + :vartype output_index: int + :ivar item_id: The unique identifier of the MCP tool call item being processed. Required. + :vartype item_id: str + :ivar delta: A JSON string containing the partial update to the arguments for the MCP tool + call. Required. + :vartype delta: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.mcp_call_arguments.delta"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always 'response.mcp_call_arguments.delta'. Required. Default value is + \"response.mcp_call_arguments.delta\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response's output array. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the MCP tool call item being processed. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A JSON string containing the partial update to the arguments for the MCP tool call. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + output_index: int, + item_id: str, + delta: str, + sequence_number: 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.mcp_call_arguments.delta"] = "response.mcp_call_arguments.delta" + + +class ResponseMCPCallArgumentsDoneEvent(_Model): + """ResponseMCPCallArgumentsDoneEvent. + + :ivar type: The type of the event. Always 'response.mcp_call_arguments.done'. Required. Default + value is "response.mcp_call_arguments.done". + :vartype type: str + :ivar output_index: The index of the output item in the response's output array. Required. + :vartype output_index: int + :ivar item_id: The unique identifier of the MCP tool call item being processed. Required. + :vartype item_id: str + :ivar arguments: A JSON string containing the finalized arguments for the MCP tool call. + Required. + :vartype arguments: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.mcp_call_arguments.done"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always 'response.mcp_call_arguments.done'. Required. Default value is + \"response.mcp_call_arguments.done\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response's output array. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the MCP tool call item being processed. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A JSON string containing the finalized arguments for the MCP tool call. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + output_index: int, + item_id: str, + arguments: str, + sequence_number: 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.mcp_call_arguments.done"] = "response.mcp_call_arguments.done" + + +class ResponseMCPCallCompletedEvent(_Model): + """ResponseMCPCallCompletedEvent. + + :ivar type: The type of the event. Always 'response.mcp_call.completed'. Required. Default + value is "response.mcp_call.completed". + :vartype type: str + :ivar item_id: The ID of the MCP tool call item that completed. Required. + :vartype item_id: str + :ivar output_index: The index of the output item that completed. Required. + :vartype output_index: int + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.mcp_call.completed"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always 'response.mcp_call.completed'. Required. Default value is + \"response.mcp_call.completed\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP tool call item that completed. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that completed. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + sequence_number: 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.mcp_call.completed"] = "response.mcp_call.completed" + + +class ResponseMCPCallFailedEvent(_Model): + """ResponseMCPCallFailedEvent. + + :ivar type: The type of the event. Always 'response.mcp_call.failed'. Required. Default value + is "response.mcp_call.failed". + :vartype type: str + :ivar item_id: The ID of the MCP tool call item that failed. Required. + :vartype item_id: str + :ivar output_index: The index of the output item that failed. Required. + :vartype output_index: int + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.mcp_call.failed"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always 'response.mcp_call.failed'. Required. Default value is + \"response.mcp_call.failed\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP tool call item that failed. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that failed. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + sequence_number: 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.mcp_call.failed"] = "response.mcp_call.failed" + + +class ResponseMCPCallInProgressEvent(_Model): + """ResponseMCPCallInProgressEvent. + + :ivar type: The type of the event. Always 'response.mcp_call.in_progress'. Required. Default + value is "response.mcp_call.in_progress". + :vartype type: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + :ivar output_index: The index of the output item in the response's output array. Required. + :vartype output_index: int + :ivar item_id: The unique identifier of the MCP tool call item being processed. Required. + :vartype item_id: str + """ + + type: Literal["response.mcp_call.in_progress"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always 'response.mcp_call.in_progress'. Required. Default value is + \"response.mcp_call.in_progress\".""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response's output array. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the MCP tool call item being processed. Required.""" + + @overload + def __init__( + self, + *, + sequence_number: int, + 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) + self.type: Literal["response.mcp_call.in_progress"] = "response.mcp_call.in_progress" + + +class ResponseMCPListToolsCompletedEvent(_Model): + """ResponseMCPListToolsCompletedEvent. + + :ivar type: The type of the event. Always 'response.mcp_list_tools.completed'. Required. + Default value is "response.mcp_list_tools.completed". + :vartype type: str + :ivar item_id: The ID of the MCP tool call item that produced this output. Required. + :vartype item_id: str + :ivar output_index: The index of the output item that was processed. Required. + :vartype output_index: int + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.mcp_list_tools.completed"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always 'response.mcp_list_tools.completed'. Required. Default value is + \"response.mcp_list_tools.completed\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP tool call item that produced this output. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that was processed. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + sequence_number: 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.mcp_list_tools.completed"] = "response.mcp_list_tools.completed" + + +class ResponseMCPListToolsFailedEvent(_Model): + """ResponseMCPListToolsFailedEvent. + + :ivar type: The type of the event. Always 'response.mcp_list_tools.failed'. Required. Default + value is "response.mcp_list_tools.failed". + :vartype type: str + :ivar item_id: The ID of the MCP tool call item that failed. Required. + :vartype item_id: str + :ivar output_index: The index of the output item that failed. Required. + :vartype output_index: int + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.mcp_list_tools.failed"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always 'response.mcp_list_tools.failed'. Required. Default value is + \"response.mcp_list_tools.failed\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP tool call item that failed. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that failed. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + sequence_number: 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.mcp_list_tools.failed"] = "response.mcp_list_tools.failed" + + +class ResponseMCPListToolsInProgressEvent(_Model): + """ResponseMCPListToolsInProgressEvent. + + :ivar type: The type of the event. Always 'response.mcp_list_tools.in_progress'. Required. + Default value is "response.mcp_list_tools.in_progress". + :vartype type: str + :ivar item_id: The ID of the MCP tool call item that is being processed. Required. + :vartype item_id: str + :ivar output_index: The index of the output item that is being processed. Required. + :vartype output_index: int + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.mcp_list_tools.in_progress"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always 'response.mcp_list_tools.in_progress'. Required. Default value is + \"response.mcp_list_tools.in_progress\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the MCP tool call item that is being processed. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that is being processed. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + sequence_number: 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.mcp_list_tools.in_progress"] = "response.mcp_list_tools.in_progress" + + +class ResponseOutputItemAddedEvent(_Model): + """Emitted when a new output item is added. + + :ivar type: The type of the event. Always ``response.output_item.added``. Required. Default + value is "response.output_item.added". + :vartype type: str + :ivar output_index: The index of the output item that was added. Required. + :vartype output_index: int + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + :ivar item: The output item that was added. Required. + :vartype item: ~azure.ai.projects.models.OutputItem + """ + + type: Literal["response.output_item.added"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always ``response.output_item.added``. Required. Default value is + \"response.output_item.added\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that was added. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + item: "_models.OutputItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The output item that was added. Required.""" + + @overload + def __init__( + self, + *, + output_index: int, + sequence_number: int, + item: "_models.OutputItem", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw 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.output_item.added"] = "response.output_item.added" + + +class ResponseOutputItemDoneEvent(_Model): + """Emitted when an output item is marked done. + + :ivar type: The type of the event. Always ``response.output_item.done``. Required. Default + value is "response.output_item.done". + :vartype type: str + :ivar output_index: The index of the output item that was marked done. Required. + :vartype output_index: int + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + :ivar item: The output item that was marked done. Required. + :vartype item: ~azure.ai.projects.models.OutputItem + """ + + type: Literal["response.output_item.done"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always ``response.output_item.done``. Required. Default value is + \"response.output_item.done\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that was marked done. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + item: "_models.OutputItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The output item that was marked done. Required.""" + + @overload + def __init__( + self, + *, + output_index: int, + sequence_number: int, + item: "_models.OutputItem", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw 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.output_item.done"] = "response.output_item.done" + + +class ResponseOutputTextAnnotationAddedEvent(_Model): + """ResponseOutputTextAnnotationAddedEvent. + + :ivar type: The type of the event. Always 'response.output_text.annotation.added'. Required. + Default value is "response.output_text.annotation.added". + :vartype type: str + :ivar item_id: The unique identifier of the item to which the annotation is being added. + Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response's output array. Required. + :vartype output_index: int + :ivar content_index: The index of the content part within the output item. Required. + :vartype content_index: int + :ivar annotation_index: The index of the annotation within the content part. Required. + :vartype annotation_index: int + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + :ivar annotation: The annotation object being added. (See annotation schema for details.). + Required. + :vartype annotation: ~azure.ai.projects.models.Annotation + """ + + type: Literal["response.output_text.annotation.added"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always 'response.output_text.annotation.added'. Required. Default value + is \"response.output_text.annotation.added\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the item to which the annotation is being added. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response's output array. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part within the output item. Required.""" + annotation_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the annotation within the content part. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + annotation: "_models.Annotation" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The annotation object being added. (See annotation schema for details.). Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + content_index: int, + annotation_index: int, + sequence_number: int, + annotation: "_models.Annotation", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw 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.output_text.annotation.added"] = "response.output_text.annotation.added" + + +class ResponsePromptVariables(_Model): + """Prompt Variables.""" + + +class ResponseQueuedEvent(_Model): + """ResponseQueuedEvent. + + :ivar type: The type of the event. Always 'response.queued'. Required. Default value is + "response.queued". + :vartype type: str + :ivar response: The full response object that is queued. Required. + :vartype response: ~azure.ai.projects.models.Response + :ivar sequence_number: The sequence number for this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.queued"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always 'response.queued'. Required. Default value is + \"response.queued\".""" + response: "_models.Response" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The full response object that is queued. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number for this event. Required.""" + + @overload + def __init__( + self, + *, + response: "_models.Response", + sequence_number: 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.queued"] = "response.queued" + + +class ResponseReasoningSummaryPartAddedEvent(_Model): + """Emitted when a new reasoning summary part is added. + + :ivar type: The type of the event. Always ``response.reasoning_summary_part.added``. Required. + Default value is "response.reasoning_summary_part.added". + :vartype type: str + :ivar item_id: The ID of the item this summary part is associated with. Required. + :vartype item_id: str + :ivar output_index: The index of the output item this summary part is associated with. + Required. + :vartype output_index: int + :ivar summary_index: The index of the summary part within the reasoning summary. Required. + :vartype summary_index: int + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + :ivar part: The summary part that was added. Required. + :vartype part: ~azure.ai.projects.models.ResponseReasoningSummaryPartAddedEventPart + """ + + type: Literal["response.reasoning_summary_part.added"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.reasoning_summary_part.added``. Required. Default + value is \"response.reasoning_summary_part.added\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item this summary part is associated with. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item this summary part is associated with. Required.""" + summary_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the summary part within the reasoning summary. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + part: "_models.ResponseReasoningSummaryPartAddedEventPart" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The summary part that was added. Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + summary_index: int, + sequence_number: int, + part: "_models.ResponseReasoningSummaryPartAddedEventPart", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw 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.reasoning_summary_part.added"] = "response.reasoning_summary_part.added" + + +class ResponseReasoningSummaryPartAddedEventPart(_Model): # pylint: disable=name-too-long + """ResponseReasoningSummaryPartAddedEventPart. - We generally recommend altering this or ``temperature`` but not both. - :vartype top_p: float - :ivar reasoning: - :vartype reasoning: ~azure.ai.projects.models.Reasoning - :ivar tools: An array of tools the model may call while generating a response. You can specify - which tool to use by setting the ``tool_choice`` parameter. - :vartype tools: list[~azure.ai.projects.models.Tool] - :ivar tool_choice: How the model should select which tool (or tools) to use when generating a - response. See the ``tools`` parameter to see how to specify which tools the model can call. Is - either a str type or a ToolChoiceParam type. - :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceParam - :ivar text: Configuration options for a text response from the model. Can be plain text or - structured JSON data. - :vartype text: ~azure.ai.projects.models.PromptAgentDefinitionTextOptions - :ivar structured_inputs: Set of structured inputs that can participate in prompt template - substitution or tool argument bindings. - :vartype structured_inputs: dict[str, ~azure.ai.projects.models.StructuredInputDefinition] + :ivar type: Required. Default value is "summary_text". + :vartype type: str + :ivar text: Required. + :vartype text: str """ - 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.""" - 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.""" - 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( + type: Literal["summary_text"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"summary_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["summary_text"] = "summary_text" + + +class ResponseReasoningSummaryPartDoneEvent(_Model): + """Emitted when a reasoning summary part is completed. + + :ivar type: The type of the event. Always ``response.reasoning_summary_part.done``. Required. + Default value is "response.reasoning_summary_part.done". + :vartype type: str + :ivar item_id: The ID of the item this summary part is associated with. Required. + :vartype item_id: str + :ivar output_index: The index of the output item this summary part is associated with. + Required. + :vartype output_index: int + :ivar summary_index: The index of the summary part within the reasoning summary. Required. + :vartype summary_index: int + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + :ivar part: The completed summary part. Required. + :vartype part: ~azure.ai.projects.models.ResponseReasoningSummaryPartDoneEventPart + """ + + type: Literal["response.reasoning_summary_part.done"] = 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( + """The type of the event. Always ``response.reasoning_summary_part.done``. Required. Default value + is \"response.reasoning_summary_part.done\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item this summary part is associated with. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item this summary part is associated with. Required.""" + summary_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the summary part within the reasoning summary. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + part: "_models.ResponseReasoningSummaryPartDoneEventPart" = 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( + """The completed summary part. Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + summary_index: int, + sequence_number: int, + part: "_models.ResponseReasoningSummaryPartDoneEventPart", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw 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.reasoning_summary_part.done"] = "response.reasoning_summary_part.done" + + +class ResponseReasoningSummaryPartDoneEventPart(_Model): # pylint: disable=name-too-long + """ResponseReasoningSummaryPartDoneEventPart. + + :ivar type: Required. Default value is "summary_text". + :vartype type: str + :ivar text: Required. + :vartype text: str + """ + + type: Literal["summary_text"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"summary_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["summary_text"] = "summary_text" + + +class ResponseReasoningSummaryTextDeltaEvent(_Model): + """Emitted when a delta is added to a reasoning summary text. + + :ivar type: The type of the event. Always ``response.reasoning_summary_text.delta``. Required. + Default value is "response.reasoning_summary_text.delta". + :vartype type: str + :ivar item_id: The ID of the item this summary text delta is associated with. Required. + :vartype item_id: str + :ivar output_index: The index of the output item this summary text delta is associated with. + Required. + :vartype output_index: int + :ivar summary_index: The index of the summary part within the reasoning summary. Required. + :vartype summary_index: int + :ivar delta: The text delta that was added to the summary. Required. + :vartype delta: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.reasoning_summary_text.delta"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Set of structured inputs that can participate in prompt template substitution or tool argument - bindings.""" + """The type of the event. Always ``response.reasoning_summary_text.delta``. Required. Default + value is \"response.reasoning_summary_text.delta\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item this summary text delta is associated with. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item this summary text delta is associated with. Required.""" + summary_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the summary part within the reasoning summary. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text delta that was added to the summary. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. 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, + item_id: str, + output_index: int, + summary_index: int, + delta: str, + sequence_number: int, ) -> None: ... @overload @@ -11626,26 +15956,53 @@ 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: Literal["response.reasoning_summary_text.delta"] = "response.reasoning_summary_text.delta" -class PromptAgentDefinitionTextOptions(_Model): - """Configuration options for a text response from the model. Can be plain text or structured JSON - data. +class ResponseReasoningSummaryTextDoneEvent(_Model): + """Emitted when a reasoning summary text is completed. - :ivar format: - :vartype format: ~azure.ai.projects.models.TextResponseFormatConfiguration + :ivar type: The type of the event. Always ``response.reasoning_summary_text.done``. Required. + Default value is "response.reasoning_summary_text.done". + :vartype type: str + :ivar item_id: The ID of the item this summary text is associated with. Required. + :vartype item_id: str + :ivar output_index: The index of the output item this summary text is associated with. + Required. + :vartype output_index: int + :ivar summary_index: The index of the summary part within the reasoning summary. Required. + :vartype summary_index: int + :ivar text: The full text of the completed reasoning summary. Required. + :vartype text: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int """ - format: Optional["_models.TextResponseFormatConfiguration"] = rest_field( + type: Literal["response.reasoning_summary_text.done"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) + """The type of the event. Always ``response.reasoning_summary_text.done``. Required. Default value + is \"response.reasoning_summary_text.done\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item this summary text is associated with. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item this summary text is associated with. Required.""" + summary_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the summary part within the reasoning summary. Required.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The full text of the completed reasoning summary. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" @overload def __init__( self, *, - format: Optional["_models.TextResponseFormatConfiguration"] = None, + item_id: str, + output_index: int, + summary_index: int, + text: str, + sequence_number: int, ) -> None: ... @overload @@ -11657,38 +16014,54 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["response.reasoning_summary_text.done"] = "response.reasoning_summary_text.done" -class PromptBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="prompt"): - """Prompt-based evaluator. +class ResponseReasoningTextDeltaEvent(_Model): + """Emitted when a delta is added to a reasoning text. - :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 type: The type of the event. Always ``response.reasoning_text.delta``. Required. Default + value is "response.reasoning_text.delta". + :vartype type: str + :ivar item_id: The ID of the item this reasoning text delta is associated with. Required. + :vartype item_id: str + :ivar output_index: The index of the output item this reasoning text delta is associated with. + Required. + :vartype output_index: int + :ivar content_index: The index of the reasoning content part this delta is associated with. + Required. + :vartype content_index: int + :ivar delta: The text delta that was added to the reasoning content. Required. + :vartype delta: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int """ - 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.""" + type: Literal["response.reasoning_text.delta"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.reasoning_text.delta``. Required. Default value is + \"response.reasoning_text.delta\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item this reasoning text delta is associated with. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item this reasoning text delta is associated with. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the reasoning content part this delta is associated with. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text delta that was added to the reasoning content. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. 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, + item_id: str, + output_index: int, + content_index: int, + delta: str, + sequence_number: int, ) -> None: ... @overload @@ -11700,32 +16073,224 @@ 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 + self.type: Literal["response.reasoning_text.delta"] = "response.reasoning_text.delta" -class ProtocolVersionRecord(_Model): - """A record mapping for a single protocol and its version. +class ResponseReasoningTextDoneEvent(_Model): + """Emitted when a reasoning text is completed. + + :ivar type: The type of the event. Always ``response.reasoning_text.done``. Required. Default + value is "response.reasoning_text.done". + :vartype type: str + :ivar item_id: The ID of the item this reasoning text is associated with. Required. + :vartype item_id: str + :ivar output_index: The index of the output item this reasoning text is associated with. + Required. + :vartype output_index: int + :ivar content_index: The index of the reasoning content part. Required. + :vartype content_index: int + :ivar text: The full text of the completed reasoning content. Required. + :vartype text: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.reasoning_text.done"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.reasoning_text.done``. Required. Default value is + \"response.reasoning_text.done\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item this reasoning text is associated with. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item this reasoning text is associated with. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the reasoning content part. Required.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The full text of the completed reasoning content. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + content_index: int, + text: str, + sequence_number: 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.reasoning_text.done"] = "response.reasoning_text.done" + + +class ResponseRefusalDeltaEvent(_Model): + """Emitted when there is a partial refusal text. + + :ivar type: The type of the event. Always ``response.refusal.delta``. Required. Default value + is "response.refusal.delta". + :vartype type: str + :ivar item_id: The ID of the output item that the refusal text is added to. Required. + :vartype item_id: str + :ivar output_index: The index of the output item that the refusal text is added to. Required. + :vartype output_index: int + :ivar content_index: The index of the content part that the refusal text is added to. Required. + :vartype content_index: int + :ivar delta: The refusal text that is added. Required. + :vartype delta: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.refusal.delta"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always ``response.refusal.delta``. Required. Default value is + \"response.refusal.delta\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the output item that the refusal text is added to. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that the refusal text is added to. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part that the refusal text is added to. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The refusal text that is added. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + content_index: int, + delta: str, + sequence_number: 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.refusal.delta"] = "response.refusal.delta" + + +class ResponseRefusalDoneEvent(_Model): + """Emitted when refusal text is finalized. + + :ivar type: The type of the event. Always ``response.refusal.done``. Required. Default value is + "response.refusal.done". + :vartype type: str + :ivar item_id: The ID of the output item that the refusal text is finalized. Required. + :vartype item_id: str + :ivar output_index: The index of the output item that the refusal text is finalized. Required. + :vartype output_index: int + :ivar content_index: The index of the content part that the refusal text is finalized. + Required. + :vartype content_index: int + :ivar refusal: The refusal text that is finalized. Required. + :vartype refusal: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int + """ + + type: Literal["response.refusal.done"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always ``response.refusal.done``. Required. Default value is + \"response.refusal.done\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the output item that the refusal text is finalized. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that the refusal text is finalized. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part that the refusal text is finalized. Required.""" + refusal: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The refusal text that is finalized. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of this event. Required.""" + + @overload + def __init__( + self, + *, + item_id: str, + output_index: int, + content_index: int, + refusal: str, + sequence_number: 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.refusal.done"] = "response.refusal.done" + + +class ResponseTextDeltaEvent(_Model): + """Emitted when there is an additional text delta. - :ivar protocol: The protocol type. Required. Known values are: "activity_protocol" and - "responses". - :vartype protocol: str or ~azure.ai.projects.models.AgentProtocol - :ivar version: The version string for the protocol, e.g. 'v0.1.1'. Required. - :vartype version: str + :ivar type: The type of the event. Always ``response.output_text.delta``. Required. Default + value is "response.output_text.delta". + :vartype type: str + :ivar item_id: The ID of the output item that the text delta was added to. Required. + :vartype item_id: str + :ivar output_index: The index of the output item that the text delta was added to. Required. + :vartype output_index: int + :ivar content_index: The index of the content part that the text delta was added to. Required. + :vartype content_index: int + :ivar delta: The text delta that was added. Required. + :vartype delta: str + :ivar sequence_number: The sequence number for this event. Required. + :vartype sequence_number: int + :ivar logprobs: The log probabilities of the tokens in the delta. Required. + :vartype logprobs: list[~azure.ai.projects.models.ResponseLogProb] """ - protocol: Union[str, "_models.AgentProtocol"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The protocol type. Required. Known values are: \"activity_protocol\" and \"responses\".""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version string for the protocol, e.g. 'v0.1.1'. Required.""" + type: Literal["response.output_text.delta"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always ``response.output_text.delta``. Required. Default value is + \"response.output_text.delta\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the output item that the text delta was added to. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that the text delta was added to. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part that the text delta was added to. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text delta that was added. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number for this event. Required.""" + logprobs: list["_models.ResponseLogProb"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The log probabilities of the tokens in the delta. Required.""" @overload def __init__( self, *, - protocol: Union[str, "_models.AgentProtocol"], - version: str, + item_id: str, + output_index: int, + content_index: int, + delta: str, + sequence_number: int, + logprobs: list["_models.ResponseLogProb"], ) -> None: ... @overload @@ -11737,23 +16302,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["response.output_text.delta"] = "response.output_text.delta" -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. - :vartype rai_policy_name: str - """ +class ResponseTextDoneEvent(_Model): + """Emitted when text content is finalized. - rai_policy_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the RAI policy to apply. Required.""" + :ivar type: The type of the event. Always ``response.output_text.done``. Required. Default + value is "response.output_text.done". + :vartype type: str + :ivar item_id: The ID of the output item that the text content is finalized. Required. + :vartype item_id: str + :ivar output_index: The index of the output item that the text content is finalized. Required. + :vartype output_index: int + :ivar content_index: The index of the content part that the text content is finalized. + Required. + :vartype content_index: int + :ivar text: The text content that is finalized. Required. + :vartype text: str + :ivar sequence_number: The sequence number for this event. Required. + :vartype sequence_number: int + :ivar logprobs: The log probabilities of the tokens in the delta. Required. + :vartype logprobs: list[~azure.ai.projects.models.ResponseLogProb] + """ + + type: Literal["response.output_text.done"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the event. Always ``response.output_text.done``. Required. Default value is + \"response.output_text.done\".""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the output item that the text content is finalized. Required.""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that the text content is finalized. Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part that the text content is finalized. Required.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text content that is finalized. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number for this event. Required.""" + logprobs: list["_models.ResponseLogProb"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The log probabilities of the tokens in the delta. Required.""" @overload def __init__( self, *, - rai_policy_name: str, + item_id: str, + output_index: int, + content_index: int, + text: str, + sequence_number: int, + logprobs: list["_models.ResponseLogProb"], ) -> None: ... @overload @@ -11765,43 +16363,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["response.output_text.done"] = "response.output_text.done" -class RankingOptions(_Model): - """RankingOptions. +class ResponseTextParam(_Model): + """Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: - :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 + * [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + * [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + + :ivar format: + :vartype format: ~azure.ai.projects.models.TextResponseFormatConfiguration + :ivar verbosity: Is one of the following types: Literal["low"], Literal["medium"], + Literal["high"] + :vartype verbosity: str or str or str """ - ranker: Optional[Union[str, "_models.RankerVersionType"]] = rest_field( + format: Optional["_models.TextResponseFormatConfiguration"] = 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( + verbosity: Optional[Literal["low", "medium", "high"]] = 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.""" + """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"]""" @overload def __init__( self, *, - ranker: Optional[Union[str, "_models.RankerVersionType"]] = None, - score_threshold: Optional[float] = None, - hybrid_search: Optional["_models.HybridSearchOptions"] = None, + format: Optional["_models.TextResponseFormatConfiguration"] = None, + verbosity: Optional[Literal["low", "medium", "high"]] = None, ) -> None: ... @overload @@ -11815,41 +16407,46 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Reasoning(_Model): - """Reasoning. +class ResponseUsage(_Model): + """Represents token usage details including input tokens, output tokens, a breakdown of output + tokens, and the total tokens used. - :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 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 """ - 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( + 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"] ) - """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" - generate_summary: Optional[Literal["auto", "concise", "detailed"]] = rest_field( + """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"] ) - """Is one of the following types: Literal[\"auto\"], Literal[\"concise\"], Literal[\"detailed\"]""" + """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, *, - 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, + input_tokens: int, + input_tokens_details: "_models.ResponseUsageInputTokensDetails", + output_tokens: int, + output_tokens_details: "_models.ResponseUsageOutputTokensDetails", + total_tokens: int, ) -> None: ... @overload @@ -11863,26 +16460,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ReasoningTextContent(OutputContent, discriminator="reasoning_text"): - """ReasoningTextContent. +class ResponseUsageInputTokensDetails(_Model): + """ResponseUsageInputTokensDetails. - :ivar type: The type of the reasoning text. Always ``reasoning_text``. Required. - REASONING_TEXT. - :vartype type: str or ~azure.ai.projects.models.REASONING_TEXT - :ivar text: The reasoning text from the model. Required. - :vartype text: str + :ivar cached_tokens: Required. + :vartype cached_tokens: int """ - type: Literal[OutputContentType.REASONING_TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the reasoning text. Always ``reasoning_text``. Required. REASONING_TEXT.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The reasoning text from the model. Required.""" + cached_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - text: str, + cached_tokens: int, ) -> None: ... @overload @@ -11894,48 +16486,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OutputContentType.REASONING_TEXT # type: ignore -class RecurrenceTrigger(Trigger, discriminator="Recurrence"): - """Recurrence based trigger. +class ResponseUsageOutputTokensDetails(_Model): + """ResponseUsageOutputTokensDetails. - :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: 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. - :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 reasoning_tokens: Required. + :vartype reasoning_tokens: 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[str] = rest_field(name="startTime", visibility=["read", "create", "update", "delete", "query"]) - """Start time for the recurrence schedule in ISO 8601 format.""" - end_time: Optional[str] = rest_field(name="endTime", 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.""" - 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.""" + reasoning_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - interval: int, - schedule: "_models.RecurrenceSchedule", - start_time: Optional[str] = None, - end_time: Optional[str] = None, - time_zone: Optional[str] = None, + reasoning_tokens: int, ) -> None: ... @overload @@ -11947,87 +16514,42 @@ 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. +class ResponseWebSearchCallCompletedEvent(_Model): + """Emitted when a web search call is completed. - :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. Default false, if true the - scan outputs conversation not evaluation result. - :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.TargetConfig + :ivar type: The type of the event. Always ``response.web_search_call.completed``. Required. + Default value is "response.web_search_call.completed". + :vartype type: str + :ivar output_index: The index of the output item that the web search call is associated with. + Required. + :vartype output_index: int + :ivar item_id: Unique ID for the output item associated with the web search call. Required. + :vartype item_id: str + :ivar sequence_number: The sequence number of the web search call being processed. Required. + :vartype sequence_number: int """ - 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. Default false, if true the scan outputs - conversation not evaluation result.""" - 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"] + type: Literal["response.web_search_call.completed"] = 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.TargetConfig" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Target configuration for the red-team run. Required.""" + """The type of the event. Always ``response.web_search_call.completed``. Required. Default value + is \"response.web_search_call.completed\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that the web search call is associated with. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Unique ID for the output item associated with the web search call. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of the web search call being processed. Required.""" @overload def __init__( self, *, - target: "_models.TargetConfig", - 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, + output_index: int, + item_id: str, + sequence_number: int, ) -> None: ... @overload @@ -12039,23 +16561,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: 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 ResponseUsageInputTokensDetails(_Model): - """ResponseUsageInputTokensDetails. +class ResponseWebSearchCallInProgressEvent(_Model): + """Emitted when a web search call is initiated. - :ivar cached_tokens: Required. - :vartype cached_tokens: int + :ivar type: The type of the event. Always ``response.web_search_call.in_progress``. Required. + Default value is "response.web_search_call.in_progress". + :vartype type: str + :ivar output_index: The index of the output item that the web search call is associated with. + Required. + :vartype output_index: int + :ivar item_id: Unique ID for the output item associated with the web search call. Required. + :vartype item_id: str + :ivar sequence_number: The sequence number of the web search call being processed. Required. + :vartype sequence_number: int """ - cached_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + type: Literal["response.web_search_call.in_progress"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.web_search_call.in_progress``. Required. Default value + is \"response.web_search_call.in_progress\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that the web search call is associated with. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Unique ID for the output item associated with the web search call. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of the web search call being processed. Required.""" @overload def __init__( self, *, - cached_tokens: int, + output_index: int, + item_id: str, + sequence_number: int, ) -> None: ... @overload @@ -12067,23 +16609,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: 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 ResponseUsageOutputTokensDetails(_Model): - """ResponseUsageOutputTokensDetails. +class ResponseWebSearchCallSearchingEvent(_Model): + """Emitted when a web search call is executing. - :ivar reasoning_tokens: Required. - :vartype reasoning_tokens: int + :ivar type: The type of the event. Always ``response.web_search_call.searching``. Required. + Default value is "response.web_search_call.searching". + :vartype type: str + :ivar output_index: The index of the output item that the web search call is associated with. + Required. + :vartype output_index: int + :ivar item_id: Unique ID for the output item associated with the web search call. Required. + :vartype item_id: str + :ivar sequence_number: The sequence number of the web search call being processed. Required. + :vartype sequence_number: int """ - reasoning_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + type: Literal["response.web_search_call.searching"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the event. Always ``response.web_search_call.searching``. Required. Default value + is \"response.web_search_call.searching\".""" + output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item that the web search call is associated with. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Unique ID for the output item associated with the web search call. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of the web search call being processed. Required.""" @overload def __init__( self, *, - reasoning_tokens: int, + output_index: int, + item_id: str, + sequence_number: int, ) -> None: ... @overload @@ -12095,6 +16657,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: 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 SASCredentials(BaseCredentials, discriminator="SAS"): @@ -12589,8 +17152,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StructuredOutputsItemResource(ItemResource, discriminator="structured_outputs"): - """StructuredOutputsItemResource. +class StructuredOutputsOutputItem(OutputItem, discriminator="structured_outputs"): + """StructuredOutputsOutputItem. :ivar agent_reference: The agent that created the item. :vartype agent_reference: ~azure.ai.projects.models.AgentReference @@ -12602,7 +17165,7 @@ class StructuredOutputsItemResource(ItemResource, discriminator="structured_outp :vartype output: any """ - type: Literal[ItemResourceType.STRUCTURED_OUTPUTS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + type: Literal[OutputItemType.STRUCTURED_OUTPUTS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Required. STRUCTURED_OUTPUTS.""" output: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The structured output captured during the response. Required.""" @@ -12625,7 +17188,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemResourceType.STRUCTURED_OUTPUTS # type: ignore + self.type = OutputItemType.STRUCTURED_OUTPUTS # type: ignore class Summary(_Model): @@ -13957,15 +18520,15 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.kind = AgentKind.WORKFLOW # type: ignore -class WorkflowPreviewActionOutputItemResource(ItemResource, discriminator="workflow_preview_action"): - """WorkflowPreviewActionOutputItemResource. +class WorkflowPreviewActionOutputItem(OutputItem, discriminator="workflow_action"): + """WorkflowPreviewActionOutputItem. :ivar agent_reference: The agent that created the item. :vartype agent_reference: ~azure.ai.projects.models.AgentReference :ivar response_id: The response on which the item is created. :vartype response_id: str - :ivar type: Required. WORKFLOW_PREVIEW_ACTION. - :vartype type: str or ~azure.ai.projects.models.WORKFLOW_PREVIEW_ACTION + :ivar type: Required. WORKFLOW_ACTION. + :vartype type: str or ~azure.ai.projects.models.WORKFLOW_ACTION :ivar kind: The kind of CSDL action (e.g., 'SetVariable', 'InvokeAzureAgent'). Required. :vartype kind: str :ivar action_id: Unique identifier for the action. Required. @@ -13980,8 +18543,8 @@ class WorkflowPreviewActionOutputItemResource(ItemResource, discriminator="workf :vartype status: str or str or str or str """ - type: Literal[ItemResourceType.WORKFLOW_PREVIEW_ACTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. WORKFLOW_PREVIEW_ACTION.""" + type: Literal[OutputItemType.WORKFLOW_ACTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. WORKFLOW_ACTION.""" kind: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The kind of CSDL action (e.g., 'SetVariable', 'InvokeAzureAgent'). Required.""" action_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -14019,4 +18582,4 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemResourceType.WORKFLOW_PREVIEW_ACTION # type: ignore + self.type = OutputItemType.WORKFLOW_ACTION # type: 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 b7d1de8628b8..eb8c7599ac38 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 @@ -37,7 +37,7 @@ from .._configuration import AIProjectClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer -from ..models._enums import FoundryPreviewOptInKeys +from ..models._enums import FoundryFeaturesOptInKeys JSON = MutableMapping[str, Any] _Unset: Any = object() @@ -75,11 +75,11 @@ def build_agents_get_request(agent_name: str, **kwargs: Any) -> HttpRequest: def build_agents_create_request( *, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, **kwargs: Any @@ -98,8 +98,8 @@ def build_agents_create_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if foundry_beta is not None: - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + if foundry_features is not None: + _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") @@ -107,7 +107,18 @@ def build_agents_create_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_update_request(agent_name: str, **kwargs: Any) -> HttpRequest: +def build_agents_update_request( + agent_name: str, + *, + foundry_features: Optional[ + Union[ + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], + ] + ] = None, + **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -127,6 +138,8 @@ def build_agents_update_request(agent_name: str, **kwargs: Any) -> HttpRequest: _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if foundry_features is not None: + _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") @@ -134,13 +147,7 @@ def build_agents_update_request(agent_name: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_create_from_manifest_request( # pylint: disable=name-too-long - *, - foundry_beta: Optional[ - Union[Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1]] - ] = None, - **kwargs: Any -) -> HttpRequest: +def build_agents_create_from_manifest_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 {}) @@ -155,8 +162,6 @@ def build_agents_create_from_manifest_request( # pylint: disable=name-too-long _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if foundry_beta is not None: - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -257,11 +262,11 @@ def build_agents_list_request( def build_agents_create_version_request( agent_name: str, *, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, **kwargs: Any @@ -285,8 +290,8 @@ def build_agents_create_version_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if foundry_beta is not None: - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + if foundry_features is not None: + _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") @@ -348,15 +353,7 @@ def build_agents_get_version_request(agent_name: str, agent_version: str, **kwar return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_agents_delete_version_request( - agent_name: str, - agent_version: str, - *, - foundry_beta: Optional[ - Union[Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1]] - ] = None, - **kwargs: Any -) -> HttpRequest: +def build_agents_delete_version_request(agent_name: str, agent_version: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -376,8 +373,6 @@ def build_agents_delete_version_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if foundry_beta is not None: - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) @@ -427,7 +422,7 @@ def build_agents_stream_agent_container_logs_request( # pylint: disable=name-to agent_name: str, agent_version: str, *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW]] = None, kind: Optional[Union[str, _models.ContainerLogKind]] = None, replica_name: Optional[str] = None, tail: Optional[int] = None, @@ -456,8 +451,8 @@ def build_agents_stream_agent_container_logs_request( # pylint: disable=name-to _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if foundry_beta is not None: - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + if foundry_features is not None: + _headers["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) @@ -836,7 +831,10 @@ def build_evaluation_taxonomies_delete_request( # pylint: disable=name-too-long def build_evaluation_taxonomies_create_request( # pylint: disable=name-too-long - name: str, *, foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, **kwargs: Any + name: str, + *, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -857,8 +855,8 @@ def build_evaluation_taxonomies_create_request( # pylint: disable=name-too-long _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if foundry_beta is not None: - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + if foundry_features is not None: + _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") @@ -867,7 +865,10 @@ def build_evaluation_taxonomies_create_request( # pylint: disable=name-too-long def build_evaluation_taxonomies_update_request( # pylint: disable=name-too-long - name: str, *, foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, **kwargs: Any + name: str, + *, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -888,8 +889,8 @@ def build_evaluation_taxonomies_update_request( # pylint: disable=name-too-long _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if foundry_beta is not None: - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + if foundry_features is not None: + _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") @@ -1005,7 +1006,7 @@ def build_evaluation_rules_list_request( def build_evaluators_list_versions_request( name: str, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, limit: Optional[int] = None, **kwargs: Any @@ -1032,7 +1033,7 @@ def build_evaluators_list_versions_request( _params["limit"] = _SERIALIZER.query("limit", limit, "int") # Construct headers - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _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) @@ -1040,7 +1041,7 @@ def build_evaluators_list_versions_request( def build_evaluators_list_latest_versions_request( # pylint: disable=name-too-long *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, limit: Optional[int] = None, **kwargs: Any @@ -1062,14 +1063,18 @@ def build_evaluators_list_latest_versions_request( # pylint: disable=name-too-l _params["limit"] = _SERIALIZER.query("limit", limit, "int") # Construct headers - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _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_evaluators_get_version_request( - name: str, version: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], **kwargs: Any + name: str, + version: str, + *, + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1090,14 +1095,18 @@ def build_evaluators_get_version_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _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_evaluators_delete_version_request( - name: str, version: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], **kwargs: Any + name: str, + version: str, + *, + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1116,13 +1125,13 @@ def build_evaluators_delete_version_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _headers["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_evaluators_create_version_request( - name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], **kwargs: Any + name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1143,7 +1152,7 @@ def build_evaluators_create_version_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _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") @@ -1152,7 +1161,11 @@ def build_evaluators_create_version_request( def build_evaluators_update_version_request( - name: str, version: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], **kwargs: Any + name: str, + version: str, + *, + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1174,7 +1187,7 @@ def build_evaluators_update_version_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _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") @@ -1298,7 +1311,7 @@ def build_indexes_create_or_update_request(name: str, version: str, **kwargs: An def build_insights_generate_request( - *, foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], **kwargs: Any + *, foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1314,7 +1327,7 @@ def build_insights_generate_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _headers["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") if "Repeatability-Request-ID" not in _headers: _headers["Repeatability-Request-ID"] = str(uuid.uuid4()) if "Repeatability-First-Sent" not in _headers: @@ -1392,7 +1405,7 @@ def build_insights_list_request( def build_memory_stores_create_request( - *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **kwargs: Any + *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1408,7 +1421,7 @@ def build_memory_stores_create_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _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") @@ -1417,7 +1430,7 @@ def build_memory_stores_create_request( def build_memory_stores_update_request( - name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **kwargs: Any + name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1438,7 +1451,7 @@ def build_memory_stores_update_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _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") @@ -1447,7 +1460,7 @@ def build_memory_stores_update_request( def build_memory_stores_get_request( - name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **kwargs: Any + name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1467,7 +1480,7 @@ def build_memory_stores_get_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _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) @@ -1475,7 +1488,7 @@ def build_memory_stores_get_request( def build_memory_stores_list_request( *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, after: Optional[str] = None, @@ -1503,14 +1516,14 @@ def build_memory_stores_list_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _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_memory_stores_delete_request( - name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **kwargs: Any + name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1530,14 +1543,14 @@ def build_memory_stores_delete_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _headers["Foundry-Features"] = _SERIALIZER.header("foundry_features", foundry_features, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_memory_stores_search_memories_request( # pylint: disable=name-too-long - name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **kwargs: Any + name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1558,7 +1571,7 @@ def build_memory_stores_search_memories_request( # pylint: disable=name-too-lon _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _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") @@ -1567,7 +1580,7 @@ def build_memory_stores_search_memories_request( # pylint: disable=name-too-lon def build_memory_stores_update_memories_request( # pylint: disable=name-too-long - name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **kwargs: Any + name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1588,7 +1601,7 @@ def build_memory_stores_update_memories_request( # pylint: disable=name-too-lon _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _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") @@ -1597,7 +1610,7 @@ def build_memory_stores_update_memories_request( # pylint: disable=name-too-lon def build_memory_stores_delete_scope_request( - name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **kwargs: Any + name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1618,7 +1631,7 @@ def build_memory_stores_delete_scope_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _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") @@ -1670,7 +1683,7 @@ def build_red_teams_list_request(**kwargs: Any) -> HttpRequest: def build_red_teams_create_request( - *, foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, **kwargs: Any + *, foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1686,8 +1699,8 @@ def build_red_teams_create_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if foundry_beta is not None: - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + if foundry_features is not None: + _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") @@ -1787,7 +1800,11 @@ def build_schedules_create_or_update_request(id: str, **kwargs: Any) -> HttpRequ def build_schedules_get_run_request( - schedule_id: str, run_id: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], **kwargs: Any + schedule_id: str, + run_id: str, + *, + foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1808,7 +1825,7 @@ def build_schedules_get_run_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Foundry-Beta"] = _SERIALIZER.header("foundry_beta", foundry_beta, "str") + _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) @@ -1925,11 +1942,11 @@ def create( *, name: str, definition: _models.AgentDefinition, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, content_type: str = "application/json", @@ -1949,14 +1966,14 @@ def create( :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 foundry_beta: A feature flag opt-in required when using preview operations or + :keyword foundry_features: A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -1979,11 +1996,11 @@ def create( self, body: JSON, *, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, content_type: str = "application/json", @@ -1993,14 +2010,14 @@ def create( :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or + :keyword foundry_features: A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -2014,11 +2031,11 @@ def create( self, body: IO[bytes], *, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, content_type: str = "application/json", @@ -2028,14 +2045,14 @@ def create( :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or + :keyword foundry_features: A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -2051,11 +2068,11 @@ def create( *, name: str = _Unset, definition: _models.AgentDefinition = _Unset, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, metadata: Optional[dict[str, str]] = None, @@ -2076,14 +2093,14 @@ def create( :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 foundry_beta: A feature flag opt-in required when using preview operations or + :keyword foundry_features: A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :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. @@ -2126,7 +2143,7 @@ def create( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_agents_create_request( - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -2174,6 +2191,13 @@ def update( agent_name: str, *, definition: _models.AgentDefinition, + foundry_features: Optional[ + Union[ + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], + ] + ] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, @@ -2187,6 +2211,14 @@ def update( :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 foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -2206,7 +2238,19 @@ def update( @overload def update( - self, agent_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: JSON, + *, + foundry_features: Optional[ + Union[ + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], + ] + ] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: """Updates the agent by adding a new version if there are any changes to the agent definition. If no changes, returns the existing agent version. @@ -2215,6 +2259,14 @@ def update( :type agent_name: str :param body: Required. :type body: JSON + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -2225,7 +2277,19 @@ def update( @overload def update( - self, agent_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + agent_name: str, + body: IO[bytes], + *, + foundry_features: Optional[ + Union[ + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], + ] + ] = None, + content_type: str = "application/json", + **kwargs: Any ) -> _models.AgentDetails: """Updates the agent by adding a new version if there are any changes to the agent definition. If no changes, returns the existing agent version. @@ -2234,6 +2298,14 @@ def update( :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. Is one of the following types: + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -2249,6 +2321,13 @@ def update( body: Union[JSON, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, + foundry_features: Optional[ + Union[ + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], + ] + ] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any @@ -2263,6 +2342,14 @@ def update( :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 foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. Is one of the following types: + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :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. @@ -2304,6 +2391,7 @@ def update( _request = build_agents_update_request( agent_name=agent_name, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -2352,11 +2440,6 @@ def create_from_manifest( name: str, manifest_id: str, parameter_values: dict[str, Any], - foundry_beta: Optional[ - Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] - ] - ] = None, content_type: str = "application/json", metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, @@ -2376,12 +2459,6 @@ def create_from_manifest( :keyword parameter_values: The inputs to the manifest that will result in a fully materialized Agent. Required. :paramtype parameter_values: dict[str, any] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is either a - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2401,27 +2478,12 @@ def create_from_manifest( @overload def create_from_manifest( - self, - body: JSON, - *, - foundry_beta: Optional[ - Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] - ] - ] = None, - content_type: str = "application/json", - **kwargs: Any + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentDetails: """Creates an agent from a manifest. :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is either a - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2432,27 +2494,12 @@ def create_from_manifest( @overload def create_from_manifest( - self, - body: IO[bytes], - *, - foundry_beta: Optional[ - Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] - ] - ] = None, - content_type: str = "application/json", - **kwargs: Any + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.AgentDetails: """Creates an agent from a manifest. :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is either a - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -2469,11 +2516,6 @@ def create_from_manifest( name: str = _Unset, manifest_id: str = _Unset, parameter_values: dict[str, Any] = _Unset, - foundry_beta: Optional[ - Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] - ] - ] = None, metadata: Optional[dict[str, str]] = None, description: Optional[str] = None, **kwargs: Any @@ -2494,12 +2536,6 @@ def create_from_manifest( :keyword parameter_values: The inputs to the manifest that will result in a fully materialized Agent. Required. :paramtype parameter_values: dict[str, any] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is either a - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 :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. @@ -2550,7 +2586,6 @@ def create_from_manifest( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_agents_create_from_manifest_request( - foundry_beta=foundry_beta, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -2944,11 +2979,11 @@ def create_version( agent_name: str, *, definition: _models.AgentDefinition, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, content_type: str = "application/json", @@ -2968,14 +3003,14 @@ def create_version( :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 foundry_beta: A feature flag opt-in required when using preview operations or + :keyword foundry_features: A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -2999,11 +3034,11 @@ def create_version( agent_name: str, body: JSON, *, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, content_type: str = "application/json", @@ -3020,14 +3055,14 @@ def create_version( :type agent_name: str :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or + :keyword foundry_features: A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -3042,11 +3077,11 @@ def create_version( agent_name: str, body: IO[bytes], *, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, content_type: str = "application/json", @@ -3063,14 +3098,14 @@ def create_version( :type agent_name: str :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or + :keyword foundry_features: A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_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 @@ -3086,11 +3121,11 @@ def create_version( body: Union[JSON, IO[bytes]] = _Unset, *, definition: _models.AgentDefinition = _Unset, - foundry_beta: Optional[ + foundry_features: Optional[ Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1], + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], ] ] = None, metadata: Optional[dict[str, str]] = None, @@ -3111,14 +3146,14 @@ def create_version( :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 foundry_beta: A feature flag opt-in required when using preview operations or + :keyword foundry_features: A feature flag opt-in required when using preview operations or modifying persisted preview resources. Is one of the following types: - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1], - Literal[FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1] Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 or str or - ~azure.ai.projects.models.WORKFLOW_AGENTS_V1 + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], + Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or + str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :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. @@ -3160,7 +3195,7 @@ def create_version( _request = build_agents_create_version_request( agent_name=agent_name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -3476,30 +3511,13 @@ 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, - *, - foundry_beta: Optional[ - Union[ - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1], Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] - ] - ] = None, - **kwargs: Any - ) -> _models.DeleteAgentVersionResponse: + def delete_version(self, agent_name: str, agent_version: str, **kwargs: Any) -> _models.DeleteAgentVersionResponse: """Deletes a specific version of an agent. :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 foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is either a - Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1] type or a - Literal[FoundryPreviewOptInKeys.HOSTED_AGENTS_V1] type. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 or str or - ~azure.ai.projects.models.HOSTED_AGENTS_V1 :return: DeleteAgentVersionResponse. The DeleteAgentVersionResponse is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DeleteAgentVersionResponse @@ -3521,7 +3539,6 @@ def delete_version( _request = build_agents_delete_version_request( agent_name=agent_name, agent_version=agent_version, - foundry_beta=foundry_beta, api_version=self._config.api_version, headers=_headers, params=_params, @@ -3658,7 +3675,7 @@ def stream_agent_container_logs( # pylint: disable=inconsistent-return-statemen agent_name: str, agent_version: str, *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.CONTAINER_AGENTS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW]] = None, kind: Optional[Union[str, _models.ContainerLogKind]] = None, replica_name: Optional[str] = None, tail: Optional[int] = None, @@ -3694,9 +3711,9 @@ def stream_agent_container_logs( # pylint: disable=inconsistent-return-statemen :type agent_name: str :param agent_version: The version of the agent. Required. :type agent_version: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. CONTAINER_AGENTS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. CONTAINER_AGENTS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW :keyword kind: console returns container stdout/stderr, system returns container app event stream. defaults to console. Known values are: "console" and "system". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.ContainerLogKind @@ -3726,7 +3743,7 @@ def stream_agent_container_logs( # pylint: disable=inconsistent-return-statemen _request = build_agents_stream_agent_container_logs_request( agent_name=agent_name, agent_version=agent_version, - foundry_beta=foundry_beta, + foundry_features=foundry_features, kind=kind, replica_name=replica_name, tail=tail, @@ -5098,7 +5115,7 @@ def create( name: str, body: _models.EvaluationTaxonomy, *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -5108,9 +5125,9 @@ def create( :type name: str :param body: The evaluation taxonomy. Required. :type body: ~azure.ai.projects.models.EvaluationTaxonomy - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5125,7 +5142,7 @@ def create( name: str, body: JSON, *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -5135,9 +5152,9 @@ def create( :type name: str :param body: The evaluation taxonomy. Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5152,7 +5169,7 @@ def create( name: str, body: IO[bytes], *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -5162,9 +5179,9 @@ def create( :type name: str :param body: The evaluation taxonomy. Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -5179,7 +5196,7 @@ def create( name: str, body: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -5189,9 +5206,9 @@ def create( :param body: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, JSON, IO[bytes] Required. :type body: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -5219,7 +5236,7 @@ def create( _request = build_evaluation_taxonomies_create_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -5263,7 +5280,7 @@ def update( name: str, body: _models.EvaluationTaxonomy, *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -5273,9 +5290,9 @@ def update( :type name: str :param body: The evaluation taxonomy. Required. :type body: ~azure.ai.projects.models.EvaluationTaxonomy - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5290,7 +5307,7 @@ def update( name: str, body: JSON, *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -5300,9 +5317,9 @@ def update( :type name: str :param body: The evaluation taxonomy. Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5317,7 +5334,7 @@ def update( name: str, body: IO[bytes], *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -5327,9 +5344,9 @@ def update( :type name: str :param body: The evaluation taxonomy. Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -5344,7 +5361,7 @@ def update( name: str, body: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -5354,9 +5371,9 @@ def update( :param body: The evaluation taxonomy. Is one of the following types: EvaluationTaxonomy, JSON, IO[bytes] Required. :type body: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -5384,7 +5401,7 @@ def update( _request = build_evaluation_taxonomies_update_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -5809,7 +5826,7 @@ def list_versions( self, name: str, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, limit: Optional[int] = None, **kwargs: Any @@ -5818,9 +5835,9 @@ def list_versions( :param name: The name of the resource. Required. :type name: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default value is None. @@ -5850,7 +5867,7 @@ def prepare_request(next_link=None): _request = build_evaluators_list_versions_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, type=type, limit=limit, api_version=self._config.api_version, @@ -5914,16 +5931,16 @@ def get_next(next_link=None): def list_latest_versions( self, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, limit: Optional[int] = None, **kwargs: Any ) -> ItemPaged["_models.EvaluatorVersion"]: """List the latest version of each evaluator. - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default value is None. @@ -5952,7 +5969,7 @@ def prepare_request(next_link=None): if not next_link: _request = build_evaluators_list_latest_versions_request( - foundry_beta=foundry_beta, + foundry_features=foundry_features, type=type, limit=limit, api_version=self._config.api_version, @@ -6014,7 +6031,12 @@ def get_next(next_link=None): @distributed_trace def get_version( - self, name: str, version: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], **kwargs: Any + self, + name: str, + version: str, + *, + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + **kwargs: Any ) -> _models.EvaluatorVersion: """Get the specific version of the EvaluatorVersion. The service returns 404 Not Found error if the EvaluatorVersion does not exist. @@ -6023,9 +6045,9 @@ def get_version( :type name: str :param version: The specific version id of the EvaluatorVersion to retrieve. Required. :type version: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -6046,7 +6068,7 @@ def get_version( _request = build_evaluators_get_version_request( name=name, version=version, - foundry_beta=foundry_beta, + foundry_features=foundry_features, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6084,7 +6106,12 @@ def get_version( @distributed_trace def delete_version( # pylint: disable=inconsistent-return-statements - self, name: str, version: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], **kwargs: Any + self, + name: str, + version: str, + *, + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + **kwargs: Any ) -> None: """Delete the specific version of the EvaluatorVersion. The service returns 204 No Content if the EvaluatorVersion was deleted successfully or if the EvaluatorVersion does not exist. @@ -6093,9 +6120,9 @@ def delete_version( # pylint: disable=inconsistent-return-statements :type name: str :param version: The version of the EvaluatorVersion to delete. Required. :type version: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -6116,7 +6143,7 @@ def delete_version( # pylint: disable=inconsistent-return-statements _request = build_evaluators_delete_version_request( name=name, version=version, - foundry_beta=foundry_beta, + foundry_features=foundry_features, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6146,7 +6173,7 @@ def create_version( name: str, evaluator_version: _models.EvaluatorVersion, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -6156,9 +6183,9 @@ def create_version( :type name: str :param evaluator_version: Required. :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6173,7 +6200,7 @@ def create_version( name: str, evaluator_version: JSON, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -6183,9 +6210,9 @@ def create_version( :type name: str :param evaluator_version: Required. :type evaluator_version: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6200,7 +6227,7 @@ def create_version( name: str, evaluator_version: IO[bytes], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -6210,9 +6237,9 @@ def create_version( :type name: str :param evaluator_version: Required. :type evaluator_version: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -6227,7 +6254,7 @@ def create_version( name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], **kwargs: Any ) -> _models.EvaluatorVersion: """Create a new EvaluatorVersion with auto incremented version id. @@ -6237,9 +6264,9 @@ def create_version( :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] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -6267,7 +6294,7 @@ def create_version( _request = build_evaluators_create_version_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -6312,7 +6339,7 @@ def update_version( version: str, evaluator_version: _models.EvaluatorVersion, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -6324,9 +6351,9 @@ def update_version( :type version: str :param evaluator_version: Evaluator resource. Required. :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6342,7 +6369,7 @@ def update_version( version: str, evaluator_version: JSON, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -6354,9 +6381,9 @@ def update_version( :type version: str :param evaluator_version: Evaluator resource. Required. :type evaluator_version: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6372,7 +6399,7 @@ def update_version( version: str, evaluator_version: IO[bytes], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -6384,9 +6411,9 @@ def update_version( :type version: str :param evaluator_version: Evaluator resource. Required. :type evaluator_version: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -6402,7 +6429,7 @@ def update_version( version: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.EVALUATIONS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], **kwargs: Any ) -> _models.EvaluatorVersion: """Update an existing EvaluatorVersion with the given version id. @@ -6414,9 +6441,9 @@ def update_version( :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] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.EVALUATIONS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -6445,7 +6472,7 @@ def update_version( _request = build_evaluators_update_version_request( name=name, version=version, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -6957,7 +6984,7 @@ def generate( self, insight: _models.Insight, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: @@ -6966,9 +6993,9 @@ def generate( :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. :type insight: ~azure.ai.projects.models.Insight - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6982,7 +7009,7 @@ def generate( self, insight: JSON, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: @@ -6991,9 +7018,9 @@ def generate( :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. :type insight: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7007,7 +7034,7 @@ def generate( self, insight: IO[bytes], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: @@ -7016,9 +7043,9 @@ def generate( :param insight: Complete evaluation configuration including data source, evaluators, and result settings. Required. :type insight: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -7032,7 +7059,7 @@ def generate( self, insight: Union[_models.Insight, JSON, IO[bytes]], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], **kwargs: Any ) -> _models.Insight: """Generate Insights. @@ -7040,9 +7067,9 @@ def generate( :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] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :return: Insight. The Insight is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: @@ -7069,7 +7096,7 @@ def generate( _content = json.dumps(insight, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_insights_generate_request( - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -7306,7 +7333,7 @@ def __init__(self, *args, **kwargs) -> None: def create( self, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], name: str, definition: _models.MemoryStoreDefinition, content_type: str = "application/json", @@ -7316,9 +7343,9 @@ def create( ) -> _models.MemoryStoreDetails: """Create a memory store. - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -7341,7 +7368,7 @@ def create( self, body: JSON, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: @@ -7349,9 +7376,9 @@ def create( :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7365,7 +7392,7 @@ def create( self, body: IO[bytes], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: @@ -7373,9 +7400,9 @@ def create( :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -7389,7 +7416,7 @@ def create( self, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], name: str = _Unset, definition: _models.MemoryStoreDefinition = _Unset, description: Optional[str] = None, @@ -7400,9 +7427,9 @@ def create( :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -7445,7 +7472,7 @@ def create( _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_memory_stores_create_request( - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -7492,7 +7519,7 @@ def update( self, name: str, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, @@ -7502,9 +7529,9 @@ def update( :param name: The name of the memory store to update. Required. :type name: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7524,7 +7551,7 @@ def update( name: str, body: JSON, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: @@ -7534,9 +7561,9 @@ def update( :type name: str :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7551,7 +7578,7 @@ def update( name: str, body: IO[bytes], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: @@ -7561,9 +7588,9 @@ def update( :type name: str :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -7578,7 +7605,7 @@ def update( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, **kwargs: Any @@ -7589,9 +7616,9 @@ def update( :type name: str :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :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 @@ -7627,7 +7654,7 @@ def update( _request = build_memory_stores_update_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -7671,15 +7698,15 @@ def update( @distributed_trace def get( - self, name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **kwargs: Any + self, name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any ) -> _models.MemoryStoreDetails: """Retrieve a memory store. :param name: The name of the memory store to retrieve. Required. :type name: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: @@ -7699,7 +7726,7 @@ def get( _request = build_memory_stores_get_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7743,7 +7770,7 @@ def get( def list( self, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, @@ -7751,9 +7778,9 @@ def list( ) -> ItemPaged["_models.MemoryStoreDetails"]: """List all memory stores. - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_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. @@ -7788,7 +7815,7 @@ def list( def prepare_request(_continuation_token=None): _request = build_memory_stores_list_request( - foundry_beta=foundry_beta, + foundry_features=foundry_features, limit=limit, order=order, after=_continuation_token, @@ -7833,15 +7860,15 @@ def get_next(_continuation_token=None): @distributed_trace def delete( - self, name: str, *, foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], **kwargs: Any + self, name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any ) -> _models.DeleteMemoryStoreResult: """Delete a memory store. :param name: The name of the memory store to delete. Required. :type name: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :return: DeleteMemoryStoreResult. The DeleteMemoryStoreResult is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DeleteMemoryStoreResult :raises ~azure.core.exceptions.HttpResponseError: @@ -7861,7 +7888,7 @@ def delete( _request = build_memory_stores_delete_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7906,7 +7933,7 @@ def search_memories( self, name: str, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str, content_type: str = "application/json", items: Optional[List[_models.InputItem]] = None, @@ -7918,9 +7945,9 @@ def search_memories( :param name: The name of the memory store to search. Required. :type name: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -7945,7 +7972,7 @@ def search_memories( name: str, body: JSON, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: @@ -7955,9 +7982,9 @@ def search_memories( :type name: str :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7972,7 +7999,7 @@ def search_memories( name: str, body: IO[bytes], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: @@ -7982,9 +8009,9 @@ def search_memories( :type name: str :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -7999,7 +8026,7 @@ def search_memories( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str = _Unset, items: Optional[List[_models.InputItem]] = None, previous_search_id: Optional[str] = None, @@ -8012,9 +8039,9 @@ def search_memories( :type name: str :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -8062,7 +8089,7 @@ def search_memories( _request = build_memory_stores_search_memories_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -8109,7 +8136,7 @@ def _update_memories_initial( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str = _Unset, items: Optional[List[_models.InputItem]] = None, previous_update_id: Optional[str] = None, @@ -8149,7 +8176,7 @@ def _update_memories_initial( _request = build_memory_stores_update_memories_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -8195,7 +8222,7 @@ def _begin_update_memories( self, name: str, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str, content_type: str = "application/json", items: Optional[List[_models.InputItem]] = None, @@ -8209,7 +8236,7 @@ def _begin_update_memories( name: str, body: JSON, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @@ -8219,7 +8246,7 @@ def _begin_update_memories( name: str, body: IO[bytes], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @@ -8230,7 +8257,7 @@ def _begin_update_memories( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str = _Unset, items: Optional[List[_models.InputItem]] = None, previous_update_id: Optional[str] = None, @@ -8243,9 +8270,9 @@ def _begin_update_memories( :type name: str :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -8278,7 +8305,7 @@ def _begin_update_memories( raw_result = self._update_memories_initial( name=name, body=body, - foundry_beta=foundry_beta, + foundry_features=foundry_features, scope=scope, items=items, previous_update_id=previous_update_id, @@ -8332,7 +8359,7 @@ def delete_scope( self, name: str, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str, content_type: str = "application/json", **kwargs: Any @@ -8341,9 +8368,9 @@ def delete_scope( :param name: The name of the memory store. Required. :type name: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -8362,7 +8389,7 @@ def delete_scope( name: str, body: JSON, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: @@ -8372,9 +8399,9 @@ def delete_scope( :type name: str :param body: Required. :type body: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8390,7 +8417,7 @@ def delete_scope( name: str, body: IO[bytes], *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: @@ -8400,9 +8427,9 @@ def delete_scope( :type name: str :param body: Required. :type body: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -8418,7 +8445,7 @@ def delete_scope( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.MEMORY_STORES_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str = _Unset, **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: @@ -8428,9 +8455,9 @@ def delete_scope( :type name: str :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.MEMORY_STORES_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -8467,7 +8494,7 @@ def delete_scope( _request = build_memory_stores_delete_scope_request( name=name, - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -8679,7 +8706,7 @@ def create( self, red_team: _models.RedTeam, *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: @@ -8687,9 +8714,9 @@ def create( :param red_team: Redteam to be run. Required. :type red_team: ~azure.ai.projects.models.RedTeam - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. RED_TEAMS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.RED_TEAMS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. RED_TEAMS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8703,7 +8730,7 @@ def create( self, red_team: JSON, *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: @@ -8711,9 +8738,9 @@ def create( :param red_team: Redteam to be run. Required. :type red_team: JSON - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. RED_TEAMS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.RED_TEAMS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. RED_TEAMS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8727,7 +8754,7 @@ def create( self, red_team: IO[bytes], *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: @@ -8735,9 +8762,9 @@ def create( :param red_team: Redteam to be run. Required. :type red_team: IO[bytes] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. RED_TEAMS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.RED_TEAMS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. RED_TEAMS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -8751,7 +8778,7 @@ def create( self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], *, - foundry_beta: Optional[Literal[FoundryPreviewOptInKeys.RED_TEAMS_V1]] = None, + foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, **kwargs: Any ) -> _models.RedTeam: """Creates a redteam run. @@ -8759,9 +8786,9 @@ def create( :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] - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. RED_TEAMS_V1. Default value is None. - :paramtype foundry_beta: str or ~azure.ai.projects.models.RED_TEAMS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. RED_TEAMS_V1_PREVIEW. Default value is None. + :paramtype foundry_features: str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW :return: RedTeam. The RedTeam is compatible with MutableMapping :rtype: ~azure.ai.projects.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: @@ -8788,7 +8815,7 @@ def create( _content = json.dumps(red_team, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_red_teams_create_request( - foundry_beta=foundry_beta, + foundry_features=foundry_features, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -9188,7 +9215,7 @@ def get_run( schedule_id: str, run_id: str, *, - foundry_beta: Literal[FoundryPreviewOptInKeys.INSIGHTS_V1], + foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], **kwargs: Any ) -> _models.ScheduleRun: """Get a schedule run by id. @@ -9197,9 +9224,9 @@ def get_run( :type schedule_id: str :param run_id: The unique identifier of the schedule run. Required. :type run_id: str - :keyword foundry_beta: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1. Required. - :paramtype foundry_beta: str or ~azure.ai.projects.models.INSIGHTS_V1 + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :return: ScheduleRun. The ScheduleRun is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ScheduleRun :raises ~azure.core.exceptions.HttpResponseError: @@ -9220,7 +9247,7 @@ def get_run( _request = build_schedules_get_run_request( schedule_id=schedule_id, run_id=run_id, - foundry_beta=foundry_beta, + foundry_features=foundry_features, api_version=self._config.api_version, headers=_headers, params=_params, From f2f7f737525fbb49efee773de00d611fe4ad3378 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 4 Feb 2026 05:43:41 -0800 Subject: [PATCH 12/22] Fix mypy (renames) --- sdk/ai/azure-ai-projects/CHANGELOG.md | 2 +- .../agents/sample_workflow_multi_agent.py | 4 ++-- .../tools/sample_agent_memory_search.py | 8 ++++---- .../tools/sample_agent_memory_search_async.py | 8 ++++---- .../evaluations/sample_eval_catalog.py | 20 +++++++++---------- ...mple_eval_catalog_code_based_evaluators.py | 6 +++--- ...le_eval_catalog_prompt_based_evaluators.py | 6 +++--- .../sample_evaluation_cluster_insight.py | 6 +++--- .../sample_evaluation_compare_insight.py | 6 +++--- .../memories/sample_memory_advanced.py | 18 ++++++++--------- .../memories/sample_memory_advanced_async.py | 18 ++++++++--------- .../samples/memories/sample_memory_basic.py | 14 ++++++------- .../memories/sample_memory_basic_async.py | 14 ++++++------- .../samples/memories/sample_memory_crud.py | 14 ++++++------- .../memories/sample_memory_crud_async.py | 14 ++++++------- .../agents/tools/test_agent_memory_search.py | 8 ++++---- .../tools/test_agent_memory_search_async.py | 8 ++++---- 17 files changed, 87 insertions(+), 87 deletions(-) diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index aca4689f53e5..66ec2bcd2f4e 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -23,7 +23,7 @@ * Other class renames: * Rename class `ItemParam` to `InputItem`. * Rename class `PromptAgentDefinitionText` to `PromptAgentDefinitionTextOptions` - * Rnname class `EvaluationComparisonRequest` to `InsightRequest` + * Rename class `EvaluationComparisonRequest` to `InsightRequest` * Tracing: workflow actions in conversation item listings are now emitted as "gen_ai.conversation.item" events (with role="workflow") instead of "gen_ai.workflow.action" events in the list_conversation_items span. * Tracing: response generation span names changed from "responses {model_name}" to "chat {model_name}" for model calls and from "responses {agent_name}" to "invoke_agent {agent_name}" for agent calls. 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 abb5270b0bad..c4f0eac1f68a 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 @@ -29,7 +29,7 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - FoundryPreviewOptInKeys, + FoundryFeaturesOptInKeys, ItemResourceType, PromptAgentDefinition, WorkflowAgentDefinition, @@ -139,7 +139,7 @@ workflow = project_client.agents.create_version( agent_name="student-teacher-workflow", definition=WorkflowAgentDefinition(workflow=workflow_yaml), - foundry_beta=FoundryPreviewOptInKeys.WORKFLOW_AGENTS_V1, + foundry_features=FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW, ) print(f"Agent created (id: {workflow.id}, name: {workflow.name}, version: {workflow.version})") diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search.py index 1082694dacb0..214a7298578a 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search.py @@ -41,7 +41,7 @@ from azure.core.exceptions import ResourceNotFoundError from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - FoundryPreviewOptInKeys, + FoundryFeaturesOptInKeys, MemoryStoreDefaultDefinition, MemorySearchPreviewTool, PromptAgentDefinition, @@ -61,7 +61,7 @@ # Delete memory store, if it already exists memory_store_name = "my_memory_store" try: - project_client.memory_stores.delete(memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1) + project_client.memory_stores.delete(memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -78,7 +78,7 @@ name=memory_store_name, description="Example memory store for conversations", definition=definition, - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Created memory store: {memory_store.name} ({memory_store.id}): {memory_store.description}") @@ -142,5 +142,5 @@ project_client.agents.delete_version(agent_name=agent.name, agent_version=agent.version) print("Agent deleted") - project_client.memory_stores.delete(memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1) + project_client.memory_stores.delete(memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW) print("Memory store deleted") diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search_async.py index 1bd4e59bbc8b..f41ef0e449af 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search_async.py @@ -41,7 +41,7 @@ from azure.core.exceptions import ResourceNotFoundError from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( - FoundryPreviewOptInKeys, + FoundryFeaturesOptInKeys, MemoryStoreDefaultDefinition, MemorySearchPreviewTool, PromptAgentDefinition, @@ -65,7 +65,7 @@ async def main() -> None: memory_store_name = "my_memory_store" try: await project_client.memory_stores.delete( - memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: @@ -83,7 +83,7 @@ async def main() -> None: name=memory_store_name, description="Example memory store for conversations", definition=definition, - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Created memory store: {memory_store.name} ({memory_store.id}): {memory_store.description}") @@ -146,7 +146,7 @@ async def main() -> None: print("Agent deleted") await project_client.memory_stores.delete( - memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print("Memory store deleted") diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog.py index 1887241bcd6a..e48ece22081f 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog.py @@ -26,7 +26,7 @@ from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( - FoundryPreviewOptInKeys, + FoundryFeaturesOptInKeys, EvaluatorVersion, EvaluatorCategory, PromptBasedEvaluatorDefinition, @@ -100,7 +100,7 @@ prompt_evaluator = project_client.evaluators.create_version( name="my_custom_evaluator_code_prompt_based", evaluator_version=evaluator_version, - foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, + foundry_features=FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW, ) pprint(prompt_evaluator) @@ -138,13 +138,13 @@ code_evaluator = project_client.evaluators.create_version( name="my_custom_evaluator_code_based", evaluator_version=evaluator_version, - foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, + foundry_features=FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW, ) pprint(code_evaluator) print("Get code based evaluator version") code_evaluator_latest = project_client.evaluators.get_version( - name=code_evaluator.name, version=code_evaluator.version, foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1 + name=code_evaluator.name, version=code_evaluator.version, foundry_features=FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW ) pprint(code_evaluator_latest) @@ -152,7 +152,7 @@ prompt_evaluator_latest = project_client.evaluators.get_version( name=prompt_evaluator.name, version=prompt_evaluator.version, - foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, + foundry_features=FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW, ) pprint(prompt_evaluator_latest) @@ -165,7 +165,7 @@ "display_name": "my_custom_evaluator_updated", "description": "Custom evaluator description changed", }, - foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, + foundry_features=FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW, ) pprint(updated_evaluator) @@ -173,18 +173,18 @@ project_client.evaluators.delete_version( name=code_evaluator_latest.name, version=code_evaluator_latest.version, - foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, + foundry_features=FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW, ) project_client.evaluators.delete_version( name=prompt_evaluator_latest.name, version=prompt_evaluator_latest.version, - foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, + foundry_features=FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW, ) print("Getting list of builtin evaluator versions") evaluators = project_client.evaluators.list_latest_versions( - type="builtin", foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1 + type="builtin", foundry_features=FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW ) print("List of builtin evaluator versions") for evaluator in evaluators: @@ -192,7 +192,7 @@ print("Getting list of custom evaluator versions") evaluators = project_client.evaluators.list_latest_versions( - type="custom", foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1 + type="custom", foundry_features=FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW ) print("List of custom evaluator versions") for evaluator in evaluators: diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_code_based_evaluators.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_code_based_evaluators.py index f0a30560005e..0a312628be61 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_code_based_evaluators.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_code_based_evaluators.py @@ -26,7 +26,7 @@ import os from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import EvaluatorCategory, EvaluatorDefinitionType, FoundryPreviewOptInKeys +from azure.ai.projects.models import EvaluatorCategory, EvaluatorDefinitionType, FoundryFeaturesOptInKeys from openai.types.evals.create_eval_jsonl_run_data_source_param import ( CreateEvalJSONLRunDataSourceParam, @@ -97,7 +97,7 @@ }, }, }, - foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, + foundry_features=FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW, ) data_source_config = DataSourceConfigCustom( @@ -203,7 +203,7 @@ project_client.evaluators.delete_version( name=code_evaluator.name, version=code_evaluator.version, - foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, + foundry_features=FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW, ) client.evals.delete(eval_id=eval_object.id) diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_prompt_based_evaluators.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_prompt_based_evaluators.py index a74f6a4d0e6c..1b9b65bbbbc3 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_prompt_based_evaluators.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog_prompt_based_evaluators.py @@ -59,7 +59,7 @@ import os from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import EvaluatorCategory, EvaluatorDefinitionType, FoundryPreviewOptInKeys +from azure.ai.projects.models import EvaluatorCategory, EvaluatorDefinitionType, FoundryFeaturesOptInKeys from openai.types.evals.create_eval_jsonl_run_data_source_param import ( CreateEvalJSONLRunDataSourceParam, @@ -154,7 +154,7 @@ }, }, }, - foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, + foundry_features=FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW, ) pprint(prompt_evaluator) @@ -269,7 +269,7 @@ project_client.evaluators.delete_version( name=prompt_evaluator.name, version=prompt_evaluator.version, - foundry_beta=FoundryPreviewOptInKeys.EVALUATIONS_V1, + foundry_features=FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW, ) client.evals.delete(eval_id=eval_object.id) diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_cluster_insight.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_cluster_insight.py index 2abcc2c7f02d..85f5420cc98a 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_cluster_insight.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_cluster_insight.py @@ -33,7 +33,7 @@ from pprint import pprint from dotenv import load_dotenv from azure.ai.projects.models import ( - FoundryPreviewOptInKeys, + FoundryFeaturesOptInKeys, OperationState, EvaluationRunClusterInsightRequest, Insight, @@ -132,14 +132,14 @@ model_configuration=InsightModelConfiguration(model_deployment_name=model_deployment_name), ), ), - foundry_beta=FoundryPreviewOptInKeys.INSIGHTS_V1, + foundry_features=FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW, ) print(f"Started insight generation (id: {clusterInsight.id})") while clusterInsight.state not in [OperationState.SUCCEEDED, OperationState.FAILED]: print(f"Waiting for insight to be generated...") clusterInsight = project_client.insights.get( - id=clusterInsight.id, foundry_beta=FoundryPreviewOptInKeys.INSIGHTS_V1 + id=clusterInsight.id, foundry_features=FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW ) print(f"Insight status: {clusterInsight.state}") time.sleep(5) diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_compare_insight.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_compare_insight.py index 9f0dd5ca6430..fb8f131e4219 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_compare_insight.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_evaluation_compare_insight.py @@ -32,7 +32,7 @@ from pprint import pprint from dotenv import load_dotenv from azure.ai.projects.models import ( - FoundryPreviewOptInKeys, + FoundryFeaturesOptInKeys, OperationState, EvaluationComparisonInsightRequest, Insight, @@ -142,13 +142,13 @@ eval_id=eval_object.id, baseline_run_id=eval_run_1.id, treatment_run_ids=[eval_run_2.id] ), ), - foundry_beta=FoundryPreviewOptInKeys.INSIGHTS_V1, + foundry_features=FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW, ) print(f"Started insight generation (id: {compareInsight.id})") while compareInsight.state not in [OperationState.SUCCEEDED, OperationState.FAILED]: compareInsight = project_client.insights.get( - id=compareInsight.id, foundry_beta=FoundryPreviewOptInKeys.INSIGHTS_V1 + id=compareInsight.id, foundry_features=FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW ) print(f"Waiting for insight to be generated...current status: {compareInsight.state}") time.sleep(5) diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py index 3dc04afeab9d..43dcbd28ce53 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py @@ -39,7 +39,7 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( EasyInputMessage, - FoundryPreviewOptInKeys, + FoundryFeaturesOptInKeys, MemoryStoreDefaultDefinition, MemoryStoreDefaultOptions, MemorySearchOptions, @@ -57,7 +57,7 @@ # Delete memory store, if it already exists memory_store_name = "my_memory_store" try: - project_client.memory_stores.delete(memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1) + project_client.memory_stores.delete(memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -77,7 +77,7 @@ name=memory_store_name, description="Example memory store for conversations", definition=definition, - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Created memory store: {memory_store.name} ({memory_store.id}): {memory_store.description}") @@ -94,7 +94,7 @@ scope=scope, items=[user_message], # Pass conversation items that you want to add to memory update_delay=300, # Keep default inactivity delay before starting update - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Scheduled memory update operation (Update ID: {update_poller.update_id}, Status: {update_poller.status()})") @@ -106,7 +106,7 @@ items=[new_message], previous_update_id=update_poller.update_id, # Extend from previous update ID update_delay=0, # Trigger update immediately without waiting for inactivity - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print( f"Scheduled memory update operation (Update ID: {new_update_poller.update_id}, Status: {new_update_poller.status()})" @@ -133,7 +133,7 @@ scope=scope, items=[query_message], options=MemorySearchOptions(max_memories=5), - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Found {len(search_response.memories)} memories") for memory in search_response.memories: @@ -150,7 +150,7 @@ items=[agent_message, followup_query], previous_search_id=search_response.search_id, options=MemorySearchOptions(max_memories=5), - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Found {len(followup_search_response.memories)} memories") for memory in followup_search_response.memories: @@ -158,10 +158,10 @@ # Delete memories for the current scope project_client.memory_stores.delete_scope( - name=memory_store.name, scope=scope, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + name=memory_store.name, scope=scope, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print(f"Deleted memories for scope '{scope}'") # Delete memory store - project_client.memory_stores.delete(memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1) + project_client.memory_stores.delete(memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW) print(f"Deleted memory store `{memory_store.name}`") diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced_async.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced_async.py index 766d62cd09a1..28e6e7a9d29f 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced_async.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced_async.py @@ -40,7 +40,7 @@ from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( EasyInputMessage, - FoundryPreviewOptInKeys, + FoundryFeaturesOptInKeys, MemoryStoreDefaultDefinition, MemoryStoreDefaultOptions, MemorySearchOptions, @@ -62,7 +62,7 @@ async def main() -> None: memory_store_name = "my_memory_store" try: await project_client.memory_stores.delete( - memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: @@ -83,7 +83,7 @@ async def main() -> None: name=memory_store_name, description="Example memory store for conversations", definition=definition, - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Created memory store: {memory_store.name} ({memory_store.id}): {memory_store.description}") @@ -100,7 +100,7 @@ async def main() -> None: scope=scope, items=[user_message], # Pass conversation items that you want to add to memory update_delay=300, # Keep default inactivity delay before starting update - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print( f"Scheduled memory update operation (Update ID: {update_poller.update_id}, Status: {update_poller.status()})" @@ -114,7 +114,7 @@ async def main() -> None: items=[new_message], previous_update_id=update_poller.update_id, # Extend from previous update ID update_delay=0, # Trigger update immediately without waiting for inactivity - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print( f"Scheduled memory update operation (Update ID: {new_update_poller.update_id}, Status: {new_update_poller.status()})" @@ -141,7 +141,7 @@ async def main() -> None: scope=scope, items=[query_message], options=MemorySearchOptions(max_memories=5), - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Found {len(search_response.memories)} memories") for memory in search_response.memories: @@ -158,7 +158,7 @@ async def main() -> None: items=[agent_message, followup_query], previous_search_id=search_response.search_id, options=MemorySearchOptions(max_memories=5), - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Found {len(followup_search_response.memories)} memories") for memory in followup_search_response.memories: @@ -166,13 +166,13 @@ async def main() -> None: # Delete memories for the current scope await project_client.memory_stores.delete_scope( - name=memory_store.name, scope=scope, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + name=memory_store.name, scope=scope, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print(f"Deleted memories for scope '{scope}'") # Delete memory store await project_client.memory_stores.delete( - memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print(f"Deleted memory store `{memory_store.name}`") diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py index f271b74da882..aafe7617e8ad 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py @@ -37,7 +37,7 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( EasyInputMessage, - FoundryPreviewOptInKeys, + FoundryFeaturesOptInKeys, MemoryStoreDefaultDefinition, MemoryStoreDefaultOptions, MemorySearchOptions, @@ -55,7 +55,7 @@ # Delete memory store, if it already exists memory_store_name = "my_memory_store" try: - project_client.memory_stores.delete(memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1) + project_client.memory_stores.delete(memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -72,7 +72,7 @@ name=memory_store_name, description="Example memory store for conversations", definition=definition, - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Created memory store: {memory_store.name} ({memory_store.id}): {memory_store.description}") if isinstance(memory_store.definition, MemoryStoreDefaultDefinition): @@ -92,7 +92,7 @@ scope=scope, items=[user_message], # Pass conversation items that you want to add to memory update_delay=0, # Trigger update immediately without waiting for inactivity - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) # Wait for the update operation to complete, but can also fire and forget @@ -110,7 +110,7 @@ scope=scope, items=[query_message], options=MemorySearchOptions(max_memories=5), - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Found {len(search_response.memories)} memories") for memory in search_response.memories: @@ -118,10 +118,10 @@ # Delete memories for a specific scope project_client.memory_stores.delete_scope( - name=memory_store.name, scope=scope, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + name=memory_store.name, scope=scope, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print(f"Deleted memories for scope '{scope}'") # Delete memory store - project_client.memory_stores.delete(memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1) + project_client.memory_stores.delete(memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW) print(f"Deleted memory store `{memory_store.name}`") diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic_async.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic_async.py index 11a120deb0a8..02a66c24f057 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic_async.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic_async.py @@ -39,7 +39,7 @@ from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( EasyInputMessage, - FoundryPreviewOptInKeys, + FoundryFeaturesOptInKeys, MemoryStoreDefaultDefinition, MemoryStoreDefaultOptions, MemorySearchOptions, @@ -61,7 +61,7 @@ async def main() -> None: memory_store_name = "my_memory_store" try: await project_client.memory_stores.delete( - memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: @@ -79,7 +79,7 @@ async def main() -> None: name=memory_store_name, description="Example memory store for conversations", definition=definition, - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Created memory store: {memory_store.name} ({memory_store.id}): {memory_store.description}") if isinstance(memory_store.definition, MemoryStoreDefaultDefinition): @@ -99,7 +99,7 @@ async def main() -> None: scope=scope, items=[user_message], # Pass conversation items that you want to add to memory update_delay=0, # Trigger update immediately without waiting for inactivity - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) # Wait for the update operation to complete, but can also fire and forget @@ -117,7 +117,7 @@ async def main() -> None: scope=scope, items=[query_message], options=MemorySearchOptions(max_memories=5), - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Found {len(search_response.memories)} memories") for memory in search_response.memories: @@ -125,13 +125,13 @@ async def main() -> None: # Delete memories for a specific scope await project_client.memory_stores.delete_scope( - name=memory_store.name, scope=scope, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + name=memory_store.name, scope=scope, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print(f"Deleted memories for scope '{scope}'") # Delete memory store await project_client.memory_stores.delete( - memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print(f"Deleted memory store `{memory_store.name}`") diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py index 038690d8b561..c5fcca57c335 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py @@ -33,7 +33,7 @@ from azure.core.exceptions import ResourceNotFoundError from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import FoundryPreviewOptInKeys, MemoryStoreDefaultDefinition +from azure.ai.projects.models import FoundryFeaturesOptInKeys, MemoryStoreDefaultDefinition load_dotenv() @@ -47,7 +47,7 @@ # Delete memory store, if it already exists memory_store_name = "my_memory_store" try: - project_client.memory_stores.delete(memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1) + project_client.memory_stores.delete(memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -61,13 +61,13 @@ name=memory_store_name, description="Example memory store for conversations", definition=definition, - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Created memory store: {memory_store.name} ({memory_store.id}): {memory_store.description}") # Get Memory Store get_store = project_client.memory_stores.get( - memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print(f"Retrieved: {get_store.name} ({get_store.id}): {get_store.description}") @@ -75,13 +75,13 @@ updated_store = project_client.memory_stores.update( name=memory_store.name, description="Updated description", - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Updated: {updated_store.name} ({updated_store.id}): {updated_store.description}") # List Memory Store memory_stores = list( - project_client.memory_stores.list(limit=10, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1) + project_client.memory_stores.list(limit=10, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW) ) print(f"Found {len(memory_stores)} memory stores") for store in memory_stores: @@ -89,6 +89,6 @@ # Delete Memory Store delete_response = project_client.memory_stores.delete( - memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print(f"Deleted: {delete_response.deleted}") diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud_async.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud_async.py index ba10f820d59d..a573b47c2f3a 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud_async.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud_async.py @@ -34,7 +34,7 @@ from azure.core.exceptions import ResourceNotFoundError from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import FoundryPreviewOptInKeys, MemoryStoreDefaultDefinition +from azure.ai.projects.models import FoundryFeaturesOptInKeys, MemoryStoreDefaultDefinition load_dotenv() @@ -52,7 +52,7 @@ async def main() -> None: memory_store_name = "my_memory_store" try: await project_client.memory_stores.delete( - memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: @@ -67,13 +67,13 @@ async def main() -> None: name=memory_store_name, description="Example memory store for conversations", definition=definition, - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Created memory store: {memory_store.name} ({memory_store.id}): {memory_store.description}") # Get Memory Store get_store = await project_client.memory_stores.get( - memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print(f"Retrieved: {get_store.name} ({get_store.id}): {get_store.description}") @@ -81,14 +81,14 @@ async def main() -> None: updated_store = await project_client.memory_stores.update( name=memory_store.name, description="Updated description", - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"Updated: {updated_store.name} ({updated_store.id}): {updated_store.description}") # List Memory Store memory_stores = [] async for store in project_client.memory_stores.list( - limit=10, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + limit=10, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ): memory_stores.append(store) print(f"Found {len(memory_stores)} memory stores") @@ -97,7 +97,7 @@ async def main() -> None: # Delete Memory Store delete_response = await project_client.memory_stores.delete( - memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print(f"Deleted: {delete_response.deleted}") diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search.py index 78941a4951d2..d90fb88a9757 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search.py @@ -11,7 +11,7 @@ from devtools_testutils import recorded_by_proxy, RecordedTransport, is_live, is_live_and_not_recording from azure.core.exceptions import ResourceNotFoundError from azure.ai.projects.models import ( - FoundryPreviewOptInKeys, + FoundryFeaturesOptInKeys, MemoryStoreDefaultDefinition, MemorySearchPreviewTool, PromptAgentDefinition, @@ -83,7 +83,7 @@ def test_agent_memory_search(self, **kwargs): if is_live_and_not_recording(): try: project_client.memory_stores.delete( - memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: @@ -100,7 +100,7 @@ def test_agent_memory_search(self, **kwargs): name=memory_store_name, description="Test memory store for agent conversations", definition=definition, - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"\nMemory store created: {memory_store.name} (id: {memory_store.id})") assert memory_store.name == memory_store_name @@ -211,7 +211,7 @@ def test_agent_memory_search(self, **kwargs): if memory_store: try: project_client.memory_stores.delete( - memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print("Memory store deleted") except Exception as e: diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search_async.py index 6dcde3194195..aa904ccbdf5e 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search_async.py @@ -12,7 +12,7 @@ from devtools_testutils import RecordedTransport, is_live, is_live_and_not_recording from azure.core.exceptions import ResourceNotFoundError from azure.ai.projects.models import ( - FoundryPreviewOptInKeys, + FoundryFeaturesOptInKeys, MemoryStoreDefaultDefinition, MemorySearchPreviewTool, PromptAgentDefinition, @@ -58,7 +58,7 @@ async def test_agent_memory_search_async(self, **kwargs): if is_live_and_not_recording(): try: await project_client.memory_stores.delete( - memory_store_name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: @@ -75,7 +75,7 @@ async def test_agent_memory_search_async(self, **kwargs): name=memory_store_name, description="Test memory store for agent conversations", definition=definition, - foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1, + foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW, ) print(f"\nMemory store created: {memory_store.name} (id: {memory_store.id})") assert memory_store.name == memory_store_name @@ -186,7 +186,7 @@ async def test_agent_memory_search_async(self, **kwargs): if memory_store: try: await project_client.memory_stores.delete( - memory_store.name, foundry_beta=FoundryPreviewOptInKeys.MEMORY_STORES_V1 + memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW ) print("Memory store deleted") except Exception as e: From 8bed441ebd9b072357d8f334a9dab6f462fc0e65 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 4 Feb 2026 06:33:09 -0800 Subject: [PATCH 13/22] Fix pyright. Fix install comment in samples --- .../samples/agents/tools/sample_agent_openapi.py | 4 ++-- .../tools/sample_agent_openapi_with_project_connection.py | 4 ++-- .../samples/agents/tools/sample_agent_web_search_preview.py | 2 +- .../tools/sample_agent_web_search_with_custom_search.py | 2 +- sdk/ai/azure-ai-projects/samples/evaluations/README.md | 2 +- sdk/ai/azure-ai-projects/samples/files/sample_files.py | 2 +- sdk/ai/azure-ai-projects/samples/files/sample_files_async.py | 2 +- .../samples/finetuning/sample_finetuning_dpo_job.py | 2 +- .../samples/finetuning/sample_finetuning_dpo_job_async.py | 2 +- .../finetuning/sample_finetuning_oss_models_supervised_job.py | 2 +- .../sample_finetuning_oss_models_supervised_job_async.py | 2 +- .../samples/finetuning/sample_finetuning_reinforcement_job.py | 2 +- .../finetuning/sample_finetuning_reinforcement_job_async.py | 2 +- .../samples/finetuning/sample_finetuning_supervised_job.py | 2 +- .../finetuning/sample_finetuning_supervised_job_async.py | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi.py index 901c33283ed6..6d8f55cb5de2 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi.py @@ -26,7 +26,7 @@ import os import jsonref from dotenv import load_dotenv - +from typing import Any, cast from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( @@ -50,7 +50,7 @@ # [START tool_declaration] with open(weather_asset_file_path, "r") as f: - openapi_weather = jsonref.loads(f.read()) + openapi_weather= cast(dict[str, Any], jsonref.loads(f.read())) tool = OpenApiTool( openapi=OpenApiFunctionDefinition( diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi_with_project_connection.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi_with_project_connection.py index 7f680a979e6a..92abc436b557 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi_with_project_connection.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi_with_project_connection.py @@ -29,7 +29,7 @@ import os import jsonref from dotenv import load_dotenv - +from typing import Any, cast from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( @@ -56,7 +56,7 @@ # [START tool_declaration] with open(tripadvisor_asset_file_path, "r") as f: - openapi_tripadvisor = jsonref.loads(f.read()) + openapi_tripadvisor = cast(dict[str, Any], jsonref.loads(f.read())) tool = OpenApiTool( openapi=OpenApiFunctionDefinition( diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py index ef21027f64a3..68c955e0f851 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_preview.py @@ -13,7 +13,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py index 9ff7d94f89cb..7bff7f43527d 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_web_search_with_custom_search.py @@ -14,7 +14,7 @@ Before running the sample: - pip install "azure-ai-projects>=2.0.0b1" python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/README.md b/sdk/ai/azure-ai-projects/samples/evaluations/README.md index ef774d201eaa..6a8897879a9c 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/README.md +++ b/sdk/ai/azure-ai-projects/samples/evaluations/README.md @@ -7,7 +7,7 @@ This folder contains samples demonstrating how to use Azure AI Foundry's evaluat Before running any sample: ```bash -pip install "azure-ai-projects>=2.0.0b1" python-dotenv +pip install "azure-ai-projects>=2.0.0b4" python-dotenv ``` Set these environment variables: diff --git a/sdk/ai/azure-ai-projects/samples/files/sample_files.py b/sdk/ai/azure-ai-projects/samples/files/sample_files.py index 7b70bf34c9ea..bb59539c2dac 100644 --- a/sdk/ai/azure-ai-projects/samples/files/sample_files.py +++ b/sdk/ai/azure-ai-projects/samples/files/sample_files.py @@ -14,7 +14,7 @@ Before running the sample: - pip install azure-ai-projects>=2.0.0b1 python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/files/sample_files_async.py b/sdk/ai/azure-ai-projects/samples/files/sample_files_async.py index e417171ed002..0404b2981788 100644 --- a/sdk/ai/azure-ai-projects/samples/files/sample_files_async.py +++ b/sdk/ai/azure-ai-projects/samples/files/sample_files_async.py @@ -14,7 +14,7 @@ Before running the sample: - pip install azure-ai-projects>=2.0.0b1 python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_dpo_job.py b/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_dpo_job.py index 6e619bcd84b9..8f7101256308 100644 --- a/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_dpo_job.py +++ b/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_dpo_job.py @@ -15,7 +15,7 @@ Before running the sample: - pip install azure-ai-projects>=2.0.0b1 python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_dpo_job_async.py b/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_dpo_job_async.py index 5b2064b284e1..413d6f743b68 100644 --- a/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_dpo_job_async.py +++ b/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_dpo_job_async.py @@ -15,7 +15,7 @@ Before running the sample: - pip install azure-ai-projects>=2.0.0b1 python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_oss_models_supervised_job.py b/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_oss_models_supervised_job.py index 6e7b4d26cea8..e5ed89eb4654 100644 --- a/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_oss_models_supervised_job.py +++ b/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_oss_models_supervised_job.py @@ -15,7 +15,7 @@ Before running the sample: - pip install azure-ai-projects>=2.0.0b1 python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_oss_models_supervised_job_async.py b/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_oss_models_supervised_job_async.py index 0335e45febe9..cf921bfd9154 100644 --- a/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_oss_models_supervised_job_async.py +++ b/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_oss_models_supervised_job_async.py @@ -15,7 +15,7 @@ Before running the sample: - pip install azure-ai-projects>=2.0.0b1 python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_reinforcement_job.py b/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_reinforcement_job.py index 064f4c36e4d6..79e0cbb95158 100644 --- a/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_reinforcement_job.py +++ b/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_reinforcement_job.py @@ -15,7 +15,7 @@ Before running the sample: - pip install azure-ai-projects>=2.0.0b1 python-dotenv + pip install "azure-ai-projects>=2.0.0b4" python-dotenv Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_reinforcement_job_async.py b/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_reinforcement_job_async.py index 81cbade07c75..84433bf47419 100644 --- a/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_reinforcement_job_async.py +++ b/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_reinforcement_job_async.py @@ -15,7 +15,7 @@ Before running the sample: - pip install azure-ai-projects>=2.0.0b1 python-dotenv aiohttp + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_supervised_job.py b/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_supervised_job.py index 78131c9b9f8f..a48a613f919b 100644 --- a/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_supervised_job.py +++ b/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_supervised_job.py @@ -18,7 +18,7 @@ Before running the sample: - pip install azure-ai-projects>=2.0.0b1 python-dotenv azure-mgmt-cognitiveservices + pip install "azure-ai-projects>=2.0.0b4" python-dotenv azure-mgmt-cognitiveservices Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your diff --git a/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_supervised_job_async.py b/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_supervised_job_async.py index 7ed68304bc17..86d67171429b 100644 --- a/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_supervised_job_async.py +++ b/sdk/ai/azure-ai-projects/samples/finetuning/sample_finetuning_supervised_job_async.py @@ -18,7 +18,7 @@ Before running the sample: - pip install azure-ai-projects>=2.0.0b1 python-dotenv aiohttp azure-mgmt-cognitiveservices + pip install "azure-ai-projects>=2.0.0b4" python-dotenv aiohttp azure-mgmt-cognitiveservices Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - Required. The Azure AI Project endpoint, as found in the overview page of your From 68f366c2ebb5c0299fad007f588946db99b34fed Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 4 Feb 2026 06:46:29 -0800 Subject: [PATCH 14/22] Fix pyright --- .../aio/operations/_patch_memories_async.py | 37 +++++++++++++++++-- .../ai/projects/operations/_patch_memories.py | 34 +++++++++++++++-- .../tools/sample_agent_memory_search.py | 8 +++- .../agents/tools/sample_agent_openapi.py | 2 +- ...e_agent_openapi_with_project_connection.py | 2 +- .../evaluations/sample_eval_catalog.py | 4 +- .../memories/sample_memory_advanced.py | 8 +++- .../samples/memories/sample_memory_basic.py | 8 +++- .../samples/memories/sample_memory_crud.py | 4 +- 9 files changed, 91 insertions(+), 16 deletions(-) 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 f5e10b01c4bc..564645f1e796 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 @@ -7,12 +7,13 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Union, Optional, Any, List, overload, IO, cast +from typing import Union, Optional, Any, List, overload, IO, cast, Literal from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.polling import AsyncNoPolling from azure.core.utils import case_insensitive_dict from ... import models as _models from ...models import ( + FoundryFeaturesOptInKeys, MemoryStoreOperationUsage, ResponseUsageInputTokensDetails, ResponseUsageOutputTokensDetails, @@ -32,6 +33,7 @@ async def begin_update_memories( self, name: str, *, + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str, content_type: str = "application/json", items: Optional[List[_models.InputItem]] = None, @@ -43,6 +45,12 @@ async def begin_update_memories( :param name: The name of the memory store to update. Required. :type name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -69,7 +77,13 @@ async def begin_update_memories( @overload async def begin_update_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + body: JSON, + *, + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any, ) -> AsyncUpdateMemoriesLROPoller: """Update memory store with conversation memories. @@ -77,6 +91,9 @@ async def begin_update_memories( :type name: str :param body: Required. :type body: JSON + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -89,7 +106,13 @@ async def begin_update_memories( @overload async def begin_update_memories( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + body: IO[bytes], + *, + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any, ) -> AsyncUpdateMemoriesLROPoller: """Update memory store with conversation memories. @@ -97,6 +120,9 @@ async def begin_update_memories( :type 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. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -118,6 +144,7 @@ async def begin_update_memories( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str = _Unset, items: Optional[List[_models.InputItem]] = None, previous_update_id: Optional[str] = None, @@ -130,6 +157,9 @@ async def begin_update_memories( :type name: str :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -160,6 +190,7 @@ async def begin_update_memories( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._update_memories_initial( + foundry_features=foundry_features, name=name, body=body, scope=scope, 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 b88312d13b2e..ff7ebcc51358 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 @@ -7,12 +7,13 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Union, Optional, Any, List, overload, IO, cast +from typing import Union, Optional, Any, List, overload, IO, cast, Literal from azure.core.tracing.decorator import distributed_trace from azure.core.polling import NoPolling from azure.core.utils import case_insensitive_dict from .. import models as _models from ..models import ( + FoundryFeaturesOptInKeys, MemoryStoreOperationUsage, ResponseUsageInputTokensDetails, ResponseUsageOutputTokensDetails, @@ -32,6 +33,7 @@ def begin_update_memories( self, name: str, *, + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str, content_type: str = "application/json", items: Optional[List[_models.InputItem]] = None, @@ -43,6 +45,9 @@ def begin_update_memories( :param name: The name of the memory store to update. Required. :type name: str + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -69,7 +74,13 @@ def begin_update_memories( @overload def begin_update_memories( - self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + body: JSON, + *, + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any, ) -> UpdateMemoriesLROPoller: """Update memory store with conversation memories. @@ -77,6 +88,9 @@ def begin_update_memories( :type name: str :param body: Required. :type body: JSON + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -89,7 +103,13 @@ def begin_update_memories( @overload def begin_update_memories( - self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, + name: str, + body: IO[bytes], + *, + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + content_type: str = "application/json", + **kwargs: Any, ) -> UpdateMemoriesLROPoller: """Update memory store with conversation memories. @@ -97,6 +117,9 @@ def begin_update_memories( :type 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. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -118,6 +141,7 @@ def begin_update_memories( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, + foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], scope: str = _Unset, items: Optional[List[_models.InputItem]] = None, previous_update_id: Optional[str] = None, @@ -130,6 +154,9 @@ def begin_update_memories( :type name: str :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] + :keyword foundry_features: A feature flag opt-in required when using preview operations or + modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. + :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -160,6 +187,7 @@ def begin_update_memories( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._update_memories_initial( + foundry_features=foundry_features, name=name, body=body, scope=scope, diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search.py index 214a7298578a..45160384b886 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_memory_search.py @@ -61,7 +61,9 @@ # Delete memory store, if it already exists memory_store_name = "my_memory_store" try: - project_client.memory_stores.delete(memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW) + project_client.memory_stores.delete( + memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW + ) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -142,5 +144,7 @@ project_client.agents.delete_version(agent_name=agent.name, agent_version=agent.version) print("Agent deleted") - project_client.memory_stores.delete(memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW) + project_client.memory_stores.delete( + memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW + ) print("Memory store deleted") diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi.py index 6d8f55cb5de2..0d2865edcd3a 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi.py @@ -50,7 +50,7 @@ # [START tool_declaration] with open(weather_asset_file_path, "r") as f: - openapi_weather= cast(dict[str, Any], jsonref.loads(f.read())) + openapi_weather = cast(dict[str, Any], jsonref.loads(f.read())) tool = OpenApiTool( openapi=OpenApiFunctionDefinition( diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi_with_project_connection.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi_with_project_connection.py index 92abc436b557..63cbc730908d 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi_with_project_connection.py +++ b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_openapi_with_project_connection.py @@ -56,7 +56,7 @@ # [START tool_declaration] with open(tripadvisor_asset_file_path, "r") as f: - openapi_tripadvisor = cast(dict[str, Any], jsonref.loads(f.read())) + openapi_tripadvisor = cast(dict[str, Any], jsonref.loads(f.read())) tool = OpenApiTool( openapi=OpenApiFunctionDefinition( diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog.py index e48ece22081f..b71c67fb17b1 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_eval_catalog.py @@ -144,7 +144,9 @@ print("Get code based evaluator version") code_evaluator_latest = project_client.evaluators.get_version( - name=code_evaluator.name, version=code_evaluator.version, foundry_features=FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW + name=code_evaluator.name, + version=code_evaluator.version, + foundry_features=FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW, ) pprint(code_evaluator_latest) diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py index 43dcbd28ce53..b9d3ab344c6b 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_advanced.py @@ -57,7 +57,9 @@ # Delete memory store, if it already exists memory_store_name = "my_memory_store" try: - project_client.memory_stores.delete(memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW) + project_client.memory_stores.delete( + memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW + ) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -163,5 +165,7 @@ print(f"Deleted memories for scope '{scope}'") # Delete memory store - project_client.memory_stores.delete(memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW) + project_client.memory_stores.delete( + memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW + ) print(f"Deleted memory store `{memory_store.name}`") diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py index aafe7617e8ad..95033dc066b3 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_basic.py @@ -55,7 +55,9 @@ # Delete memory store, if it already exists memory_store_name = "my_memory_store" try: - project_client.memory_stores.delete(memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW) + project_client.memory_stores.delete( + memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW + ) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass @@ -123,5 +125,7 @@ print(f"Deleted memories for scope '{scope}'") # Delete memory store - project_client.memory_stores.delete(memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW) + project_client.memory_stores.delete( + memory_store.name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW + ) print(f"Deleted memory store `{memory_store.name}`") diff --git a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py index c5fcca57c335..61f33c17458e 100644 --- a/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py +++ b/sdk/ai/azure-ai-projects/samples/memories/sample_memory_crud.py @@ -47,7 +47,9 @@ # Delete memory store, if it already exists memory_store_name = "my_memory_store" try: - project_client.memory_stores.delete(memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW) + project_client.memory_stores.delete( + memory_store_name, foundry_features=FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW + ) print(f"Memory store `{memory_store_name}` deleted") except ResourceNotFoundError: pass From 910ab6fe1b4a501a3fb3509d1610cc69fd580548 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 4 Feb 2026 08:17:53 -0800 Subject: [PATCH 15/22] Update code snippets in README.md. Add emitter-package*.json files --- eng/emitter-package-lock.json | 40 ++++++++++++++++++++---------- eng/emitter-package.json | 2 +- sdk/ai/azure-ai-projects/README.md | 6 ++--- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 1a534f600857..342252d63116 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -9,7 +9,7 @@ "@azure-tools/typespec-python": "0.59.2" }, "devDependencies": { - "@azure-tools/openai-typespec": "1.7.3", + "@azure-tools/openai-typespec": "1.8.0", "@azure-tools/typespec-autorest": "~0.64.1", "@azure-tools/typespec-azure-core": "~0.64.0", "@azure-tools/typespec-azure-resource-manager": "~0.64.1", @@ -28,9 +28,9 @@ } }, "node_modules/@azure-tools/openai-typespec": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.7.3.tgz", - "integrity": "sha512-hmbYxVUXI6oYtkTeaXj8LzYZsrh5GQiQiL88YQptFyyBbq75VDA+qnak+7Sk1hxwkZqwy7+WJa8vJqWM3CSRaw==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.8.0.tgz", + "integrity": "sha512-iJRimNIbwqAF6ueYpiL5xY1GJSOA1k3NkqA1NdPlxSJ3bZLP690zR+hHTqEq95HnwqFh2feCDjof9ABtY4keWg==", "dev": true, "license": "MIT", "peerDependencies": { @@ -43,6 +43,7 @@ "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.64.1.tgz", "integrity": "sha512-WzSRiX0XS7hCL+uiivLBYMbirEUenxNzPT4giF0J+r54CVNXq/u8PLnA/06F5EHkXPa92swF4BxB1vFWB2TKow==", "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -68,6 +69,7 @@ "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.64.0.tgz", "integrity": "sha512-BXiHc5oayhMsG1dHFU1aFK/ZQX2Gl0dKB0FAFceapaFV9093J2obbsdhIDR3Tl0qei9g3Ha+iWKZ4KgnLdhv4w==", "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -82,6 +84,7 @@ "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.64.1.tgz", "integrity": "sha512-qQV/+ZVF1h8PsTNKhmKYyb+vSCgnLA8SoGeEE1oOrevGrrp9VgtOMAZ2xIxj6DpU90QU/8t2+r5P/gcQUV1iqw==", "license": "MIT", + "peer": true, "dependencies": { "change-case": "~5.4.4", "pluralize": "^8.0.0" @@ -103,6 +106,7 @@ "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.64.0.tgz", "integrity": "sha512-CvK5iolfsm8oAUZ5wegGVYp4Vvw2rwQa+rcUVoJkwi9c6QwEr+qT6/S4hIntuzEPLxybJSb/ZIWU9Qx3cDrzXg==", "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -118,6 +122,7 @@ "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.64.5.tgz", "integrity": "sha512-RaATxsnc9ztdMPoIZ2SuyH97dIGY0BWGKcJBf0hBY+8J3de9o+QH796NA9OsiW+8J9ycCEooDbh/rkAspvA4xA==", "license": "MIT", + "peer": true, "dependencies": { "change-case": "~5.4.4", "pluralize": "^8.0.0", @@ -1009,6 +1014,7 @@ "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-1.8.0.tgz", "integrity": "sha512-FeLb7Q0z6Bh5dDpqtnU2RlWiIWWWF7rujx2xGMta5dcTuIOZ4jbdyz1hVdxk4iM4qadvaSV4ey/qrSuffNoh3w==", "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "~7.27.1", "@inquirer/prompts": "^8.0.1", @@ -1053,6 +1059,7 @@ "resolved": "https://registry.npmjs.org/@typespec/events/-/events-0.78.0.tgz", "integrity": "sha512-gSI4rAexxfYyZX0ZqYNRWQyuMb1UeakjAjOeh/2ntmxWCdYc+wSbJjxrxIArsZC+LwzTxq5WpdtD7+7OWzG4yw==", "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -1065,6 +1072,7 @@ "resolved": "https://registry.npmjs.org/@typespec/http/-/http-1.8.0.tgz", "integrity": "sha512-ZKa4RISabwL8cUAmE3BkoNmtCYRjerO0+1Ba6XdDJKG+vJC5EGM2hkDf+ZmYsYZgrX0cvbhPXUKKh28zBV60hw==", "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -1079,9 +1087,9 @@ } }, "node_modules/@typespec/http-client-python": { - "version": "0.26.2", - "resolved": "https://registry.npmjs.org/@typespec/http-client-python/-/http-client-python-0.26.2.tgz", - "integrity": "sha512-bNpjViWsaZER3Z0O/QYgo4OALTDubPuCwuq0iExb8U5AIig/CB4Qsi9zVRtyRfH0ZZ2KJqjlTYaHazrtX4bqLA==", + "version": "0.26.3", + "resolved": "https://registry.npmjs.org/@typespec/http-client-python/-/http-client-python-0.26.3.tgz", + "integrity": "sha512-LKBi+giSTDbIc1UoAr1+8zGomhes9z68GyIGjxpuN+BxLbdFAUJurDFyDILSJw9rcS8WgYXnVXhHxmP33mqjvw==", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -1116,6 +1124,7 @@ "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-1.8.0.tgz", "integrity": "sha512-v+RIJpx7vALBSGQmnUWemvXjnrk50HAVqJeg0RbaF3VUnh66Z4itsoNJJmIIc+HmBJng8Ie0V7xv3l02ek6HWA==", "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -1129,6 +1138,7 @@ "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.78.0.tgz", "integrity": "sha512-1clnDw1JbBvjLcfFvEvHdIrnsQuQI5/Cl6mRIrzWWX0pKJ+R89rCdZD1KpidEXw4B4qscD48LsssyrEIFLtuPg==", "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -1142,6 +1152,7 @@ "resolved": "https://registry.npmjs.org/@typespec/sse/-/sse-0.78.0.tgz", "integrity": "sha512-jPARl+e1e/nsDW/1uVsGTzvKmjqezVMyUa13igXxk5nV2ScMdFpH1HhBwTmAhUeaZgY3J81dFHNUnIY67HCrmw==", "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -1157,6 +1168,7 @@ "resolved": "https://registry.npmjs.org/@typespec/streams/-/streams-0.78.0.tgz", "integrity": "sha512-wzh5bVdzh+K+pFQFs/EZkVsTH5TQGi12XwhjxJS0UKRwaW2UwSZeY1HqX07oMMPdYESTbjgMrXcxtn89AlzjvQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -1169,6 +1181,7 @@ "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.78.0.tgz", "integrity": "sha512-I14X6+IMd0wFMNI8oMFSeFBi2nD4idub+geSO34vuCs4rwuEj3FNzy+rkNkDDvf0+gIUGxeyg7s+YDUcNyiqOA==", "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -1181,6 +1194,7 @@ "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.78.0.tgz", "integrity": "sha512-KSDhJX6A/Onsu9FKVZtR/xSy5va3k0y9/U4eiZUn91V/LQyMZNwmResPDHEVYk6JqaIH8bbd6ANWPu3nMd7mmw==", "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -1467,9 +1481,9 @@ } }, "node_modules/get-tsconfig": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.0.tgz", - "integrity": "sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==", + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.1.tgz", + "integrity": "sha512-EoY1N2xCn44xU6750Sx7OjOIT59FkmstNc3X6y5xpz7D5cBtZRe/3pSlTkDJgqsOk3WwZPkWfonhhUJfttQo3w==", "license": "MIT", "dependencies": { "resolve-pkg-maps": "^1.0.0" @@ -1904,9 +1918,9 @@ } }, "node_modules/tar": { - "version": "7.5.7", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.7.tgz", - "integrity": "sha512-fov56fJiRuThVFXD6o6/Q354S7pnWMJIVlDBYijsTNx6jKSE4pvrDTs6lUnmGvNyfJwFQQwWy3owKz1ucIhveQ==", + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.6.tgz", + "integrity": "sha512-xqUeu2JAIJpXyvskvU3uvQW8PAmHrtXp2KDuMJwQqW8Sqq0CaZBAQ+dKS3RBXVhU4wC5NjAdKrmh84241gO9cA==", "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/fs-minipass": "^4.0.0", diff --git a/eng/emitter-package.json b/eng/emitter-package.json index e16ca6495676..e3c5026833b8 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -13,7 +13,7 @@ "@typespec/sse": "~0.78.0", "@typespec/streams": "~0.78.0", "@typespec/xml": "~0.78.0", - "@azure-tools/openai-typespec": "1.7.3", + "@azure-tools/openai-typespec": "1.8.0", "@azure-tools/typespec-autorest": "~0.64.1", "@azure-tools/typespec-azure-core": "~0.64.0", "@azure-tools/typespec-azure-resource-manager": "~0.64.1", diff --git a/sdk/ai/azure-ai-projects/README.md b/sdk/ai/azure-ai-projects/README.md index 45ac8e70c8bf..b01d6ba517fa 100644 --- a/sdk/ai/azure-ai-projects/README.md +++ b/sdk/ai/azure-ai-projects/README.md @@ -289,7 +289,7 @@ Discover up-to-date web content with the GA Web Search tool or try the Web Searc ```python -tool = WebSearchPreviewTool(user_location=ApproximateLocation(country="GB", city="London", region="London")) +tool = WebSearchTool(user_location=WebSearchApproximateLocation(country="GB", city="London", region="London")) ``` @@ -368,7 +368,7 @@ Call external APIs defined by OpenAPI specifications without additional client-s ```python with open(weather_asset_file_path, "r") as f: - openapi_weather = jsonref.loads(f.read()) + openapi_weather = cast(dict[str, Any], jsonref.loads(f.read())) tool = OpenApiTool( openapi=OpenApiFunctionDefinition( @@ -616,7 +616,7 @@ Call external APIs defined by OpenAPI specifications using project connection au ```python with open(tripadvisor_asset_file_path, "r") as f: - openapi_tripadvisor = jsonref.loads(f.read()) + openapi_tripadvisor = cast(dict[str, Any], jsonref.loads(f.read())) tool = OpenApiTool( openapi=OpenApiFunctionDefinition( From 3a7a95b3c8aab1330a1acbba848f947e0f705514 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 4 Feb 2026 10:02:55 -0800 Subject: [PATCH 16/22] Hand fix some Sphinx errors --- .../azure/ai/projects/models/_models.py | 26 +++++++------------ .../azure-ai-projects/post-emitter-fixes.cmd | 13 ++++++++++ 2 files changed, 23 insertions(+), 16 deletions(-) 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 8191caa3b78f..6ebb9b260129 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 @@ -13478,7 +13478,6 @@ class Response(_Model): :ivar incomplete_details: Required. :vartype incomplete_details: ~azure.ai.projects.models.ResponseIncompleteDetails :ivar output: An array of content items generated by the model. - * The length and order of items in the `output` array is dependent on the model's response. * Rather than accessing the first item in the `output` array and @@ -13574,7 +13573,6 @@ class Response(_Model): """Required.""" output: list["_models.OutputItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """An array of content items generated by the model. - * The length and order of items in the `output` array is dependent on the model's response. * Rather than accessing the first item in the `output` array and @@ -17499,14 +17497,12 @@ class ToolChoiceAllowed(ToolChoiceParam, discriminator="allowed_tools"): :vartype mode: str or str :ivar tools: 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" } - ]. Required. + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ]. Required. :vartype tools: list[dict[str, any]] """ @@ -17520,14 +17516,12 @@ class ToolChoiceAllowed(ToolChoiceParam, discriminator="allowed_tools"): tools: list[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """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\" } - ]. Required.""" + [ + { \"type\": \"function\", \"name\": \"get_weather\" }, + { \"type\": \"mcp\", \"server_label\": \"deepwiki\" }, + { \"type\": \"image_generation\" } + ]. Required.""" @overload def __init__( diff --git a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd index 88d92c54eaec..c6f6f72ab2ac 100644 --- a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd +++ b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd @@ -21,6 +21,19 @@ REM Rename `"items_property": items`, to `"items": items` in search_memories and powershell -Command "(Get-Content azure\ai\projects\aio\operations\_operations.py) -replace '\"items_property\": items', '\"items\": items' | Set-Content azure\ai\projects\aio\operations\_operations.py" powershell -Command "(Get-Content azure\ai\projects\operations\_operations.py) -replace '\"items_property\": items', '\"items\": items' | Set-Content azure\ai\projects\operations\_operations.py" +REM Fix Sphinx issue (see bug on emitter: https://github.com/microsoft/typespec/issues/9579) +REM Go to where class "Response" is defined. See the doc string for "output" property (two locations). Remove the blank 2nd line. + +REM Fix Shpinx issue in class ToolChoiceAllowed, in "tools" property doc string. Everything shoud be aligned including JSON example, like this: +REM """A list of tool definitions that the model should be allowed to call. For the Responses API, the +REM list of tool definitions might look like: +REM .. code-block:: json +REM [ +REM { \"type\": \"function\", \"name\": \"get_weather\" }, +REM { \"type\": \"mcp\", \"server_label\": \"deepwiki\" }, +REM { \"type\": \"image_generation\" } +REM ]. Required.""" + REM Fix type annotations by replacing "_types.Filters" with proper union type to fix Pyright errors REM powershell -Command "(Get-Content azure\ai\projects\models\_models.py) -replace '\"_types\.Filters\"', 'Union[\"_models.ComparisonFilter\", \"_models.CompoundFilter\"]' | Set-Content azure\ai\projects\models\_models.py" From 7eac57b4e00ccee28ec780760753cf7de1450bc1 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 4 Feb 2026 10:18:49 -0800 Subject: [PATCH 17/22] Fix one more Shpinx issue --- .../azure/ai/projects/models/_models.py | 16 ++++++++-------- sdk/ai/azure-ai-projects/post-emitter-fixes.cmd | 4 ++++ 2 files changed, 12 insertions(+), 8 deletions(-) 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 6ebb9b260129..b37ead83dcef 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 @@ -12847,7 +12847,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Prompt(_Model): - """Reference to a prompt template and its variables. `Learn more + """Reference to a prompt template and its variables. `Learn more about reusable prompts `_. :ivar id: The unique identifier of the prompt template to use. Required. @@ -13417,17 +13417,17 @@ class Response(_Model): :ivar user: This field is being replaced by ``safety_identifier`` and ``prompt_cache_key``. Use ``prompt_cache_key`` instead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help - OpenAI detect and prevent abuse. `Learn more + OpenAI detect and prevent abuse. `Learn more about safety identifiers `_. :vartype user: str :ivar safety_identifier: A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us - any identifying information. `Learn more + any identifying information. `Learn more about safety identifiers `_. :vartype safety_identifier: str :ivar prompt_cache_key: Used by OpenAI to cache responses for similar requests to optimize your - cache hit rates. Replaces the ``user`` field. `Learn more + cache hit rates. Replaces the ``user`` field. `Learn more about prompt caching `_. :vartype prompt_cache_key: str :ivar service_tier: Is one of the following types: Literal["auto"], Literal["default"], @@ -13507,17 +13507,17 @@ class Response(_Model): """This field is being replaced by ``safety_identifier`` and ``prompt_cache_key``. Use ``prompt_cache_key`` instead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help - OpenAI detect and prevent abuse. `Learn more + OpenAI detect and prevent abuse. `Learn more about safety ididentifiers `_.""" safety_identifier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying - information. `Learn more + information. `Learn more about safety identifiers `_.""" prompt_cache_key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. - Replaces the ``user`` field. `Learn more + Replaces the ``user`` field. `Learn more about prompt caching `_.""" service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -16366,7 +16366,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ResponseTextParam(_Model): """Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + text or structured JSON data. Learn more here: * [Text inputs and outputs](https://platform.openai.com/docs/guides/text) * [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). diff --git a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd index c6f6f72ab2ac..b803dc15473a 100644 --- a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd +++ b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd @@ -34,6 +34,10 @@ REM { \"type\": \"mcp\", \"server_label\": \"deepwiki\" }, REM { \"type\": \"image_generation\" } REM ]. Required.""" +REM Fix Shipnx issue: docstring of azure.ai.projects.models.WorkflowPreviewActionOutputItem.type:2: WARNING: Duplicate explicit target name: "learn more". [docutils] +REM Turns out this has nothing to do with doc string of class WorkflowPreviewActionOutputItem. Search for "learn more" +REM and chage them to "learn more about ..." (e.g. "learn more about content safety"). + REM Fix type annotations by replacing "_types.Filters" with proper union type to fix Pyright errors REM powershell -Command "(Get-Content azure\ai\projects\models\_models.py) -replace '\"_types\.Filters\"', 'Union[\"_models.ComparisonFilter\", \"_models.CompoundFilter\"]' | Set-Content azure\ai\projects\models\_models.py" From a06aba304d3310e5a6d314cdfa7a8a81cc2ae52e Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 4 Feb 2026 11:11:11 -0800 Subject: [PATCH 18/22] Fix typos --- .../azure-ai-projects/azure/ai/projects/models/_models.py | 2 +- sdk/ai/azure-ai-projects/post-emitter-fixes.cmd | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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 b37ead83dcef..595db35e77e6 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 @@ -13507,7 +13507,7 @@ class Response(_Model): """This field is being replaced by ``safety_identifier`` and ``prompt_cache_key``. Use ``prompt_cache_key`` instead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help - OpenAI detect and prevent abuse. `Learn more about safety ididentifiers + OpenAI detect and prevent abuse. `Learn more about safety identifiers `_.""" safety_identifier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """A stable identifier used to help detect users of your application that may be violating diff --git a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd index b803dc15473a..afefafe3809b 100644 --- a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd +++ b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd @@ -24,7 +24,7 @@ powershell -Command "(Get-Content azure\ai\projects\operations\_operations.py) - REM Fix Sphinx issue (see bug on emitter: https://github.com/microsoft/typespec/issues/9579) REM Go to where class "Response" is defined. See the doc string for "output" property (two locations). Remove the blank 2nd line. -REM Fix Shpinx issue in class ToolChoiceAllowed, in "tools" property doc string. Everything shoud be aligned including JSON example, like this: +REM Fix Sphinx issue in class ToolChoiceAllowed, in "tools" property doc string. Everything should be aligned including JSON example, like this: REM """A list of tool definitions that the model should be allowed to call. For the Responses API, the REM list of tool definitions might look like: REM .. code-block:: json @@ -34,9 +34,9 @@ REM { \"type\": \"mcp\", \"server_label\": \"deepwiki\" }, REM { \"type\": \"image_generation\" } REM ]. Required.""" -REM Fix Shipnx issue: docstring of azure.ai.projects.models.WorkflowPreviewActionOutputItem.type:2: WARNING: Duplicate explicit target name: "learn more". [docutils] +REM Fix Sphinx issue: docstring of azure.ai.projects.models.WorkflowPreviewActionOutputItem.type:2: WARNING: Duplicate explicit target name: "learn more". [docutils] REM Turns out this has nothing to do with doc string of class WorkflowPreviewActionOutputItem. Search for "learn more" -REM and chage them to "learn more about ..." (e.g. "learn more about content safety"). +REM and change them to "learn more about ..." (e.g. "learn more about content safety"). REM Fix type annotations by replacing "_types.Filters" with proper union type to fix Pyright errors REM powershell -Command "(Get-Content azure\ai\projects\models\_models.py) -replace '\"_types\.Filters\"', 'Union[\"_models.ComparisonFilter\", \"_models.CompoundFilter\"]' | Set-Content azure\ai\projects\models\_models.py" From c48087ca3e062325cf2751508f52c838fae0a6ee Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 4 Feb 2026 11:34:13 -0800 Subject: [PATCH 19/22] Disable all tests --- .../telemetry/test_ai_agents_instrumentor.py | 3 +++ .../test_ai_agents_instrumentor_async.py | 3 +++ .../telemetry/test_ai_instrumentor_base.py | 3 +++ .../telemetry/test_responses_instrumentor.py | 3 +++ .../test_responses_instrumentor_async.py | 3 +++ ...sponses_instrumentor_browser_automation.py | 3 +++ ...s_instrumentor_browser_automation_async.py | 3 +++ ...responses_instrumentor_code_interpreter.py | 3 +++ ...ses_instrumentor_code_interpreter_async.py | 3 +++ ...test_responses_instrumentor_file_search.py | 3 +++ ...esponses_instrumentor_file_search_async.py | 3 +++ .../test_responses_instrumentor_mcp.py | 3 +++ .../test_responses_instrumentor_mcp_async.py | 3 +++ .../test_responses_instrumentor_metrics.py | 3 +++ .../test_responses_instrumentor_workflow.py | 3 +++ ...t_responses_instrumentor_workflow_async.py | 3 +++ .../tests/agents/test_agent_responses_crud.py | 4 +++ .../agents/test_agent_responses_crud_async.py | 4 +++ .../tests/agents/test_agents_crud.py | 4 +++ .../tests/agents/test_agents_crud_async.py | 4 +++ .../tests/agents/test_container_app_agents.py | 3 +++ .../agents/test_container_app_agents_async.py | 3 +++ .../tests/agents/test_conversation_crud.py | 4 +++ .../agents/test_conversation_crud_async.py | 4 +++ .../agents/test_conversation_items_crud.py | 4 +++ .../test_conversation_items_crud_async.py | 4 +++ .../tests/agents/test_hosted_agents.py | 26 ++----------------- ...est_agent_code_interpreter_and_function.py | 5 ++++ ..._agent_file_search_and_code_interpreter.py | 5 ++++ .../test_agent_file_search_and_function.py | 5 ++++ ...t_file_search_code_interpreter_function.py | 5 ++++ .../test_multitool_with_conversations.py | 5 ++++ .../agents/tools/test_agent_ai_search.py | 3 +++ .../tools/test_agent_ai_search_async.py | 3 +++ .../agents/tools/test_agent_bing_grounding.py | 3 +++ .../tools/test_agent_code_interpreter.py | 3 +++ .../test_agent_code_interpreter_async.py | 4 +++ .../agents/tools/test_agent_file_search.py | 3 +++ .../tools/test_agent_file_search_async.py | 4 +++ .../tools/test_agent_file_search_stream.py | 4 +++ .../test_agent_file_search_stream_async.py | 4 +++ .../agents/tools/test_agent_function_tool.py | 4 +++ .../tools/test_agent_function_tool_async.py | 4 +++ .../tools/test_agent_image_generation.py | 3 +++ .../test_agent_image_generation_async.py | 3 +++ .../tests/agents/tools/test_agent_mcp.py | 3 +++ .../agents/tools/test_agent_mcp_async.py | 4 +++ .../agents/tools/test_agent_memory_search.py | 4 +++ .../tools/test_agent_memory_search_async.py | 4 +++ .../tests/agents/tools/test_agent_openapi.py | 3 +++ .../agents/tools/test_agent_openapi_async.py | 3 +++ .../test_agent_tools_with_conversations.py | 4 +++ .../agents/tools/test_agent_web_search.py | 4 +++ .../tools/test_agent_web_search_async.py | 4 +++ .../tests/connections/test_connections.py | 4 +++ .../connections/test_connections_async.py | 4 +++ .../tests/datasets/test_datasets.py | 3 +++ .../tests/datasets/test_datasets_async.py | 3 +++ .../tests/deployments/test_deployments.py | 4 +++ .../deployments/test_deployments_async.py | 4 +++ .../tests/files/test_files.py | 3 +++ .../tests/files/test_files_async.py | 3 +++ .../tests/finetuning/test_finetuning.py | 3 +++ .../tests/finetuning/test_finetuning_async.py | 3 +++ .../tests/indexes/test_indexes.py | 4 +++ .../tests/indexes/test_indexes_async.py | 4 +++ .../tests/redteams/test_redteams.py | 4 +++ .../tests/redteams/test_redteams_async.py | 4 +++ .../tests/responses/test_responses.py | 3 +++ .../tests/responses/test_responses_async.py | 3 +++ .../tests/samples/test_samples.py | 3 +++ .../tests/samples/test_samples_async.py | 3 +++ .../tests/samples/test_samples_evaluations.py | 3 +++ .../tests/telemetry/test_telemetry.py | 3 +++ .../tests/telemetry/test_telemetry_async.py | 3 +++ 75 files changed, 262 insertions(+), 24 deletions(-) diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor.py index 8a28ad4c797a..4eeafe276bad 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor.py @@ -60,6 +60,9 @@ _utils._span_impl_type = settings.tracing_implementation() +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAiAgentsInstrumentor(TestAiAgentsInstrumentorBase): """Tests for AI agents instrumentor.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor_async.py index cb45d12c36bf..3f7ed1f71733 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor_async.py @@ -57,6 +57,9 @@ _utils._span_impl_type = settings.tracing_implementation() +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAiAgentsInstrumentor(TestAiAgentsInstrumentorBase): """Tests for AI agents instrumentor.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_instrumentor_base.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_instrumentor_base.py index 55dff7d9a421..8e9e580de5e5 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_instrumentor_base.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_instrumentor_base.py @@ -31,6 +31,9 @@ class MessageCreationMode(IntEnum): ) +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAiAgentsInstrumentorBase(TestBase): """The utility methods, used by AI Instrumentor test.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py index 8bf3b5077780..6c346dd0b15d 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor.py @@ -45,6 +45,9 @@ ) +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestResponsesInstrumentor(TestAiAgentsInstrumentorBase): """Tests for ResponsesInstrumentor with real endpoints.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py index 171ac7cc53dc..ec0144d4076b 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_async.py @@ -29,6 +29,9 @@ _utils._span_impl_type = settings.tracing_implementation() +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestResponsesInstrumentor(TestAiAgentsInstrumentorBase): """Tests for ResponsesInstrumentor with real endpoints (async).""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_browser_automation.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_browser_automation.py index 5dbcb4566c87..5b2e42f6e4cf 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_browser_automation.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_browser_automation.py @@ -25,6 +25,9 @@ _utils._span_impl_type = settings.tracing_implementation() +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestResponsesInstrumentorBrowserAutomation(TestAiAgentsInstrumentorBase): """Tests for ResponsesInstrumentor with browser automation agents.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_browser_automation_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_browser_automation_async.py index 0631495ff0b2..b93191b788c4 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_browser_automation_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_browser_automation_async.py @@ -28,6 +28,9 @@ _utils._span_impl_type = settings.tracing_implementation() +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestResponsesInstrumentorBrowserAutomationAsync(TestAiAgentsInstrumentorBase): """Async tests for ResponsesInstrumentor with browser automation agents.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter.py index 13b0d8342186..a7e40a3bda2c 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter.py @@ -30,6 +30,9 @@ _utils._span_impl_type = settings.tracing_implementation() +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestResponsesInstrumentorCodeInterpreter(TestAiAgentsInstrumentorBase): """ Test suite for Code Interpreter agent telemetry instrumentation. diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter_async.py index 5f2eb03e3fbe..3bcac75046cc 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_code_interpreter_async.py @@ -31,6 +31,9 @@ _utils._span_impl_type = settings.tracing_implementation() +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestResponsesInstrumentorCodeInterpreterAsync(TestAiAgentsInstrumentorBase): """ Test suite for Code Interpreter agent telemetry instrumentation (async). diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search.py index 92902d6fa908..1430341a4ba0 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search.py @@ -26,6 +26,9 @@ _utils._span_impl_type = settings.tracing_implementation() +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestResponsesInstrumentorFileSearch(TestAiAgentsInstrumentorBase): """Tests for ResponsesInstrumentor with File Search tool.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search_async.py index f215ee1072f2..da2dfd58a6ff 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_file_search_async.py @@ -27,6 +27,9 @@ _utils._span_impl_type = settings.tracing_implementation() +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestResponsesInstrumentorFileSearchAsync(TestAiAgentsInstrumentorBase): """Async tests for ResponsesInstrumentor with File Search tool.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py index 9152d4b244f2..fdf3378643de 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py @@ -26,6 +26,9 @@ _utils._span_impl_type = settings.tracing_implementation() +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestResponsesInstrumentorMCP(TestAiAgentsInstrumentorBase): """Tests for ResponsesInstrumentor with MCP agents.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py index c0fd327890da..5d5dfa2caa81 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py @@ -27,6 +27,9 @@ _utils._span_impl_type = settings.tracing_implementation() +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestResponsesInstrumentorMCPAsync(TestAiAgentsInstrumentorBase): """Async tests for ResponsesInstrumentor with MCP agents.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_metrics.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_metrics.py index a198327679c3..4a285d42482b 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_metrics.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_metrics.py @@ -29,6 +29,9 @@ metrics.set_meter_provider(global_meter_provider) +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestResponsesInstrumentorMetrics(TestAiAgentsInstrumentorBase): """Tests for ResponsesInstrumentor metrics functionality with real endpoints.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_workflow.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_workflow.py index 24f9e62148c6..c495aee2cc04 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_workflow.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_workflow.py @@ -100,6 +100,9 @@ def checkInputMessageEventContents(content, content_recording_enabled): assert found_text, "No text part found in input message event" +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestResponsesInstrumentorWorkflow(TestAiAgentsInstrumentorBase): """Tests for ResponsesInstrumentor with workflow agents.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_workflow_async.py b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_workflow_async.py index 4bc87460f417..a65073b3d5e6 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_workflow_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_workflow_async.py @@ -99,6 +99,9 @@ def checkInputMessageEventContents(content, content_recording_enabled): assert found_text, "No text part found in input message event" +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestResponsesInstrumentorWorkflowAsync(TestAiAgentsInstrumentorBase): """Async tests for ResponsesInstrumentor with workflow agents.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_agent_responses_crud.py b/sdk/ai/azure-ai-projects/tests/agents/test_agent_responses_crud.py index db20f9024ed2..86181e89fb3f 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_agent_responses_crud.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_agent_responses_crud.py @@ -13,8 +13,12 @@ TextResponseFormatJsonSchema, PromptAgentDefinitionTextOptions, ) +import pytest +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentResponsesCrud(TestBase): # To run this test: diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_agent_responses_crud_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_agent_responses_crud_async.py index 7c5065752924..a3afe9655014 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_agent_responses_crud_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_agent_responses_crud_async.py @@ -14,8 +14,12 @@ TextResponseFormatJsonSchema, PromptAgentDefinitionTextOptions, ) +import pytest +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentResponsesCrudAsync(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_agents_crud.py b/sdk/ai/azure-ai-projects/tests/agents/test_agents_crud.py index 56f87bc64d01..d2d0714275d0 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_agents_crud.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_agents_crud.py @@ -9,8 +9,12 @@ from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy from azure.ai.projects.models import PromptAgentDefinition, AgentDetails, AgentVersionDetails +import pytest +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentCrud(TestBase): # To run this test: diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_agents_crud_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_agents_crud_async.py index bd03ed0299ab..3f2679f6eba0 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_agents_crud_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_agents_crud_async.py @@ -9,8 +9,12 @@ from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from azure.ai.projects.models import PromptAgentDefinition, AgentDetails, AgentVersionDetails +import pytest +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentCrudAsync(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_container_app_agents.py b/sdk/ai/azure-ai-projects/tests/agents/test_container_app_agents.py index 1b304d401dd1..10128cbeb8bb 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_container_app_agents.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_container_app_agents.py @@ -14,6 +14,9 @@ from azure.ai.projects.models import AgentReference, ContainerAppAgentDefinition, ProtocolVersionRecord, AgentProtocol +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestContainerAppAgents(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_container_app_agents_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_container_app_agents_async.py index 27a163db1757..a82d5df23a65 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_container_app_agents_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_container_app_agents_async.py @@ -14,6 +14,9 @@ from azure.ai.projects.models import AgentReference, ContainerAppAgentDefinition, ProtocolVersionRecord, AgentProtocol +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestContainerAppAgentsAsync(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_conversation_crud.py b/sdk/ai/azure-ai-projects/tests/agents/test_conversation_crud.py index 636d1a012e51..83a6cc0dcc69 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_conversation_crud.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_conversation_crud.py @@ -7,11 +7,15 @@ from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport +import pytest # from azure.ai.projects.models import ResponsesUserMessageItemParam, ItemContentInputText # TODO: Emitter did not produce the output class OpenAI.ConversationResource. Validating service response as Dict for now. +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestConversationCrud(TestBase): # To run only this test: diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_conversation_crud_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_conversation_crud_async.py index 9905b34b5c16..29520fabc727 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_conversation_crud_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_conversation_crud_async.py @@ -8,10 +8,14 @@ from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport +import pytest # from azure.ai.projects.models import ResponsesUserMessageItemParam, ItemContentInputText +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestConversationCrudAsync(TestBase): # To run only this test: diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_conversation_items_crud.py b/sdk/ai/azure-ai-projects/tests/agents/test_conversation_items_crud.py index 95aff3fac063..c510b7210ce2 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_conversation_items_crud.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_conversation_items_crud.py @@ -7,8 +7,12 @@ from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport +import pytest +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestConversationItemsCrud(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_conversation_items_crud_async.py b/sdk/ai/azure-ai-projects/tests/agents/test_conversation_items_crud_async.py index f6b0379aeab8..703154357d1a 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_conversation_items_crud_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_conversation_items_crud_async.py @@ -8,8 +8,12 @@ from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport +import pytest +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestConversationItemsCrudAsync(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/test_hosted_agents.py b/sdk/ai/azure-ai-projects/tests/agents/test_hosted_agents.py index 9959c9df10fd..029f57ee4250 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/test_hosted_agents.py +++ b/sdk/ai/azure-ai-projects/tests/agents/test_hosted_agents.py @@ -6,39 +6,17 @@ # cSpell:disable from test_base import TestBase # , servicePreparer +import pytest # from devtools_testutils import recorded_by_proxy # from azure.ai.projects.models import AgentReference, PromptAgentDefinition +@pytest.mark.skip(reason="Not yet implemented") class TestHostedAgents(TestBase): # @servicePreparer() # @recorded_by_proxy def test_hosted_agent(self, **kwargs): - """ - Test Hosted Agents and all container operations. - - Routes used in this test: - - Action REST API Route Client Method - ------+---------------------------------------------------------------------------+----------------------------------- - - # Setup: - - # Test focus: - GET /agents/{agent_name}/operations list_container_operations - GET /agents/{agent_name}/operations/{operation_id} retrieve_container_operation - GET /agents/{agent_name}/versions/{agent_version}/containers/default retrieve_container - GET /agents/{agent_name}/versions/{agent_version}/containers/default/operations list_version_container_operations - POST /agents/{agent_name}/versions/{agent_version}/containers/default:start start_container - POST /agents/{agent_name}/versions/{agent_version}/containers/default:stop stop_container - POST /agents/{agent_name}/versions/{agent_version}/containers/default:update update_container - POST /agents/{agent_name}/versions/{agent_version}/containers/default:delete delete_container - - # Teardown: - - """ - # TODO: Add tests! pass diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_code_interpreter_and_function.py b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_code_interpreter_and_function.py index 2601424c4a1b..58d0163f3e14 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_code_interpreter_and_function.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_code_interpreter_and_function.py @@ -5,6 +5,8 @@ # ------------------------------------ # cSpell:disable +import pytest + """ Multi-Tool Tests: Code Interpreter + Function Tool @@ -24,6 +26,9 @@ from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentCodeInterpreterAndFunction(TestBase): """Tests for agents using Code Interpreter + Function Tool combination.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_code_interpreter.py b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_code_interpreter.py index a60340a6571b..b5c1ada0057f 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_code_interpreter.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_code_interpreter.py @@ -5,6 +5,8 @@ # ------------------------------------ # cSpell:disable +import pytest + """ Multi-Tool Tests: File Search + Code Interpreter @@ -23,6 +25,9 @@ ) +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentFileSearchAndCodeInterpreter(TestBase): """Tests for agents using File Search + Code Interpreter combination.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_function.py b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_function.py index 6bf4a5e9a5a9..fb7f74c537e9 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_function.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_function.py @@ -5,6 +5,8 @@ # ------------------------------------ # cSpell:disable +import pytest + """ Multi-Tool Tests: File Search + Function Tool @@ -20,6 +22,9 @@ from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentFileSearchAndFunction(TestBase): """Tests for agents using File Search + Function Tool combination.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_code_interpreter_function.py b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_code_interpreter_function.py index 1b4bd4462be5..29d7caa9b412 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_code_interpreter_function.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_code_interpreter_function.py @@ -5,6 +5,8 @@ # ------------------------------------ # cSpell:disable +import pytest + """ Multi-Tool Tests: File Search + Code Interpreter + Function Tool @@ -26,6 +28,9 @@ from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentFileSearchCodeInterpreterFunction(TestBase): """Tests for agents using File Search + Code Interpreter + Function Tool.""" diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_multitool_with_conversations.py b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_multitool_with_conversations.py index 607acbb678ad..51b1d9426348 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_multitool_with_conversations.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_multitool_with_conversations.py @@ -3,6 +3,8 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest + """ Test agents using multiple tools within conversations. @@ -22,6 +24,9 @@ from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestMultiToolWithConversations(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_ai_search.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_ai_search.py index 0668d960b8ad..d97bc133306d 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_ai_search.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_ai_search.py @@ -20,6 +20,9 @@ # https://arxiv.org/pdf/2508.03680 +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentAISearch(TestBase): # Test questions with expected answers diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_ai_search_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_ai_search_async.py index a6f25b30a756..92fda91873c0 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_ai_search_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_ai_search_async.py @@ -21,6 +21,9 @@ # https://arxiv.org/pdf/2508.03680 +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentAISearchAsync(TestBase): # Test questions with expected answers diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_bing_grounding.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_bing_grounding.py index 9881a1a4a6d0..9cf4076a9be9 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_bing_grounding.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_bing_grounding.py @@ -16,6 +16,9 @@ ) +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentBingGrounding(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter.py index 13337934bfd4..696ac9f4c373 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter.py @@ -16,6 +16,9 @@ ) +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentCodeInterpreter(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter_async.py index 6932f282830b..a4ca2f8837af 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter_async.py @@ -5,6 +5,7 @@ # ------------------------------------ # cSpell:disable +import pytest from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport @@ -15,6 +16,9 @@ ) +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentCodeInterpreterAsync(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search.py index d3b56c75e710..59c074f565a4 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search.py @@ -13,6 +13,9 @@ from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentFileSearch(TestBase): # To only run this test: diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_async.py index e249222339f7..ae30e7e037a3 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_async.py @@ -6,6 +6,7 @@ # cSpell:disable import os +import pytest from io import BytesIO from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -13,6 +14,9 @@ from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentFileSearchAsync(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream.py index 6ebbf719a9a4..c0ed973ef2c2 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream.py @@ -6,11 +6,15 @@ # cSpell:disable import os +import pytest from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentFileSearchStream(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream_async.py index afa42b523b70..e668ef5474f9 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_file_search_stream_async.py @@ -6,12 +6,16 @@ # cSpell:disable import os +import pytest from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentFileSearchStreamAsync(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool.py index a4a4ced9ee1f..8b215d7560fe 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool.py @@ -6,12 +6,16 @@ # cSpell:disable import json +import pytest from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport from azure.ai.projects.models import PromptAgentDefinition, FunctionTool from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentFunctionTool(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool_async.py index 5102005b2656..eb0600fc4c4a 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_function_tool_async.py @@ -6,6 +6,7 @@ # cSpell:disable import json +import pytest from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport @@ -13,6 +14,9 @@ from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentFunctionToolAsync(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation.py index 6d5ae36d069e..d34c6e497238 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation.py @@ -14,6 +14,9 @@ from azure.core.exceptions import ResourceNotFoundError +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentImageGeneration(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation_async.py index ab31ff0cc827..16529f228f65 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_image_generation_async.py @@ -15,6 +15,9 @@ from azure.core.exceptions import ResourceNotFoundError +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentImageGenerationAsync(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp.py index d202c31aa34e..bb3d9a306907 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp.py @@ -13,6 +13,9 @@ from openai.types.responses.response_input_param import McpApprovalResponse, ResponseInputParam +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentMCP(TestBase): # To run only this test: diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp_async.py index adc9bbde3419..8ac7732e4978 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_mcp_async.py @@ -5,6 +5,7 @@ # ------------------------------------ # cSpell:disable +import pytest from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport @@ -12,6 +13,9 @@ from openai.types.responses.response_input_param import McpApprovalResponse, ResponseInputParam +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentMCPAsync(TestBase): # To run only this test: diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search.py index d90fb88a9757..dce1f809d4e1 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search.py @@ -5,6 +5,7 @@ # ------------------------------------ # cSpell:disable +import pytest import time from typing import Final from test_base import TestBase, servicePreparer @@ -19,6 +20,9 @@ ) +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentMemorySearch(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search_async.py index aa904ccbdf5e..fd9e06519f15 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_memory_search_async.py @@ -6,6 +6,7 @@ # cSpell:disable import asyncio +import pytest from typing import Final from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -20,6 +21,9 @@ ) +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentMemorySearchAsync(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_openapi.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_openapi.py index 4a862ff31b5a..b9c3f1b289a1 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_openapi.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_openapi.py @@ -19,6 +19,9 @@ ) +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentOpenApi(TestBase): # To run this test: diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_openapi_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_openapi_async.py index d56ea15d7c52..5934f77faa4b 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_openapi_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_openapi_async.py @@ -20,6 +20,9 @@ ) +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentOpenApiAsync(TestBase): # To run this test: diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_tools_with_conversations.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_tools_with_conversations.py index 636e85370bb4..c15e0ced6dc1 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_tools_with_conversations.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_tools_with_conversations.py @@ -12,6 +12,7 @@ """ import json +import pytest from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport from azure.ai.projects.models import ( @@ -24,6 +25,9 @@ from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentToolsWithConversations(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search.py index b93038521e1d..501da235ece3 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search.py @@ -5,11 +5,15 @@ # ------------------------------------ # cSpell:disable +import pytest from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport from azure.ai.projects.models import PromptAgentDefinition, WebSearchPreviewTool, ApproximateLocation +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentWebSearch(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search_async.py index 5c7c0ff5b46b..99b0bdbfda1b 100644 --- a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search_async.py +++ b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_web_search_async.py @@ -5,12 +5,16 @@ # ------------------------------------ # cSpell:disable +import pytest from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils import RecordedTransport from azure.ai.projects.models import PromptAgentDefinition, WebSearchPreviewTool, ApproximateLocation +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestAgentWebSearchAsync(TestBase): @servicePreparer() diff --git a/sdk/ai/azure-ai-projects/tests/connections/test_connections.py b/sdk/ai/azure-ai-projects/tests/connections/test_connections.py index 968fe4d7a503..f916f2d1b94f 100644 --- a/sdk/ai/azure-ai-projects/tests/connections/test_connections.py +++ b/sdk/ai/azure-ai-projects/tests/connections/test_connections.py @@ -3,10 +3,14 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestConnections(TestBase): # To run this test, use the following command in the \sdk\ai\azure-ai-projects folder: diff --git a/sdk/ai/azure-ai-projects/tests/connections/test_connections_async.py b/sdk/ai/azure-ai-projects/tests/connections/test_connections_async.py index b98cdacad711..12fce861fb5d 100644 --- a/sdk/ai/azure-ai-projects/tests/connections/test_connections_async.py +++ b/sdk/ai/azure-ai-projects/tests/connections/test_connections_async.py @@ -3,11 +3,15 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest from azure.ai.projects.aio import AIProjectClient from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestConnectionsAsync(TestBase): # To run this test, use the following command in the \sdk\ai\azure-ai-projects folder: diff --git a/sdk/ai/azure-ai-projects/tests/datasets/test_datasets.py b/sdk/ai/azure-ai-projects/tests/datasets/test_datasets.py index ea816d596fc9..a64874ec090f 100644 --- a/sdk/ai/azure-ai-projects/tests/datasets/test_datasets.py +++ b/sdk/ai/azure-ai-projects/tests/datasets/test_datasets.py @@ -20,6 +20,9 @@ data_file2 = os.path.join(data_folder, "data_file2.txt") +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestDatasets(TestBase): # To run this test, use the following command in the \sdk\ai\azure-ai-projects folder: diff --git a/sdk/ai/azure-ai-projects/tests/datasets/test_datasets_async.py b/sdk/ai/azure-ai-projects/tests/datasets/test_datasets_async.py index 6400df3c369d..3aafccd1f837 100644 --- a/sdk/ai/azure-ai-projects/tests/datasets/test_datasets_async.py +++ b/sdk/ai/azure-ai-projects/tests/datasets/test_datasets_async.py @@ -21,6 +21,9 @@ data_file2 = os.path.join(data_folder, "data_file2.txt") +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestDatasetsAsync(TestBase): # To run this test, use the following command in the \sdk\ai\azure-ai-projects folder: diff --git a/sdk/ai/azure-ai-projects/tests/deployments/test_deployments.py b/sdk/ai/azure-ai-projects/tests/deployments/test_deployments.py index 8bc90ee53a4c..549e91e220b9 100644 --- a/sdk/ai/azure-ai-projects/tests/deployments/test_deployments.py +++ b/sdk/ai/azure-ai-projects/tests/deployments/test_deployments.py @@ -3,11 +3,15 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest from azure.ai.projects import AIProjectClient from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestDeployments(TestBase): # To run this test, use the following command in the \sdk\ai\azure-ai-projects folder: diff --git a/sdk/ai/azure-ai-projects/tests/deployments/test_deployments_async.py b/sdk/ai/azure-ai-projects/tests/deployments/test_deployments_async.py index 92549800faa2..54bea9b8d3cf 100644 --- a/sdk/ai/azure-ai-projects/tests/deployments/test_deployments_async.py +++ b/sdk/ai/azure-ai-projects/tests/deployments/test_deployments_async.py @@ -3,11 +3,15 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest from azure.ai.projects.aio import AIProjectClient from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestDeploymentsAsync(TestBase): # To run this test, use the following command in the \sdk\ai\azure-ai-projects folder: diff --git a/sdk/ai/azure-ai-projects/tests/files/test_files.py b/sdk/ai/azure-ai-projects/tests/files/test_files.py index f934ce955547..27661719fa00 100644 --- a/sdk/ai/azure-ai-projects/tests/files/test_files.py +++ b/sdk/ai/azure-ai-projects/tests/files/test_files.py @@ -10,6 +10,9 @@ from devtools_testutils import recorded_by_proxy, RecordedTransport +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestFiles(TestBase): # To run this test, use the following command in the \sdk\ai\azure-ai-projects folder: diff --git a/sdk/ai/azure-ai-projects/tests/files/test_files_async.py b/sdk/ai/azure-ai-projects/tests/files/test_files_async.py index cc85b778e1a5..f9fe2f7acb59 100644 --- a/sdk/ai/azure-ai-projects/tests/files/test_files_async.py +++ b/sdk/ai/azure-ai-projects/tests/files/test_files_async.py @@ -11,6 +11,9 @@ from devtools_testutils import RecordedTransport +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestFilesAsync(TestBase): # To run this test, use the following command in the \sdk\ai\azure-ai-projects folder: diff --git a/sdk/ai/azure-ai-projects/tests/finetuning/test_finetuning.py b/sdk/ai/azure-ai-projects/tests/finetuning/test_finetuning.py index 88dfd1c265b4..81aedda61ddb 100644 --- a/sdk/ai/azure-ai-projects/tests/finetuning/test_finetuning.py +++ b/sdk/ai/azure-ai-projects/tests/finetuning/test_finetuning.py @@ -23,6 +23,9 @@ from azure.mgmt.cognitiveservices.models import Deployment, DeploymentProperties, DeploymentModel, Sku +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestFineTuning(TestBase): def _create_sft_finetuning_job(self, openai_client, train_file_id, validation_file_id, training_type, model_type): diff --git a/sdk/ai/azure-ai-projects/tests/finetuning/test_finetuning_async.py b/sdk/ai/azure-ai-projects/tests/finetuning/test_finetuning_async.py index b609c15eaf2a..ae591c1dfab9 100644 --- a/sdk/ai/azure-ai-projects/tests/finetuning/test_finetuning_async.py +++ b/sdk/ai/azure-ai-projects/tests/finetuning/test_finetuning_async.py @@ -24,6 +24,9 @@ from azure.mgmt.cognitiveservices.models import Deployment, DeploymentProperties, DeploymentModel, Sku +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestFineTuningAsync(TestBase): async def _create_sft_finetuning_job_async( diff --git a/sdk/ai/azure-ai-projects/tests/indexes/test_indexes.py b/sdk/ai/azure-ai-projects/tests/indexes/test_indexes.py index eb22ca9ff27b..1210c6142926 100644 --- a/sdk/ai/azure-ai-projects/tests/indexes/test_indexes.py +++ b/sdk/ai/azure-ai-projects/tests/indexes/test_indexes.py @@ -4,12 +4,16 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest from azure.ai.projects import AIProjectClient from azure.ai.projects.models import AzureAISearchIndex, IndexType from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestIndexes(TestBase): # To run this test, use the following command in the \sdk\ai\azure-ai-projects folder: diff --git a/sdk/ai/azure-ai-projects/tests/indexes/test_indexes_async.py b/sdk/ai/azure-ai-projects/tests/indexes/test_indexes_async.py index eb88e0d9a915..70b7b73fb3b3 100644 --- a/sdk/ai/azure-ai-projects/tests/indexes/test_indexes_async.py +++ b/sdk/ai/azure-ai-projects/tests/indexes/test_indexes_async.py @@ -4,12 +4,16 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import AzureAISearchIndex, IndexType from test_base import TestBase, servicePreparer from devtools_testutils.aio import recorded_by_proxy_async +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestIndexesAsync(TestBase): # To run this test, use the following command in the \sdk\ai\azure-ai-projects folder: diff --git a/sdk/ai/azure-ai-projects/tests/redteams/test_redteams.py b/sdk/ai/azure-ai-projects/tests/redteams/test_redteams.py index 2aefc6cef437..eca364b4997c 100644 --- a/sdk/ai/azure-ai-projects/tests/redteams/test_redteams.py +++ b/sdk/ai/azure-ai-projects/tests/redteams/test_redteams.py @@ -3,6 +3,7 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( RedTeam, @@ -14,6 +15,9 @@ from devtools_testutils import recorded_by_proxy +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestRedTeams(TestBase): # To run this test, use the following command in the \sdk\ai\azure-ai-projects folder: diff --git a/sdk/ai/azure-ai-projects/tests/redteams/test_redteams_async.py b/sdk/ai/azure-ai-projects/tests/redteams/test_redteams_async.py index d6809d2d785b..87b1ee306f4f 100644 --- a/sdk/ai/azure-ai-projects/tests/redteams/test_redteams_async.py +++ b/sdk/ai/azure-ai-projects/tests/redteams/test_redteams_async.py @@ -3,6 +3,7 @@ # Licensed under the MIT License. # ------------------------------------ +import pytest from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( RedTeam, @@ -14,6 +15,9 @@ from devtools_testutils.aio import recorded_by_proxy_async +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestRedTeams(TestBase): # To run this test, use the following command in the \sdk\ai\azure-ai-projects folder: diff --git a/sdk/ai/azure-ai-projects/tests/responses/test_responses.py b/sdk/ai/azure-ai-projects/tests/responses/test_responses.py index a41d3d7505d6..2bb341e198e5 100644 --- a/sdk/ai/azure-ai-projects/tests/responses/test_responses.py +++ b/sdk/ai/azure-ai-projects/tests/responses/test_responses.py @@ -41,6 +41,9 @@ def _build_client( return project_client.get_openai_client(**kwargs) +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestResponses(TestBase): # To run this test: diff --git a/sdk/ai/azure-ai-projects/tests/responses/test_responses_async.py b/sdk/ai/azure-ai-projects/tests/responses/test_responses_async.py index bf7252962dad..8ef5442b95ab 100644 --- a/sdk/ai/azure-ai-projects/tests/responses/test_responses_async.py +++ b/sdk/ai/azure-ai-projects/tests/responses/test_responses_async.py @@ -37,6 +37,9 @@ def _build_client( return project_client.get_openai_client(**kwargs) +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestResponsesAsync(TestBase): # To run this test: 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 5225fe5d9251..52fc5ae46a37 100644 --- a/sdk/ai/azure-ai-projects/tests/samples/test_samples.py +++ b/sdk/ai/azure-ai-projects/tests/samples/test_samples.py @@ -16,6 +16,9 @@ from test_samples_helpers import agent_tools_instructions, get_sample_environment_variables_map +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestSamples(AzureRecordedTestCase): # To run this test with a specific sample, use: 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 61e8fe907ea6..69b5b2cbd45b 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 @@ -15,6 +15,9 @@ from test_samples_helpers import agent_tools_instructions, get_sample_environment_variables_map +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestSamplesAsync(AzureRecordedTestCase): """Async test cases for samples.""" diff --git a/sdk/ai/azure-ai-projects/tests/samples/test_samples_evaluations.py b/sdk/ai/azure-ai-projects/tests/samples/test_samples_evaluations.py index d3370ffebb19..09dcdd61e73c 100644 --- a/sdk/ai/azure-ai-projects/tests/samples/test_samples_evaluations.py +++ b/sdk/ai/azure-ai-projects/tests/samples/test_samples_evaluations.py @@ -41,6 +41,9 @@ Always respond with `reason` indicating the reason for the response.""" +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestSamplesEvaluations(AzureRecordedTestCase): """ Tests for evaluation samples. diff --git a/sdk/ai/azure-ai-projects/tests/telemetry/test_telemetry.py b/sdk/ai/azure-ai-projects/tests/telemetry/test_telemetry.py index 9ade1692ae0a..6e74aafa4016 100644 --- a/sdk/ai/azure-ai-projects/tests/telemetry/test_telemetry.py +++ b/sdk/ai/azure-ai-projects/tests/telemetry/test_telemetry.py @@ -9,6 +9,9 @@ from devtools_testutils import recorded_by_proxy, is_live +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestTelemetry(TestBase): # To run this test, use the following command in the \sdk\ai\azure-ai-projects folder: diff --git a/sdk/ai/azure-ai-projects/tests/telemetry/test_telemetry_async.py b/sdk/ai/azure-ai-projects/tests/telemetry/test_telemetry_async.py index d0aee2d61e4b..1273bf410413 100644 --- a/sdk/ai/azure-ai-projects/tests/telemetry/test_telemetry_async.py +++ b/sdk/ai/azure-ai-projects/tests/telemetry/test_telemetry_async.py @@ -10,6 +10,9 @@ from devtools_testutils import is_live +@pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" +) class TestTelemetryAsync(TestBase): # To run this test, use the following command in the \sdk\ai\azure-ai-projects folder: From a9eb01c8ab65bcecac1bd71626ba2f730b598353 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 4 Feb 2026 11:47:14 -0800 Subject: [PATCH 20/22] Re-enable a few tests that don't use network traffic --- sdk/ai/azure-ai-projects/tests/responses/test_responses.py | 7 +++---- .../tests/responses/test_responses_async.py | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/sdk/ai/azure-ai-projects/tests/responses/test_responses.py b/sdk/ai/azure-ai-projects/tests/responses/test_responses.py index 2bb341e198e5..ac63d300ba1e 100644 --- a/sdk/ai/azure-ai-projects/tests/responses/test_responses.py +++ b/sdk/ai/azure-ai-projects/tests/responses/test_responses.py @@ -40,14 +40,13 @@ def _build_client( kwargs: Dict[str, Any] = {"default_headers": default_headers} return project_client.get_openai_client(**kwargs) - -@pytest.mark.skip( - reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" -) class TestResponses(TestBase): # To run this test: # pytest tests\responses\test_responses.py::TestResponses::test_responses -s + @pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" + ) @servicePreparer() @recorded_by_proxy(RecordedTransport.HTTPX) def test_responses(self, **kwargs): diff --git a/sdk/ai/azure-ai-projects/tests/responses/test_responses_async.py b/sdk/ai/azure-ai-projects/tests/responses/test_responses_async.py index 8ef5442b95ab..2bfbaa92926b 100644 --- a/sdk/ai/azure-ai-projects/tests/responses/test_responses_async.py +++ b/sdk/ai/azure-ai-projects/tests/responses/test_responses_async.py @@ -37,13 +37,13 @@ def _build_client( return project_client.get_openai_client(**kwargs) -@pytest.mark.skip( - reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" -) class TestResponsesAsync(TestBase): # To run this test: # pytest tests\responses\test_responses_async.py::TestResponsesAsync::test_responses_async -s + @pytest.mark.skip( + reason="Skipped until re-enabled and recorded on Foundry endpoint that supports the new versioning schema" + ) @servicePreparer() @recorded_by_proxy_async(RecordedTransport.HTTPX) async def test_responses_async(self, **kwargs): From 04390656ad5244c2ddaa7156f41f1a4386e14ce4 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 4 Feb 2026 14:20:44 -0800 Subject: [PATCH 21/22] Re-emit --- .../azure-ai-projects/apiview-properties.json | 2 +- .../ai/projects/aio/operations/_operations.py | 463 ++++++++------- .../azure/ai/projects/models/__init__.py | 4 +- .../azure/ai/projects/models/_models.py | 120 ++-- .../ai/projects/operations/_operations.py | 526 +++++++++++------- .../tests/responses/test_responses.py | 1 + 6 files changed, 656 insertions(+), 460 deletions(-) diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index 80741d4b4756..9db3830c0636 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -408,8 +408,8 @@ "azure.ai.projects.models.WebSearchTool": "OpenAI.WebSearchTool", "azure.ai.projects.models.WebSearchToolFilters": "OpenAI.WebSearchToolFilters", "azure.ai.projects.models.WeeklyRecurrenceSchedule": "Azure.AI.Projects.WeeklyRecurrenceSchedule", + "azure.ai.projects.models.WorkflowActionOutputItem": "Azure.AI.Projects.WorkflowActionOutputItem", "azure.ai.projects.models.WorkflowAgentDefinition": "Azure.AI.Projects.WorkflowAgentDefinition", - "azure.ai.projects.models.WorkflowPreviewActionOutputItem": "Azure.AI.Projects.WorkflowPreviewActionOutputItem", "azure.ai.projects.models.AgentKind": "Azure.AI.Projects.AgentKind", "azure.ai.projects.models.AgentProtocol": "Azure.AI.Projects.AgentProtocol", "azure.ai.projects.models.ToolType": "OpenAI.ToolType", 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 eec4058bfcb6..fb3f0505e034 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 @@ -201,6 +201,7 @@ async def create( definition: _models.AgentDefinition, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -224,12 +225,13 @@ async def create( agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -255,6 +257,7 @@ async def create( *, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -268,12 +271,13 @@ async def create( :param body: Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -290,6 +294,7 @@ async def create( *, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -303,12 +308,13 @@ async def create( :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. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -327,6 +333,7 @@ async def create( definition: _models.AgentDefinition = _Unset, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -351,12 +358,13 @@ async def create( agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :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 @@ -450,6 +458,7 @@ async def update( definition: _models.AgentDefinition, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -469,12 +478,13 @@ async def update( agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -501,6 +511,7 @@ async def update( *, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -517,12 +528,13 @@ async def update( :param body: Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -540,6 +552,7 @@ async def update( *, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -556,12 +569,13 @@ async def update( :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. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -580,6 +594,7 @@ async def update( definition: _models.AgentDefinition = _Unset, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -600,12 +615,13 @@ async def update( agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :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 @@ -1238,6 +1254,7 @@ async def create_version( definition: _models.AgentDefinition, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -1261,12 +1278,13 @@ async def create_version( agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -1293,6 +1311,7 @@ async def create_version( *, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -1313,12 +1332,13 @@ async def create_version( :param body: Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -1336,6 +1356,7 @@ async def create_version( *, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -1356,12 +1377,13 @@ async def create_version( :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. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -1380,6 +1402,7 @@ async def create_version( definition: _models.AgentDefinition = _Unset, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -1404,12 +1427,13 @@ async def create_version( agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :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 @@ -1934,7 +1958,7 @@ async def stream_agent_container_logs( agent_name: str, agent_version: str, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW]]] = None, kind: Optional[Union[str, _models.ContainerLogKind]] = None, replica_name: Optional[str] = None, tail: Optional[int] = None, @@ -1971,8 +1995,10 @@ async def stream_agent_container_logs( :param agent_version: The version of the agent. Required. :type agent_version: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. CONTAINER_AGENTS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW :keyword kind: console returns container stdout/stderr, system returns container app event stream. defaults to console. Known values are: "console" and "system". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.ContainerLogKind @@ -3374,7 +3400,7 @@ async def create( name: str, body: _models.EvaluationTaxonomy, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -3385,8 +3411,9 @@ async def create( :param body: The evaluation taxonomy. Required. :type body: ~azure.ai.projects.models.EvaluationTaxonomy :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3401,7 +3428,7 @@ async def create( name: str, body: JSON, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -3412,8 +3439,9 @@ async def create( :param body: The evaluation taxonomy. Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3428,7 +3456,7 @@ async def create( name: str, body: IO[bytes], *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -3439,8 +3467,9 @@ async def create( :param body: The evaluation taxonomy. Required. :type body: IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -3455,7 +3484,7 @@ async def create( name: str, body: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -3466,8 +3495,9 @@ async def create( IO[bytes] Required. :type body: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -3539,7 +3569,7 @@ async def update( name: str, body: _models.EvaluationTaxonomy, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -3550,8 +3580,9 @@ async def update( :param body: The evaluation taxonomy. Required. :type body: ~azure.ai.projects.models.EvaluationTaxonomy :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3566,7 +3597,7 @@ async def update( name: str, body: JSON, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -3577,8 +3608,9 @@ async def update( :param body: The evaluation taxonomy. Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3593,7 +3625,7 @@ async def update( name: str, body: IO[bytes], *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -3604,8 +3636,9 @@ async def update( :param body: The evaluation taxonomy. Required. :type body: IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -3620,7 +3653,7 @@ async def update( name: str, body: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -3631,8 +3664,9 @@ async def update( IO[bytes] Required. :type body: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -4085,7 +4119,7 @@ def list_versions( self, name: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, limit: Optional[int] = None, **kwargs: Any @@ -4095,8 +4129,9 @@ def list_versions( :param name: The name of the resource. Required. :type name: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default value is None. @@ -4190,7 +4225,7 @@ async def get_next(next_link=None): def list_latest_versions( self, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, limit: Optional[int] = None, **kwargs: Any @@ -4198,8 +4233,9 @@ def list_latest_versions( """List the latest version of each evaluator. :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default value is None. @@ -4294,7 +4330,7 @@ async def get_version( name: str, version: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], **kwargs: Any ) -> _models.EvaluatorVersion: """Get the specific version of the EvaluatorVersion. The service returns 404 Not Found error if @@ -4305,8 +4341,9 @@ async def get_version( :param version: The specific version id of the EvaluatorVersion to retrieve. Required. :type version: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -4369,7 +4406,7 @@ async def delete_version( name: str, version: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], **kwargs: Any ) -> None: """Delete the specific version of the EvaluatorVersion. The service returns 204 No Content if the @@ -4380,8 +4417,9 @@ async def delete_version( :param version: The version of the EvaluatorVersion to delete. Required. :type version: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -4432,7 +4470,7 @@ async def create_version( name: str, evaluator_version: _models.EvaluatorVersion, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -4443,8 +4481,9 @@ async def create_version( :param evaluator_version: Required. :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4459,7 +4498,7 @@ async def create_version( name: str, evaluator_version: JSON, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -4470,8 +4509,9 @@ async def create_version( :param evaluator_version: Required. :type evaluator_version: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4486,7 +4526,7 @@ async def create_version( name: str, evaluator_version: IO[bytes], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -4497,8 +4537,9 @@ async def create_version( :param evaluator_version: Required. :type evaluator_version: IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -4513,7 +4554,7 @@ async def create_version( name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], **kwargs: Any ) -> _models.EvaluatorVersion: """Create a new EvaluatorVersion with auto incremented version id. @@ -4524,8 +4565,9 @@ async def create_version( Required. :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -4598,7 +4640,7 @@ async def update_version( version: str, evaluator_version: _models.EvaluatorVersion, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -4611,8 +4653,9 @@ async def update_version( :param evaluator_version: Evaluator resource. Required. :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4628,7 +4671,7 @@ async def update_version( version: str, evaluator_version: JSON, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -4641,8 +4684,9 @@ async def update_version( :param evaluator_version: Evaluator resource. Required. :type evaluator_version: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4658,7 +4702,7 @@ async def update_version( version: str, evaluator_version: IO[bytes], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -4671,8 +4715,9 @@ async def update_version( :param evaluator_version: Evaluator resource. Required. :type evaluator_version: IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -4688,7 +4733,7 @@ async def update_version( version: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], **kwargs: Any ) -> _models.EvaluatorVersion: """Update an existing EvaluatorVersion with the given version id. @@ -4701,8 +4746,9 @@ async def update_version( JSON, IO[bytes] Required. :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -5243,7 +5289,7 @@ async def generate( self, insight: _models.Insight, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: @@ -5253,8 +5299,9 @@ async def generate( settings. Required. :type insight: ~azure.ai.projects.models.Insight :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5268,7 +5315,7 @@ async def generate( self, insight: JSON, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: @@ -5278,8 +5325,9 @@ async def generate( settings. Required. :type insight: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5293,7 +5341,7 @@ async def generate( self, insight: IO[bytes], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: @@ -5303,8 +5351,9 @@ async def generate( settings. Required. :type insight: IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -5318,7 +5367,7 @@ async def generate( self, insight: Union[_models.Insight, JSON, IO[bytes]], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW]], **kwargs: Any ) -> _models.Insight: """Generate Insights. @@ -5327,8 +5376,9 @@ async def generate( settings. Is one of the following types: Insight, JSON, IO[bytes] Required. :type insight: ~azure.ai.projects.models.Insight or JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :return: Insight. The Insight is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: @@ -5592,7 +5642,7 @@ def __init__(self, *args, **kwargs) -> None: async def create( self, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], name: str, definition: _models.MemoryStoreDefinition, content_type: str = "application/json", @@ -5603,8 +5653,9 @@ async def create( """Create a memory store. :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -5627,7 +5678,7 @@ async def create( self, body: JSON, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: @@ -5636,8 +5687,9 @@ async def create( :param body: Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5651,7 +5703,7 @@ async def create( self, body: IO[bytes], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: @@ -5660,8 +5712,9 @@ async def create( :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. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -5675,7 +5728,7 @@ async def create( self, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], name: str = _Unset, definition: _models.MemoryStoreDefinition = _Unset, description: Optional[str] = None, @@ -5687,8 +5740,9 @@ async def create( :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -5778,7 +5832,7 @@ async def update( self, name: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, @@ -5789,8 +5843,9 @@ async def update( :param name: The name of the memory store to update. Required. :type name: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5810,7 +5865,7 @@ async def update( name: str, body: JSON, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: @@ -5821,8 +5876,9 @@ async def update( :param body: Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5837,7 +5893,7 @@ async def update( name: str, body: IO[bytes], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: @@ -5848,8 +5904,9 @@ async def update( :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. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -5864,7 +5921,7 @@ async def update( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, **kwargs: Any @@ -5876,8 +5933,9 @@ async def update( :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :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 @@ -5957,15 +6015,20 @@ async def update( @distributed_trace_async async def get( - self, name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any + self, + name: str, + *, + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], + **kwargs: Any ) -> _models.MemoryStoreDetails: """Retrieve a memory store. :param name: The name of the memory store to retrieve. Required. :type name: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: @@ -6029,7 +6092,7 @@ async def get( def list( self, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, @@ -6038,8 +6101,9 @@ def list( """List all memory stores. :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_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. @@ -6119,15 +6183,20 @@ async def get_next(_continuation_token=None): @distributed_trace_async async def delete( - self, name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any + self, + name: str, + *, + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], + **kwargs: Any ) -> _models.DeleteMemoryStoreResult: """Delete a memory store. :param name: The name of the memory store to delete. Required. :type name: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :return: DeleteMemoryStoreResult. The DeleteMemoryStoreResult is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DeleteMemoryStoreResult :raises ~azure.core.exceptions.HttpResponseError: @@ -6192,7 +6261,7 @@ async def search_memories( self, name: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], scope: str, content_type: str = "application/json", items: Optional[List[_models.InputItem]] = None, @@ -6205,8 +6274,9 @@ async def search_memories( :param name: The name of the memory store to search. Required. :type name: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -6231,7 +6301,7 @@ async def search_memories( name: str, body: JSON, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: @@ -6242,8 +6312,9 @@ async def search_memories( :param body: Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6258,7 +6329,7 @@ async def search_memories( name: str, body: IO[bytes], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: @@ -6269,8 +6340,9 @@ async def search_memories( :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. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -6285,7 +6357,7 @@ async def search_memories( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], scope: str = _Unset, items: Optional[List[_models.InputItem]] = None, previous_search_id: Optional[str] = None, @@ -6299,8 +6371,9 @@ async def search_memories( :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -6395,7 +6468,7 @@ async def _update_memories_initial( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], scope: str = _Unset, items: Optional[List[_models.InputItem]] = None, previous_update_id: Optional[str] = None, @@ -6481,7 +6554,7 @@ async def _begin_update_memories( self, name: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], scope: str, content_type: str = "application/json", items: Optional[List[_models.InputItem]] = None, @@ -6495,7 +6568,7 @@ async def _begin_update_memories( name: str, body: JSON, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @@ -6505,7 +6578,7 @@ async def _begin_update_memories( name: str, body: IO[bytes], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @@ -6516,7 +6589,7 @@ async def _begin_update_memories( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], scope: str = _Unset, items: Optional[List[_models.InputItem]] = None, previous_update_id: Optional[str] = None, @@ -6530,8 +6603,9 @@ async def _begin_update_memories( :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -6619,7 +6693,7 @@ async def delete_scope( self, name: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], scope: str, content_type: str = "application/json", **kwargs: Any @@ -6629,8 +6703,9 @@ async def delete_scope( :param name: The name of the memory store. Required. :type name: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -6649,7 +6724,7 @@ async def delete_scope( name: str, body: JSON, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: @@ -6660,8 +6735,9 @@ async def delete_scope( :param body: Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6677,7 +6753,7 @@ async def delete_scope( name: str, body: IO[bytes], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: @@ -6688,8 +6764,9 @@ async def delete_scope( :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. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -6705,7 +6782,7 @@ async def delete_scope( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], scope: str = _Unset, **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: @@ -6716,8 +6793,9 @@ async def delete_scope( :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -6966,7 +7044,7 @@ async def create( self, red_team: _models.RedTeam, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: @@ -6975,8 +7053,9 @@ async def create( :param red_team: Redteam to be run. Required. :type red_team: ~azure.ai.projects.models.RedTeam :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. RED_TEAMS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6990,7 +7069,7 @@ async def create( self, red_team: JSON, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: @@ -6999,8 +7078,9 @@ async def create( :param red_team: Redteam to be run. Required. :type red_team: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. RED_TEAMS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7014,7 +7094,7 @@ async def create( self, red_team: IO[bytes], *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: @@ -7023,8 +7103,9 @@ async def create( :param red_team: Redteam to be run. Required. :type red_team: IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. RED_TEAMS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -7038,7 +7119,7 @@ async def create( self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]]] = None, **kwargs: Any ) -> _models.RedTeam: """Creates a redteam run. @@ -7047,8 +7128,9 @@ async def create( Required. :type red_team: ~azure.ai.projects.models.RedTeam or JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. RED_TEAMS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW :return: RedTeam. The RedTeam is compatible with MutableMapping :rtype: ~azure.ai.projects.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: @@ -7475,7 +7557,7 @@ async def get_run( schedule_id: str, run_id: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW]], **kwargs: Any ) -> _models.ScheduleRun: """Get a schedule run by id. @@ -7485,8 +7567,9 @@ async def get_run( :param run_id: The unique identifier of the schedule run. Required. :type run_id: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :return: ScheduleRun. The ScheduleRun is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ScheduleRun :raises ~azure.core.exceptions.HttpResponseError: 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 d2c39425059f..da73b3252bc1 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 @@ -421,8 +421,8 @@ WebSearchTool, WebSearchToolFilters, WeeklyRecurrenceSchedule, + WorkflowActionOutputItem, WorkflowAgentDefinition, - WorkflowPreviewActionOutputItem, ) from ._enums import ( # type: ignore @@ -911,8 +911,8 @@ "WebSearchTool", "WebSearchToolFilters", "WeeklyRecurrenceSchedule", + "WorkflowActionOutputItem", "WorkflowAgentDefinition", - "WorkflowPreviewActionOutputItem", "AgentKind", "AgentProtocol", "AnnotationType", 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 595db35e77e6..167d0f3f132b 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 @@ -10149,7 +10149,7 @@ class OutputItem(_Model): OutputItemMcpToolCall, OutputItemMcpListTools, MemorySearchToolCallItemResource, OAuthConsentRequestOutputItem, OutputItemOutputMessage, OutputItemReasoningItem, OutputItemFunctionShellCall, OutputItemFunctionShellCallOutput, StructuredOutputsOutputItem, - OutputItemWebSearchToolCall, WorkflowPreviewActionOutputItem + OutputItemWebSearchToolCall, WorkflowActionOutputItem :ivar type: Required. Known values are: "output_message", "file_search_call", "function_call", "web_search_call", "computer_call", "reasoning", "compaction", "image_generation_call", @@ -12847,7 +12847,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Prompt(_Model): - """Reference to a prompt template and its variables. `Learn more about reusable prompts + """Reference to a prompt template and its variables. `Learn more `_. :ivar id: The unique identifier of the prompt template to use. Required. @@ -13417,17 +13417,17 @@ class Response(_Model): :ivar user: This field is being replaced by ``safety_identifier`` and ``prompt_cache_key``. Use ``prompt_cache_key`` instead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help - OpenAI detect and prevent abuse. `Learn more about safety identifiers + OpenAI detect and prevent abuse. `Learn more `_. :vartype user: str :ivar safety_identifier: A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us - any identifying information. `Learn more about safety identifiers + any identifying information. `Learn more `_. :vartype safety_identifier: str :ivar prompt_cache_key: Used by OpenAI to cache responses for similar requests to optimize your - cache hit rates. Replaces the ``user`` field. `Learn more about prompt caching + cache hit rates. Replaces the ``user`` field. `Learn more `_. :vartype prompt_cache_key: str :ivar service_tier: Is one of the following types: Literal["auto"], Literal["default"], @@ -13478,6 +13478,7 @@ class Response(_Model): :ivar incomplete_details: Required. :vartype incomplete_details: ~azure.ai.projects.models.ResponseIncompleteDetails :ivar output: An array of content items generated by the model. + * The length and order of items in the `output` array is dependent on the model's response. * Rather than accessing the first item in the `output` array and @@ -13507,17 +13508,17 @@ class Response(_Model): """This field is being replaced by ``safety_identifier`` and ``prompt_cache_key``. Use ``prompt_cache_key`` instead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help - OpenAI detect and prevent abuse. `Learn more about safety identifiers + OpenAI detect and prevent abuse. `Learn more `_.""" safety_identifier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying - information. `Learn more about safety identifiers + information. `Learn more `_.""" prompt_cache_key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. - Replaces the ``user`` field. `Learn more about prompt caching + Replaces the ``user`` field. `Learn more `_.""" service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] @@ -13573,6 +13574,7 @@ class Response(_Model): """Required.""" output: list["_models.OutputItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """An array of content items generated by the model. + * The length and order of items in the `output` array is dependent on the model's response. * Rather than accessing the first item in the `output` array and @@ -16366,7 +16368,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ResponseTextParam(_Model): """Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more here: + text or structured JSON data. Learn more: * [Text inputs and outputs](https://platform.openai.com/docs/guides/text) * [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). @@ -17497,12 +17499,14 @@ class ToolChoiceAllowed(ToolChoiceParam, discriminator="allowed_tools"): :vartype mode: str or str :ivar tools: 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" } - ]. Required. + + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ]. Required. :vartype tools: list[dict[str, any]] """ @@ -17516,12 +17520,14 @@ class ToolChoiceAllowed(ToolChoiceParam, discriminator="allowed_tools"): tools: list[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """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\" } - ]. Required.""" + + [ + { \"type\": \"function\", \"name\": \"get_weather\" }, + { \"type\": \"mcp\", \"server_label\": \"deepwiki\" }, + { \"type\": \"image_generation\" } + ]. Required.""" @overload def __init__( @@ -18478,44 +18484,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = RecurrenceType.WEEKLY # type: ignore -class WorkflowAgentDefinition(AgentDefinition, discriminator="workflow"): - """The workflow 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. WORKFLOW. - :vartype kind: str or ~azure.ai.projects.models.WORKFLOW - :ivar workflow: The CSDL YAML definition of the workflow. - :vartype workflow: str - """ - - kind: Literal[AgentKind.WORKFLOW] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. WORKFLOW.""" - workflow: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The CSDL YAML definition of the workflow.""" - - @overload - def __init__( - self, - *, - rai_config: Optional["_models.RaiConfig"] = None, - workflow: 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.WORKFLOW # type: ignore - - -class WorkflowPreviewActionOutputItem(OutputItem, discriminator="workflow_action"): - """WorkflowPreviewActionOutputItem. +class WorkflowActionOutputItem(OutputItem, discriminator="workflow_action"): + """WorkflowActionOutputItem. :ivar agent_reference: The agent that created the item. :vartype agent_reference: ~azure.ai.projects.models.AgentReference @@ -18577,3 +18547,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) self.type = OutputItemType.WORKFLOW_ACTION # type: ignore + + +class WorkflowAgentDefinition(AgentDefinition, discriminator="workflow"): + """The workflow 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. WORKFLOW. + :vartype kind: str or ~azure.ai.projects.models.WORKFLOW + :ivar workflow: The CSDL YAML definition of the workflow. + :vartype workflow: str + """ + + kind: Literal[AgentKind.WORKFLOW] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. WORKFLOW.""" + workflow: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The CSDL YAML definition of the workflow.""" + + @overload + def __init__( + self, + *, + rai_config: Optional["_models.RaiConfig"] = None, + workflow: 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.WORKFLOW # type: 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 eb8c7599ac38..c314a033d85d 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 @@ -77,6 +77,7 @@ def build_agents_create_request( *, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -112,6 +113,7 @@ def build_agents_update_request( *, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -264,6 +266,7 @@ def build_agents_create_version_request( *, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -422,7 +425,7 @@ def build_agents_stream_agent_container_logs_request( # pylint: disable=name-to agent_name: str, agent_version: str, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW]]] = None, kind: Optional[Union[str, _models.ContainerLogKind]] = None, replica_name: Optional[str] = None, tail: Optional[int] = None, @@ -833,7 +836,7 @@ def build_evaluation_taxonomies_delete_request( # pylint: disable=name-too-long def build_evaluation_taxonomies_create_request( # pylint: disable=name-too-long name: str, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -867,7 +870,7 @@ def build_evaluation_taxonomies_create_request( # pylint: disable=name-too-long def build_evaluation_taxonomies_update_request( # pylint: disable=name-too-long name: str, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1006,7 +1009,7 @@ def build_evaluation_rules_list_request( def build_evaluators_list_versions_request( name: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, limit: Optional[int] = None, **kwargs: Any @@ -1041,7 +1044,7 @@ def build_evaluators_list_versions_request( def build_evaluators_list_latest_versions_request( # pylint: disable=name-too-long *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, limit: Optional[int] = None, **kwargs: Any @@ -1073,7 +1076,7 @@ def build_evaluators_get_version_request( name: str, version: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1105,7 +1108,7 @@ def build_evaluators_delete_version_request( name: str, version: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1131,7 +1134,7 @@ def build_evaluators_delete_version_request( def build_evaluators_create_version_request( - name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], **kwargs: Any + name: str, *, foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1164,7 +1167,7 @@ def build_evaluators_update_version_request( name: str, version: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1311,7 +1314,7 @@ def build_indexes_create_or_update_request(name: str, version: str, **kwargs: An def build_insights_generate_request( - *, foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], **kwargs: Any + *, foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW]], **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1405,7 +1408,7 @@ def build_insights_list_request( def build_memory_stores_create_request( - *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any + *, foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1430,7 +1433,10 @@ def build_memory_stores_create_request( def build_memory_stores_update_request( - name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any + name: str, + *, + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1460,7 +1466,10 @@ def build_memory_stores_update_request( def build_memory_stores_get_request( - name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any + name: str, + *, + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1488,7 +1497,7 @@ def build_memory_stores_get_request( def build_memory_stores_list_request( *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, after: Optional[str] = None, @@ -1523,7 +1532,10 @@ def build_memory_stores_list_request( def build_memory_stores_delete_request( - name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any + name: str, + *, + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1550,7 +1562,10 @@ def build_memory_stores_delete_request( def build_memory_stores_search_memories_request( # pylint: disable=name-too-long - name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any + name: str, + *, + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1580,7 +1595,10 @@ def build_memory_stores_search_memories_request( # pylint: disable=name-too-lon def build_memory_stores_update_memories_request( # pylint: disable=name-too-long - name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any + name: str, + *, + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1610,7 +1628,10 @@ def build_memory_stores_update_memories_request( # pylint: disable=name-too-lon def build_memory_stores_delete_scope_request( - name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any + name: str, + *, + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1683,7 +1704,9 @@ def build_red_teams_list_request(**kwargs: Any) -> HttpRequest: def build_red_teams_create_request( - *, foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, **kwargs: Any + *, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]]] = None, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -1803,7 +1826,7 @@ def build_schedules_get_run_request( schedule_id: str, run_id: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW]], **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1944,6 +1967,7 @@ def create( definition: _models.AgentDefinition, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -1967,12 +1991,13 @@ def create( agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -1998,6 +2023,7 @@ def create( *, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -2011,12 +2037,13 @@ def create( :param body: Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -2033,6 +2060,7 @@ def create( *, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -2046,12 +2074,13 @@ def create( :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. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -2070,6 +2099,7 @@ def create( definition: _models.AgentDefinition = _Unset, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -2094,12 +2124,13 @@ def create( agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :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 @@ -2193,6 +2224,7 @@ def update( definition: _models.AgentDefinition, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -2212,12 +2244,13 @@ def update( agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -2244,6 +2277,7 @@ def update( *, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -2260,12 +2294,13 @@ def update( :param body: Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -2283,6 +2318,7 @@ def update( *, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -2299,12 +2335,13 @@ def update( :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. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -2323,6 +2360,7 @@ def update( definition: _models.AgentDefinition = _Unset, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -2343,12 +2381,13 @@ def update( agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :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 @@ -2981,6 +3020,7 @@ def create_version( definition: _models.AgentDefinition, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -3004,12 +3044,13 @@ def create_version( agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -3036,6 +3077,7 @@ def create_version( *, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -3056,12 +3098,13 @@ def create_version( :param body: Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -3079,6 +3122,7 @@ def create_version( *, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -3099,12 +3143,13 @@ def create_version( :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. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -3123,6 +3168,7 @@ def create_version( definition: _models.AgentDefinition = _Unset, foundry_features: Optional[ Union[ + str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW], @@ -3147,12 +3193,13 @@ def create_version( agent definition. Required. :paramtype definition: ~azure.ai.projects.models.AgentDefinition :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. Is one of the following types: + modifying persisted preview resources. Is one of the following types: str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.HOSTED_AGENTS_V1_PREVIEW], Literal[FoundryFeaturesOptInKeys.WORKFLOW_AGENTS_V1_PREVIEW] Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or - str or ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW or str or + ~azure.ai.projects.models.HOSTED_AGENTS_V1_PREVIEW or str or ~azure.ai.projects.models.WORKFLOW_AGENTS_V1_PREVIEW :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 @@ -3675,7 +3722,7 @@ def stream_agent_container_logs( # pylint: disable=inconsistent-return-statemen agent_name: str, agent_version: str, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW]]] = None, kind: Optional[Union[str, _models.ContainerLogKind]] = None, replica_name: Optional[str] = None, tail: Optional[int] = None, @@ -3712,8 +3759,10 @@ def stream_agent_container_logs( # pylint: disable=inconsistent-return-statemen :param agent_version: The version of the agent. Required. :type agent_version: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. CONTAINER_AGENTS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.CONTAINER_AGENTS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or + ~azure.ai.projects.models.CONTAINER_AGENTS_V1_PREVIEW :keyword kind: console returns container stdout/stderr, system returns container app event stream. defaults to console. Known values are: "console" and "system". Default value is None. :paramtype kind: str or ~azure.ai.projects.models.ContainerLogKind @@ -5115,7 +5164,7 @@ def create( name: str, body: _models.EvaluationTaxonomy, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -5126,8 +5175,9 @@ def create( :param body: The evaluation taxonomy. Required. :type body: ~azure.ai.projects.models.EvaluationTaxonomy :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5142,7 +5192,7 @@ def create( name: str, body: JSON, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -5153,8 +5203,9 @@ def create( :param body: The evaluation taxonomy. Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5169,7 +5220,7 @@ def create( name: str, body: IO[bytes], *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -5180,8 +5231,9 @@ def create( :param body: The evaluation taxonomy. Required. :type body: IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -5196,7 +5248,7 @@ def create( name: str, body: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, **kwargs: Any ) -> _models.EvaluationTaxonomy: """Create an evaluation taxonomy. @@ -5207,8 +5259,9 @@ def create( IO[bytes] Required. :type body: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -5280,7 +5333,7 @@ def update( name: str, body: _models.EvaluationTaxonomy, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -5291,8 +5344,9 @@ def update( :param body: The evaluation taxonomy. Required. :type body: ~azure.ai.projects.models.EvaluationTaxonomy :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5307,7 +5361,7 @@ def update( name: str, body: JSON, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -5318,8 +5372,9 @@ def update( :param body: The evaluation taxonomy. Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5334,7 +5389,7 @@ def update( name: str, body: IO[bytes], *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluationTaxonomy: @@ -5345,8 +5400,9 @@ def update( :param body: The evaluation taxonomy. Required. :type body: IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -5361,7 +5417,7 @@ def update( name: str, body: Union[_models.EvaluationTaxonomy, JSON, IO[bytes]], *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]]] = None, **kwargs: Any ) -> _models.EvaluationTaxonomy: """Update an evaluation taxonomy. @@ -5372,8 +5428,9 @@ def update( IO[bytes] Required. :type body: ~azure.ai.projects.models.EvaluationTaxonomy or JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluationTaxonomy. The EvaluationTaxonomy is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluationTaxonomy :raises ~azure.core.exceptions.HttpResponseError: @@ -5826,7 +5883,7 @@ def list_versions( self, name: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, limit: Optional[int] = None, **kwargs: Any @@ -5836,8 +5893,9 @@ def list_versions( :param name: The name of the resource. Required. :type name: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default value is None. @@ -5931,7 +5989,7 @@ def get_next(next_link=None): def list_latest_versions( self, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], type: Optional[Union[Literal["builtin"], Literal["custom"], Literal["all"], str]] = None, limit: Optional[int] = None, **kwargs: Any @@ -5939,8 +5997,9 @@ def list_latest_versions( """List the latest version of each evaluator. :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword type: Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'. Is one of the following types: Literal["builtin"], Literal["custom"], Literal["all"], str Default value is None. @@ -6035,7 +6094,7 @@ def get_version( name: str, version: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], **kwargs: Any ) -> _models.EvaluatorVersion: """Get the specific version of the EvaluatorVersion. The service returns 404 Not Found error if @@ -6046,8 +6105,9 @@ def get_version( :param version: The specific version id of the EvaluatorVersion to retrieve. Required. :type version: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -6110,7 +6170,7 @@ def delete_version( # pylint: disable=inconsistent-return-statements name: str, version: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], **kwargs: Any ) -> None: """Delete the specific version of the EvaluatorVersion. The service returns 204 No Content if the @@ -6121,8 +6181,9 @@ def delete_version( # pylint: disable=inconsistent-return-statements :param version: The version of the EvaluatorVersion to delete. Required. :type version: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -6173,7 +6234,7 @@ def create_version( name: str, evaluator_version: _models.EvaluatorVersion, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -6184,8 +6245,9 @@ def create_version( :param evaluator_version: Required. :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6200,7 +6262,7 @@ def create_version( name: str, evaluator_version: JSON, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -6211,8 +6273,9 @@ def create_version( :param evaluator_version: Required. :type evaluator_version: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6227,7 +6290,7 @@ def create_version( name: str, evaluator_version: IO[bytes], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -6238,8 +6301,9 @@ def create_version( :param evaluator_version: Required. :type evaluator_version: IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -6254,7 +6318,7 @@ def create_version( name: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], **kwargs: Any ) -> _models.EvaluatorVersion: """Create a new EvaluatorVersion with auto incremented version id. @@ -6265,8 +6329,9 @@ def create_version( Required. :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -6339,7 +6404,7 @@ def update_version( version: str, evaluator_version: _models.EvaluatorVersion, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -6352,8 +6417,9 @@ def update_version( :param evaluator_version: Evaluator resource. Required. :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6369,7 +6435,7 @@ def update_version( version: str, evaluator_version: JSON, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -6382,8 +6448,9 @@ def update_version( :param evaluator_version: Evaluator resource. Required. :type evaluator_version: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6399,7 +6466,7 @@ def update_version( version: str, evaluator_version: IO[bytes], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.EvaluatorVersion: @@ -6412,8 +6479,9 @@ def update_version( :param evaluator_version: Evaluator resource. Required. :type evaluator_version: IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -6429,7 +6497,7 @@ def update_version( version: str, evaluator_version: Union[_models.EvaluatorVersion, JSON, IO[bytes]], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW]], **kwargs: Any ) -> _models.EvaluatorVersion: """Update an existing EvaluatorVersion with the given version id. @@ -6442,8 +6510,9 @@ def update_version( JSON, IO[bytes] Required. :type evaluator_version: ~azure.ai.projects.models.EvaluatorVersion or JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. EVALUATIONS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.EVALUATIONS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.EVALUATIONS_V1_PREVIEW :return: EvaluatorVersion. The EvaluatorVersion is compatible with MutableMapping :rtype: ~azure.ai.projects.models.EvaluatorVersion :raises ~azure.core.exceptions.HttpResponseError: @@ -6984,7 +7053,7 @@ def generate( self, insight: _models.Insight, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: @@ -6994,8 +7063,9 @@ def generate( settings. Required. :type insight: ~azure.ai.projects.models.Insight :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7009,7 +7079,7 @@ def generate( self, insight: JSON, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: @@ -7019,8 +7089,9 @@ def generate( settings. Required. :type insight: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7034,7 +7105,7 @@ def generate( self, insight: IO[bytes], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.Insight: @@ -7044,8 +7115,9 @@ def generate( settings. Required. :type insight: IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -7059,7 +7131,7 @@ def generate( self, insight: Union[_models.Insight, JSON, IO[bytes]], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW]], **kwargs: Any ) -> _models.Insight: """Generate Insights. @@ -7068,8 +7140,9 @@ def generate( settings. Is one of the following types: Insight, JSON, IO[bytes] Required. :type insight: ~azure.ai.projects.models.Insight or JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :return: Insight. The Insight is compatible with MutableMapping :rtype: ~azure.ai.projects.models.Insight :raises ~azure.core.exceptions.HttpResponseError: @@ -7333,7 +7406,7 @@ def __init__(self, *args, **kwargs) -> None: def create( self, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], name: str, definition: _models.MemoryStoreDefinition, content_type: str = "application/json", @@ -7344,8 +7417,9 @@ def create( """Create a memory store. :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -7368,7 +7442,7 @@ def create( self, body: JSON, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: @@ -7377,8 +7451,9 @@ def create( :param body: Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7392,7 +7467,7 @@ def create( self, body: IO[bytes], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: @@ -7401,8 +7476,9 @@ def create( :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. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -7416,7 +7492,7 @@ def create( self, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], name: str = _Unset, definition: _models.MemoryStoreDefinition = _Unset, description: Optional[str] = None, @@ -7428,8 +7504,9 @@ def create( :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword name: The name of the memory store. Required. :paramtype name: str :keyword definition: The memory store definition. Required. @@ -7519,7 +7596,7 @@ def update( self, name: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, @@ -7530,8 +7607,9 @@ def update( :param name: The name of the memory store to update. Required. :type name: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7551,7 +7629,7 @@ def update( name: str, body: JSON, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: @@ -7562,8 +7640,9 @@ def update( :param body: Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7578,7 +7657,7 @@ def update( name: str, body: IO[bytes], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDetails: @@ -7589,8 +7668,9 @@ def update( :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. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -7605,7 +7685,7 @@ def update( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], description: Optional[str] = None, metadata: Optional[dict[str, str]] = None, **kwargs: Any @@ -7617,8 +7697,9 @@ def update( :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :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 @@ -7698,15 +7779,20 @@ def update( @distributed_trace def get( - self, name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any + self, + name: str, + *, + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], + **kwargs: Any ) -> _models.MemoryStoreDetails: """Retrieve a memory store. :param name: The name of the memory store to retrieve. Required. :type name: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :return: MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping :rtype: ~azure.ai.projects.models.MemoryStoreDetails :raises ~azure.core.exceptions.HttpResponseError: @@ -7770,7 +7856,7 @@ def get( def list( self, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], limit: Optional[int] = None, order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, @@ -7779,8 +7865,9 @@ def list( """List all memory stores. :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_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. @@ -7860,15 +7947,20 @@ def get_next(_continuation_token=None): @distributed_trace def delete( - self, name: str, *, foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], **kwargs: Any + self, + name: str, + *, + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], + **kwargs: Any ) -> _models.DeleteMemoryStoreResult: """Delete a memory store. :param name: The name of the memory store to delete. Required. :type name: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :return: DeleteMemoryStoreResult. The DeleteMemoryStoreResult is compatible with MutableMapping :rtype: ~azure.ai.projects.models.DeleteMemoryStoreResult :raises ~azure.core.exceptions.HttpResponseError: @@ -7933,7 +8025,7 @@ def search_memories( self, name: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], scope: str, content_type: str = "application/json", items: Optional[List[_models.InputItem]] = None, @@ -7946,8 +8038,9 @@ def search_memories( :param name: The name of the memory store to search. Required. :type name: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -7972,7 +8065,7 @@ def search_memories( name: str, body: JSON, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: @@ -7983,8 +8076,9 @@ def search_memories( :param body: Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7999,7 +8093,7 @@ def search_memories( name: str, body: IO[bytes], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreSearchResult: @@ -8010,8 +8104,9 @@ def search_memories( :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. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -8026,7 +8121,7 @@ def search_memories( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], scope: str = _Unset, items: Optional[List[_models.InputItem]] = None, previous_search_id: Optional[str] = None, @@ -8040,8 +8135,9 @@ def search_memories( :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -8136,7 +8232,7 @@ def _update_memories_initial( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], scope: str = _Unset, items: Optional[List[_models.InputItem]] = None, previous_update_id: Optional[str] = None, @@ -8222,7 +8318,7 @@ def _begin_update_memories( self, name: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], scope: str, content_type: str = "application/json", items: Optional[List[_models.InputItem]] = None, @@ -8236,7 +8332,7 @@ def _begin_update_memories( name: str, body: JSON, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @@ -8246,7 +8342,7 @@ def _begin_update_memories( name: str, body: IO[bytes], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.MemoryStoreUpdateCompletedResult]: ... @@ -8257,7 +8353,7 @@ def _begin_update_memories( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], scope: str = _Unset, items: Optional[List[_models.InputItem]] = None, previous_update_id: Optional[str] = None, @@ -8271,8 +8367,9 @@ def _begin_update_memories( :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories, such as a user ID. Required. :paramtype scope: str @@ -8359,7 +8456,7 @@ def delete_scope( self, name: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], scope: str, content_type: str = "application/json", **kwargs: Any @@ -8369,8 +8466,9 @@ def delete_scope( :param name: The name of the memory store. Required. :type name: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -8389,7 +8487,7 @@ def delete_scope( name: str, body: JSON, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: @@ -8400,8 +8498,9 @@ def delete_scope( :param body: Required. :type body: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8417,7 +8516,7 @@ def delete_scope( name: str, body: IO[bytes], *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], content_type: str = "application/json", **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: @@ -8428,8 +8527,9 @@ def delete_scope( :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. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -8445,7 +8545,7 @@ def delete_scope( name: str, body: Union[JSON, IO[bytes]] = _Unset, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW]], scope: str = _Unset, **kwargs: Any ) -> _models.MemoryStoreDeleteScopeResult: @@ -8456,8 +8556,9 @@ def delete_scope( :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. MEMORY_STORES_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.MEMORY_STORES_V1_PREVIEW :keyword scope: The namespace that logically groups and isolates memories to delete, such as a user ID. Required. :paramtype scope: str @@ -8706,7 +8807,7 @@ def create( self, red_team: _models.RedTeam, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: @@ -8715,8 +8816,9 @@ def create( :param red_team: Redteam to be run. Required. :type red_team: ~azure.ai.projects.models.RedTeam :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. RED_TEAMS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8730,7 +8832,7 @@ def create( self, red_team: JSON, *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: @@ -8739,8 +8841,9 @@ def create( :param red_team: Redteam to be run. Required. :type red_team: JSON :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. RED_TEAMS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8754,7 +8857,7 @@ def create( self, red_team: IO[bytes], *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]]] = None, content_type: str = "application/json", **kwargs: Any ) -> _models.RedTeam: @@ -8763,8 +8866,9 @@ def create( :param red_team: Redteam to be run. Required. :type red_team: IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. RED_TEAMS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -8778,7 +8882,7 @@ def create( self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], *, - foundry_features: Optional[Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]] = None, + foundry_features: Optional[Union[str, Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW]]] = None, **kwargs: Any ) -> _models.RedTeam: """Creates a redteam run. @@ -8787,8 +8891,9 @@ def create( Required. :type red_team: ~azure.ai.projects.models.RedTeam or JSON or IO[bytes] :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. RED_TEAMS_V1_PREVIEW. Default value is None. - :paramtype foundry_features: str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.RED_TEAMS_V1_PREVIEW] type. Default value is None. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.RED_TEAMS_V1_PREVIEW :return: RedTeam. The RedTeam is compatible with MutableMapping :rtype: ~azure.ai.projects.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: @@ -9215,7 +9320,7 @@ def get_run( schedule_id: str, run_id: str, *, - foundry_features: Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW], + foundry_features: Union[str, Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW]], **kwargs: Any ) -> _models.ScheduleRun: """Get a schedule run by id. @@ -9225,8 +9330,9 @@ def get_run( :param run_id: The unique identifier of the schedule run. Required. :type run_id: str :keyword foundry_features: A feature flag opt-in required when using preview operations or - modifying persisted preview resources. INSIGHTS_V1_PREVIEW. Required. - :paramtype foundry_features: str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW + modifying persisted preview resources. Is either a str type or a + Literal[FoundryFeaturesOptInKeys.INSIGHTS_V1_PREVIEW] type. Required. + :paramtype foundry_features: str or str or ~azure.ai.projects.models.INSIGHTS_V1_PREVIEW :return: ScheduleRun. The ScheduleRun is compatible with MutableMapping :rtype: ~azure.ai.projects.models.ScheduleRun :raises ~azure.core.exceptions.HttpResponseError: diff --git a/sdk/ai/azure-ai-projects/tests/responses/test_responses.py b/sdk/ai/azure-ai-projects/tests/responses/test_responses.py index ac63d300ba1e..c8129bedc624 100644 --- a/sdk/ai/azure-ai-projects/tests/responses/test_responses.py +++ b/sdk/ai/azure-ai-projects/tests/responses/test_responses.py @@ -40,6 +40,7 @@ def _build_client( kwargs: Dict[str, Any] = {"default_headers": default_headers} return project_client.get_openai_client(**kwargs) + class TestResponses(TestBase): # To run this test: From e6efeb6252d0a3caaadaac3c06fe02d6ad5e25e2 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 4 Feb 2026 16:12:59 -0800 Subject: [PATCH 22/22] revert changes to /eng/emitter-package-lock.json, as openai-typespec 1.8.0 is already in Main branch --- eng/emitter-package-lock.json | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index cd9b3428293e..7130d115e197 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -43,7 +43,6 @@ "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.64.1.tgz", "integrity": "sha512-WzSRiX0XS7hCL+uiivLBYMbirEUenxNzPT4giF0J+r54CVNXq/u8PLnA/06F5EHkXPa92swF4BxB1vFWB2TKow==", "license": "MIT", - "peer": true, "engines": { "node": ">=20.0.0" }, @@ -69,7 +68,6 @@ "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.64.0.tgz", "integrity": "sha512-BXiHc5oayhMsG1dHFU1aFK/ZQX2Gl0dKB0FAFceapaFV9093J2obbsdhIDR3Tl0qei9g3Ha+iWKZ4KgnLdhv4w==", "license": "MIT", - "peer": true, "engines": { "node": ">=20.0.0" }, @@ -84,7 +82,6 @@ "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.64.1.tgz", "integrity": "sha512-qQV/+ZVF1h8PsTNKhmKYyb+vSCgnLA8SoGeEE1oOrevGrrp9VgtOMAZ2xIxj6DpU90QU/8t2+r5P/gcQUV1iqw==", "license": "MIT", - "peer": true, "dependencies": { "change-case": "~5.4.4", "pluralize": "^8.0.0" @@ -106,7 +103,6 @@ "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.64.0.tgz", "integrity": "sha512-CvK5iolfsm8oAUZ5wegGVYp4Vvw2rwQa+rcUVoJkwi9c6QwEr+qT6/S4hIntuzEPLxybJSb/ZIWU9Qx3cDrzXg==", "license": "MIT", - "peer": true, "engines": { "node": ">=20.0.0" }, @@ -122,7 +118,6 @@ "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.64.5.tgz", "integrity": "sha512-RaATxsnc9ztdMPoIZ2SuyH97dIGY0BWGKcJBf0hBY+8J3de9o+QH796NA9OsiW+8J9ycCEooDbh/rkAspvA4xA==", "license": "MIT", - "peer": true, "dependencies": { "change-case": "~5.4.4", "pluralize": "^8.0.0", @@ -1014,7 +1009,6 @@ "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-1.8.0.tgz", "integrity": "sha512-FeLb7Q0z6Bh5dDpqtnU2RlWiIWWWF7rujx2xGMta5dcTuIOZ4jbdyz1hVdxk4iM4qadvaSV4ey/qrSuffNoh3w==", "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "~7.27.1", "@inquirer/prompts": "^8.0.1", @@ -1059,7 +1053,6 @@ "resolved": "https://registry.npmjs.org/@typespec/events/-/events-0.78.0.tgz", "integrity": "sha512-gSI4rAexxfYyZX0ZqYNRWQyuMb1UeakjAjOeh/2ntmxWCdYc+wSbJjxrxIArsZC+LwzTxq5WpdtD7+7OWzG4yw==", "license": "MIT", - "peer": true, "engines": { "node": ">=20.0.0" }, @@ -1072,7 +1065,6 @@ "resolved": "https://registry.npmjs.org/@typespec/http/-/http-1.8.0.tgz", "integrity": "sha512-ZKa4RISabwL8cUAmE3BkoNmtCYRjerO0+1Ba6XdDJKG+vJC5EGM2hkDf+ZmYsYZgrX0cvbhPXUKKh28zBV60hw==", "license": "MIT", - "peer": true, "engines": { "node": ">=20.0.0" }, @@ -1124,7 +1116,6 @@ "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-1.8.0.tgz", "integrity": "sha512-v+RIJpx7vALBSGQmnUWemvXjnrk50HAVqJeg0RbaF3VUnh66Z4itsoNJJmIIc+HmBJng8Ie0V7xv3l02ek6HWA==", "license": "MIT", - "peer": true, "engines": { "node": ">=20.0.0" }, @@ -1138,7 +1129,6 @@ "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.78.0.tgz", "integrity": "sha512-1clnDw1JbBvjLcfFvEvHdIrnsQuQI5/Cl6mRIrzWWX0pKJ+R89rCdZD1KpidEXw4B4qscD48LsssyrEIFLtuPg==", "license": "MIT", - "peer": true, "engines": { "node": ">=20.0.0" }, @@ -1152,7 +1142,6 @@ "resolved": "https://registry.npmjs.org/@typespec/sse/-/sse-0.78.0.tgz", "integrity": "sha512-jPARl+e1e/nsDW/1uVsGTzvKmjqezVMyUa13igXxk5nV2ScMdFpH1HhBwTmAhUeaZgY3J81dFHNUnIY67HCrmw==", "license": "MIT", - "peer": true, "engines": { "node": ">=20.0.0" }, @@ -1168,7 +1157,6 @@ "resolved": "https://registry.npmjs.org/@typespec/streams/-/streams-0.78.0.tgz", "integrity": "sha512-wzh5bVdzh+K+pFQFs/EZkVsTH5TQGi12XwhjxJS0UKRwaW2UwSZeY1HqX07oMMPdYESTbjgMrXcxtn89AlzjvQ==", "license": "MIT", - "peer": true, "engines": { "node": ">=20.0.0" }, @@ -1181,7 +1169,6 @@ "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.78.0.tgz", "integrity": "sha512-I14X6+IMd0wFMNI8oMFSeFBi2nD4idub+geSO34vuCs4rwuEj3FNzy+rkNkDDvf0+gIUGxeyg7s+YDUcNyiqOA==", "license": "MIT", - "peer": true, "engines": { "node": ">=20.0.0" }, @@ -1194,7 +1181,6 @@ "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.78.0.tgz", "integrity": "sha512-KSDhJX6A/Onsu9FKVZtR/xSy5va3k0y9/U4eiZUn91V/LQyMZNwmResPDHEVYk6JqaIH8bbd6ANWPu3nMd7mmw==", "license": "MIT", - "peer": true, "engines": { "node": ">=20.0.0" }, @@ -1918,9 +1904,9 @@ } }, "node_modules/tar": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.6.tgz", - "integrity": "sha512-xqUeu2JAIJpXyvskvU3uvQW8PAmHrtXp2KDuMJwQqW8Sqq0CaZBAQ+dKS3RBXVhU4wC5NjAdKrmh84241gO9cA==", + "version": "7.5.7", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.7.tgz", + "integrity": "sha512-fov56fJiRuThVFXD6o6/Q354S7pnWMJIVlDBYijsTNx6jKSE4pvrDTs6lUnmGvNyfJwFQQwWy3owKz1ucIhveQ==", "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/fs-minipass": "^4.0.0",