diff --git a/eng/package-lock.json b/eng/package-lock.json new file mode 100644 index 000000000000..27992f7d2887 --- /dev/null +++ b/eng/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "eng", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/sdk/ai/azure-ai-projects/README.md b/sdk/ai/azure-ai-projects/README.md index ef0f9332d6eb..382486a7579d 100644 --- a/sdk/ai/azure-ai-projects/README.md +++ b/sdk/ai/azure-ai-projects/README.md @@ -218,7 +218,7 @@ asset_file_path = os.path.abspath( # Upload the CSV file for the code interpreter file = openai_client.files.create(purpose="assistants", file=open(asset_file_path, "rb")) -tool = CodeInterpreterTool(container=CodeInterpreterToolAuto(file_ids=[file.id])) +tool = CodeInterpreterTool(container=CodeInterpreterContainerAuto(file_ids=[file.id])) ``` 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 80b8dc2ae282..000000000000 --- a/sdk/ai/azure-ai-projects/_tsp-location.yaml +++ /dev/null @@ -1,4 +0,0 @@ -directory: specification/ai/Azure.AI.Projects -commit: 78bfd335c31b8764578cfb9840f3b74349c10354 -repo: Azure/azure-rest-api-specs-pr -additionalDirectories: diff --git a/sdk/ai/azure-ai-projects/apiview-properties.json b/sdk/ai/azure-ai-projects/apiview-properties.json index c0d3cbfc4e93..b87fe5dfba3a 100644 --- a/sdk/ai/azure-ai-projects/apiview-properties.json +++ b/sdk/ai/azure-ai-projects/apiview-properties.json @@ -16,15 +16,23 @@ "azure.ai.projects.models.AgentReference": "Azure.AI.Projects.AgentReference", "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.AgentVersionDetails", + "azure.ai.projects.models.AgentVersionDetails": "Azure.AI.Projects.AgentVersionObject", "azure.ai.projects.models.AISearchIndexResource": "Azure.AI.Projects.AISearchIndexResource", "azure.ai.projects.models.Annotation": "OpenAI.Annotation", - "azure.ai.projects.models.AnnotationFileCitation": "OpenAI.AnnotationFileCitation", - "azure.ai.projects.models.AnnotationFilePath": "OpenAI.AnnotationFilePath", - "azure.ai.projects.models.AnnotationUrlCitation": "OpenAI.AnnotationUrlCitation", "azure.ai.projects.models.ApiErrorResponse": "Azure.AI.Projects.ApiErrorResponse", "azure.ai.projects.models.ApiKeyCredentials": "Azure.AI.Projects.ApiKeyCredentials", - "azure.ai.projects.models.Location": "OpenAI.Location", + "azure.ai.projects.models.ApplyPatchFileOperation": "OpenAI.ApplyPatchFileOperation", + "azure.ai.projects.models.ApplyPatchCreateFileOperation": "OpenAI.ApplyPatchCreateFileOperation", + "azure.ai.projects.models.ApplyPatchOperationParam": "OpenAI.ApplyPatchOperationParam", + "azure.ai.projects.models.ApplyPatchCreateFileOperationParam": "OpenAI.ApplyPatchCreateFileOperationParam", + "azure.ai.projects.models.ApplyPatchDeleteFileOperation": "OpenAI.ApplyPatchDeleteFileOperation", + "azure.ai.projects.models.ApplyPatchDeleteFileOperationParam": "OpenAI.ApplyPatchDeleteFileOperationParam", + "azure.ai.projects.models.Item": "OpenAI.Item", + "azure.ai.projects.models.ApplyPatchToolCallItemParam": "OpenAI.ApplyPatchToolCallItemParam", + "azure.ai.projects.models.ApplyPatchToolCallOutputItemParam": "OpenAI.ApplyPatchToolCallOutputItemParam", + "azure.ai.projects.models.ApplyPatchToolParam": "OpenAI.ApplyPatchToolParam", + "azure.ai.projects.models.ApplyPatchUpdateFileOperation": "OpenAI.ApplyPatchUpdateFileOperation", + "azure.ai.projects.models.ApplyPatchUpdateFileOperationParam": "OpenAI.ApplyPatchUpdateFileOperationParam", "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", @@ -54,49 +62,38 @@ "azure.ai.projects.models.ChartCoordinate": "Azure.AI.Projects.ChartCoordinate", "azure.ai.projects.models.MemoryItem": "Azure.AI.Projects.MemoryItem", "azure.ai.projects.models.ChatSummaryMemoryItem": "Azure.AI.Projects.ChatSummaryMemoryItem", + "azure.ai.projects.models.ComputerAction": "OpenAI.ComputerAction", + "azure.ai.projects.models.ClickParam": "OpenAI.ClickParam", "azure.ai.projects.models.ClusterInsightResult": "Azure.AI.Projects.ClusterInsightResult", "azure.ai.projects.models.ClusterTokenUsage": "Azure.AI.Projects.ClusterTokenUsage", "azure.ai.projects.models.EvaluatorDefinition": "Azure.AI.Projects.EvaluatorDefinition", "azure.ai.projects.models.CodeBasedEvaluatorDefinition": "Azure.AI.Projects.CodeBasedEvaluatorDefinition", - "azure.ai.projects.models.CodeInterpreterOutput": "OpenAI.CodeInterpreterOutput", + "azure.ai.projects.models.CodeInterpreterContainerAuto": "OpenAI.CodeInterpreterContainerAuto", "azure.ai.projects.models.CodeInterpreterOutputImage": "OpenAI.CodeInterpreterOutputImage", "azure.ai.projects.models.CodeInterpreterOutputLogs": "OpenAI.CodeInterpreterOutputLogs", "azure.ai.projects.models.CodeInterpreterTool": "OpenAI.CodeInterpreterTool", - "azure.ai.projects.models.CodeInterpreterToolAuto": "OpenAI.CodeInterpreterToolAuto", - "azure.ai.projects.models.ItemParam": "OpenAI.ItemParam", - "azure.ai.projects.models.CodeInterpreterToolCallItemParam": "OpenAI.CodeInterpreterToolCallItemParam", - "azure.ai.projects.models.ItemResource": "OpenAI.ItemResource", - "azure.ai.projects.models.CodeInterpreterToolCallItemResource": "OpenAI.CodeInterpreterToolCallItemResource", + "azure.ai.projects.models.CompactionSummaryItemParam": "OpenAI.CompactionSummaryItemParam", "azure.ai.projects.models.ComparisonFilter": "OpenAI.ComparisonFilter", "azure.ai.projects.models.CompoundFilter": "OpenAI.CompoundFilter", - "azure.ai.projects.models.ComputerAction": "OpenAI.ComputerAction", - "azure.ai.projects.models.ComputerActionClick": "OpenAI.ComputerActionClick", - "azure.ai.projects.models.ComputerActionDoubleClick": "OpenAI.ComputerActionDoubleClick", - "azure.ai.projects.models.ComputerActionDrag": "OpenAI.ComputerActionDrag", - "azure.ai.projects.models.ComputerActionKeyPress": "OpenAI.ComputerActionKeyPress", - "azure.ai.projects.models.ComputerActionMove": "OpenAI.ComputerActionMove", - "azure.ai.projects.models.ComputerActionScreenshot": "OpenAI.ComputerActionScreenshot", - "azure.ai.projects.models.ComputerActionScroll": "OpenAI.ComputerActionScroll", - "azure.ai.projects.models.ComputerActionTypeKeys": "OpenAI.ComputerActionTypeKeys", - "azure.ai.projects.models.ComputerActionWait": "OpenAI.ComputerActionWait", - "azure.ai.projects.models.ComputerToolCallItemParam": "OpenAI.ComputerToolCallItemParam", - "azure.ai.projects.models.ComputerToolCallItemResource": "OpenAI.ComputerToolCallItemResource", - "azure.ai.projects.models.ComputerToolCallOutputItemOutput": "OpenAI.ComputerToolCallOutputItemOutput", - "azure.ai.projects.models.ComputerToolCallOutputItemOutputComputerScreenshot": "OpenAI.ComputerToolCallOutputItemOutputComputerScreenshot", - "azure.ai.projects.models.ComputerToolCallOutputItemParam": "OpenAI.ComputerToolCallOutputItemParam", - "azure.ai.projects.models.ComputerToolCallOutputItemResource": "OpenAI.ComputerToolCallOutputItemResource", - "azure.ai.projects.models.ComputerToolCallSafetyCheck": "OpenAI.ComputerToolCallSafetyCheck", + "azure.ai.projects.models.ComputerCallOutputItemParam": "OpenAI.ComputerCallOutputItemParam", + "azure.ai.projects.models.ComputerCallSafetyCheckParam": "OpenAI.ComputerCallSafetyCheckParam", + "azure.ai.projects.models.ComputerScreenshotImage": "OpenAI.ComputerScreenshotImage", "azure.ai.projects.models.ComputerUsePreviewTool": "OpenAI.ComputerUsePreviewTool", "azure.ai.projects.models.Connection": "Azure.AI.Projects.Connection", "azure.ai.projects.models.ContainerAppAgentDefinition": "Azure.AI.Projects.ContainerAppAgentDefinition", + "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.Coordinate": "OpenAI.Coordinate", + "azure.ai.projects.models.ConversationReference": "OpenAI.ConversationReference", "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", + "azure.ai.projects.models.CustomToolParamFormat": "OpenAI.CustomToolParamFormat", + "azure.ai.projects.models.CustomGrammarFormatParam": "OpenAI.CustomGrammarFormatParam", + "azure.ai.projects.models.CustomTextFormatParam": "OpenAI.CustomTextFormatParam", + "azure.ai.projects.models.CustomToolParam": "OpenAI.CustomToolParam", "azure.ai.projects.models.RecurrenceSchedule": "Azure.AI.Projects.RecurrenceSchedule", "azure.ai.projects.models.DailyRecurrenceSchedule": "Azure.AI.Projects.DailyRecurrenceSchedule", "azure.ai.projects.models.DatasetCredential": "Azure.AI.Projects.AssetCredentialResponse", @@ -105,6 +102,11 @@ "azure.ai.projects.models.DeleteAgentVersionResponse": "Azure.AI.Projects.DeleteAgentVersionResponse", "azure.ai.projects.models.DeleteMemoryStoreResult": "Azure.AI.Projects.DeleteMemoryStoreResponse", "azure.ai.projects.models.Deployment": "Azure.AI.Projects.Deployment", + "azure.ai.projects.models.DoubleClickAction": "OpenAI.DoubleClickAction", + "azure.ai.projects.models.Drag": "OpenAI.Drag", + "azure.ai.projects.models.DragPoint": "OpenAI.DragPoint", + "azure.ai.projects.models.InputItem": "OpenAI.InputItem", + "azure.ai.projects.models.EasyInputMessage": "OpenAI.EasyInputMessage", "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", @@ -127,62 +129,104 @@ "azure.ai.projects.models.EvaluatorVersion": "Azure.AI.Projects.EvaluatorVersion", "azure.ai.projects.models.FabricDataAgentToolParameters": "Azure.AI.Projects.FabricDataAgentToolParameters", "azure.ai.projects.models.FieldMapping": "Azure.AI.Projects.FieldMapping", + "azure.ai.projects.models.FileCitationBody": "OpenAI.FileCitationBody", "azure.ai.projects.models.FileDatasetVersion": "Azure.AI.Projects.FileDatasetVersion", + "azure.ai.projects.models.FilePath": "OpenAI.FilePath", "azure.ai.projects.models.FileSearchTool": "OpenAI.FileSearchTool", - "azure.ai.projects.models.FileSearchToolCallItemParam": "OpenAI.FileSearchToolCallItemParam", - "azure.ai.projects.models.FileSearchToolCallItemParamResult": "OpenAI.FileSearchToolCallItemParam.result.anonymous", - "azure.ai.projects.models.FileSearchToolCallItemResource": "OpenAI.FileSearchToolCallItemResource", + "azure.ai.projects.models.FileSearchToolCallResults": "OpenAI.FileSearchToolCallResults", "azure.ai.projects.models.FolderDatasetVersion": "Azure.AI.Projects.FolderDatasetVersion", + "azure.ai.projects.models.FunctionAndCustomToolCallOutput": "OpenAI.FunctionAndCustomToolCallOutput", + "azure.ai.projects.models.FunctionAndCustomToolCallOutputInputFileContent": "OpenAI.FunctionAndCustomToolCallOutputInputFileContent", + "azure.ai.projects.models.FunctionAndCustomToolCallOutputInputImageContent": "OpenAI.FunctionAndCustomToolCallOutputInputImageContent", + "azure.ai.projects.models.FunctionAndCustomToolCallOutputInputTextContent": "OpenAI.FunctionAndCustomToolCallOutputInputTextContent", + "azure.ai.projects.models.FunctionCallOutputItemParam": "OpenAI.FunctionCallOutputItemParam", + "azure.ai.projects.models.FunctionShellAction": "OpenAI.FunctionShellAction", + "azure.ai.projects.models.FunctionShellActionParam": "OpenAI.FunctionShellActionParam", + "azure.ai.projects.models.FunctionShellCallItemParam": "OpenAI.FunctionShellCallItemParam", + "azure.ai.projects.models.FunctionShellCallOutputContent": "OpenAI.FunctionShellCallOutputContent", + "azure.ai.projects.models.FunctionShellCallOutputContentParam": "OpenAI.FunctionShellCallOutputContentParam", + "azure.ai.projects.models.FunctionShellCallOutputOutcome": "OpenAI.FunctionShellCallOutputOutcome", + "azure.ai.projects.models.FunctionShellCallOutputExitOutcome": "OpenAI.FunctionShellCallOutputExitOutcome", + "azure.ai.projects.models.FunctionShellCallOutputOutcomeParam": "OpenAI.FunctionShellCallOutputOutcomeParam", + "azure.ai.projects.models.FunctionShellCallOutputExitOutcomeParam": "OpenAI.FunctionShellCallOutputExitOutcomeParam", + "azure.ai.projects.models.FunctionShellCallOutputItemParam": "OpenAI.FunctionShellCallOutputItemParam", + "azure.ai.projects.models.FunctionShellCallOutputTimeoutOutcome": "OpenAI.FunctionShellCallOutputTimeoutOutcome", + "azure.ai.projects.models.FunctionShellCallOutputTimeoutOutcomeParam": "OpenAI.FunctionShellCallOutputTimeoutOutcomeParam", + "azure.ai.projects.models.FunctionShellToolParam": "OpenAI.FunctionShellToolParam", "azure.ai.projects.models.FunctionTool": "OpenAI.FunctionTool", - "azure.ai.projects.models.FunctionToolCallItemParam": "OpenAI.FunctionToolCallItemParam", - "azure.ai.projects.models.FunctionToolCallItemResource": "OpenAI.FunctionToolCallItemResource", - "azure.ai.projects.models.FunctionToolCallOutputItemParam": "OpenAI.FunctionToolCallOutputItemParam", - "azure.ai.projects.models.FunctionToolCallOutputItemResource": "OpenAI.FunctionToolCallOutputItemResource", "azure.ai.projects.models.HostedAgentDefinition": "Azure.AI.Projects.HostedAgentDefinition", "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.ImageGenToolCallItemParam": "OpenAI.ImageGenToolCallItemParam", - "azure.ai.projects.models.ImageGenToolCallItemResource": "OpenAI.ImageGenToolCallItemResource", - "azure.ai.projects.models.ImageGenToolInputImageMask": "OpenAI.ImageGenTool.input_image_mask.anonymous", + "azure.ai.projects.models.ImageGenToolInputImageMask": "OpenAI.ImageGenToolInputImageMask", + "azure.ai.projects.models.InputContent": "OpenAI.InputContent", + "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.InputMessage": "OpenAI.InputMessage", + "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", "azure.ai.projects.models.InsightModelConfiguration": "Azure.AI.Projects.InsightModelConfiguration", "azure.ai.projects.models.InsightScheduleTask": "Azure.AI.Projects.InsightScheduleTask", "azure.ai.projects.models.InsightsMetadata": "Azure.AI.Projects.InsightsMetadata", "azure.ai.projects.models.InsightSummary": "Azure.AI.Projects.InsightSummary", - "azure.ai.projects.models.ItemContent": "OpenAI.ItemContent", - "azure.ai.projects.models.ItemContentInputAudio": "OpenAI.ItemContentInputAudio", - "azure.ai.projects.models.ItemContentInputFile": "OpenAI.ItemContentInputFile", - "azure.ai.projects.models.ItemContentInputImage": "OpenAI.ItemContentInputImage", - "azure.ai.projects.models.ItemContentInputText": "OpenAI.ItemContentInputText", - "azure.ai.projects.models.ItemContentOutputAudio": "OpenAI.ItemContentOutputAudio", - "azure.ai.projects.models.ItemContentOutputText": "OpenAI.ItemContentOutputText", - "azure.ai.projects.models.ItemContentRefusal": "OpenAI.ItemContentRefusal", - "azure.ai.projects.models.ItemReferenceItemParam": "OpenAI.ItemReferenceItemParam", + "azure.ai.projects.models.ItemCodeInterpreterToolCall": "OpenAI.ItemCodeInterpreterToolCall", + "azure.ai.projects.models.ItemComputerToolCall": "OpenAI.ItemComputerToolCall", + "azure.ai.projects.models.ItemCustomToolCall": "OpenAI.ItemCustomToolCall", + "azure.ai.projects.models.ItemCustomToolCallOutput": "OpenAI.ItemCustomToolCallOutput", + "azure.ai.projects.models.ItemFileSearchToolCall": "OpenAI.ItemFileSearchToolCall", + "azure.ai.projects.models.ItemFunctionToolCall": "OpenAI.ItemFunctionToolCall", + "azure.ai.projects.models.ItemImageGenToolCall": "OpenAI.ItemImageGenToolCall", + "azure.ai.projects.models.ItemLocalShellToolCall": "OpenAI.ItemLocalShellToolCall", + "azure.ai.projects.models.ItemLocalShellToolCallOutput": "OpenAI.ItemLocalShellToolCallOutput", + "azure.ai.projects.models.ItemMcpApprovalRequest": "OpenAI.ItemMcpApprovalRequest", + "azure.ai.projects.models.ItemMcpListTools": "OpenAI.ItemMcpListTools", + "azure.ai.projects.models.ItemMcpToolCall": "OpenAI.ItemMcpToolCall", + "azure.ai.projects.models.ItemOutputMessage": "OpenAI.ItemOutputMessage", + "azure.ai.projects.models.ItemReasoningItem": "OpenAI.ItemReasoningItem", + "azure.ai.projects.models.ItemReferenceParam": "OpenAI.ItemReferenceParam", + "azure.ai.projects.models.ItemResourceApplyPatchToolCall": "OpenAI.ItemResourceApplyPatchToolCall", + "azure.ai.projects.models.ItemResourceApplyPatchToolCallOutput": "OpenAI.ItemResourceApplyPatchToolCallOutput", + "azure.ai.projects.models.ItemResourceCodeInterpreterToolCall": "OpenAI.ItemResourceCodeInterpreterToolCall", + "azure.ai.projects.models.ItemResourceComputerToolCall": "OpenAI.ItemResourceComputerToolCall", + "azure.ai.projects.models.ItemResourceComputerToolCallOutputResource": "OpenAI.ItemResourceComputerToolCallOutputResource", + "azure.ai.projects.models.ItemResourceFileSearchToolCall": "OpenAI.ItemResourceFileSearchToolCall", + "azure.ai.projects.models.ItemResourceFunctionShellCall": "OpenAI.ItemResourceFunctionShellCall", + "azure.ai.projects.models.ItemResourceFunctionShellCallOutput": "OpenAI.ItemResourceFunctionShellCallOutput", + "azure.ai.projects.models.ItemResourceFunctionToolCallOutputResource": "OpenAI.ItemResourceFunctionToolCallOutputResource", + "azure.ai.projects.models.ItemResourceFunctionToolCallResource": "OpenAI.ItemResourceFunctionToolCallResource", + "azure.ai.projects.models.ItemResourceImageGenToolCall": "OpenAI.ItemResourceImageGenToolCall", + "azure.ai.projects.models.ItemResourceLocalShellToolCall": "OpenAI.ItemResourceLocalShellToolCall", + "azure.ai.projects.models.ItemResourceLocalShellToolCallOutput": "OpenAI.ItemResourceLocalShellToolCallOutput", + "azure.ai.projects.models.ItemResourceMcpApprovalRequest": "OpenAI.ItemResourceMcpApprovalRequest", + "azure.ai.projects.models.ItemResourceMcpApprovalResponseResource": "OpenAI.ItemResourceMcpApprovalResponseResource", + "azure.ai.projects.models.ItemResourceMcpListTools": "OpenAI.ItemResourceMcpListTools", + "azure.ai.projects.models.ItemResourceMcpToolCall": "OpenAI.ItemResourceMcpToolCall", + "azure.ai.projects.models.ItemResourceOutputMessage": "OpenAI.ItemResourceOutputMessage", + "azure.ai.projects.models.ItemResourceWebSearchToolCall": "OpenAI.ItemResourceWebSearchToolCall", + "azure.ai.projects.models.ItemWebSearchToolCall": "OpenAI.ItemWebSearchToolCall", + "azure.ai.projects.models.KeyPressAction": "OpenAI.KeyPressAction", "azure.ai.projects.models.LocalShellExecAction": "OpenAI.LocalShellExecAction", - "azure.ai.projects.models.LocalShellTool": "OpenAI.LocalShellTool", - "azure.ai.projects.models.LocalShellToolCallItemParam": "OpenAI.LocalShellToolCallItemParam", - "azure.ai.projects.models.LocalShellToolCallItemResource": "OpenAI.LocalShellToolCallItemResource", - "azure.ai.projects.models.LocalShellToolCallOutputItemParam": "OpenAI.LocalShellToolCallOutputItemParam", - "azure.ai.projects.models.LocalShellToolCallOutputItemResource": "OpenAI.LocalShellToolCallOutputItemResource", + "azure.ai.projects.models.LocalShellToolParam": "OpenAI.LocalShellToolParam", "azure.ai.projects.models.LogProb": "OpenAI.LogProb", "azure.ai.projects.models.ManagedAzureAISearchIndex": "Azure.AI.Projects.ManagedAzureAISearchIndex", - "azure.ai.projects.models.MCPApprovalRequestItemParam": "OpenAI.MCPApprovalRequestItemParam", - "azure.ai.projects.models.MCPApprovalRequestItemResource": "OpenAI.MCPApprovalRequestItemResource", - "azure.ai.projects.models.MCPApprovalResponseItemParam": "OpenAI.MCPApprovalResponseItemParam", - "azure.ai.projects.models.MCPApprovalResponseItemResource": "OpenAI.MCPApprovalResponseItemResource", - "azure.ai.projects.models.MCPCallItemParam": "OpenAI.MCPCallItemParam", - "azure.ai.projects.models.MCPCallItemResource": "OpenAI.MCPCallItemResource", - "azure.ai.projects.models.MCPListToolsItemParam": "OpenAI.MCPListToolsItemParam", - "azure.ai.projects.models.MCPListToolsItemResource": "OpenAI.MCPListToolsItemResource", + "azure.ai.projects.models.MCPApprovalResponse": "OpenAI.MCPApprovalResponse", "azure.ai.projects.models.MCPListToolsTool": "OpenAI.MCPListToolsTool", + "azure.ai.projects.models.MCPListToolsToolAnnotations": "OpenAI.MCPListToolsToolAnnotations", + "azure.ai.projects.models.MCPListToolsToolInputSchema": "OpenAI.MCPListToolsToolInputSchema", "azure.ai.projects.models.MCPTool": "OpenAI.MCPTool", - "azure.ai.projects.models.MCPToolAllowedTools1": "OpenAI.MCPTool.allowed_tools.anonymous", - "azure.ai.projects.models.MCPToolRequireApproval1": "OpenAI.MCPTool.require_approval.anonymous", - "azure.ai.projects.models.MCPToolRequireApprovalAlways": "OpenAI.MCPTool.require_approval.always.anonymous", - "azure.ai.projects.models.MCPToolRequireApprovalNever": "OpenAI.MCPTool.require_approval.never.anonymous", + "azure.ai.projects.models.MCPToolFilter": "OpenAI.MCPToolFilter", + "azure.ai.projects.models.MCPToolRequireApproval": "OpenAI.MCPToolRequireApproval", "azure.ai.projects.models.MemoryOperation": "Azure.AI.Projects.MemoryOperation", "azure.ai.projects.models.MemorySearchItem": "Azure.AI.Projects.MemorySearchItem", "azure.ai.projects.models.MemorySearchOptions": "Azure.AI.Projects.MemorySearchOptions", @@ -195,15 +239,15 @@ "azure.ai.projects.models.MemoryStoreDeleteScopeResult": "Azure.AI.Projects.MemoryStoreDeleteScopeResponse", "azure.ai.projects.models.MemoryStoreDetails": "Azure.AI.Projects.MemoryStoreObject", "azure.ai.projects.models.MemoryStoreOperationUsage": "Azure.AI.Projects.MemoryStoreOperationUsage", - "azure.ai.projects.models.MemoryStoreOperationUsageInputTokensDetails": "Azure.AI.Projects.MemoryStoreOperationUsage.input_tokens_details.anonymous", - "azure.ai.projects.models.MemoryStoreOperationUsageOutputTokensDetails": "Azure.AI.Projects.MemoryStoreOperationUsage.output_tokens_details.anonymous", "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.MicrosoftFabricAgentTool": "Azure.AI.Projects.MicrosoftFabricAgentTool", "azure.ai.projects.models.ModelDeployment": "Azure.AI.Projects.ModelDeployment", "azure.ai.projects.models.ModelDeploymentSku": "Azure.AI.Projects.Sku", "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.OneTimeTrigger": "Azure.AI.Projects.OneTimeTrigger", @@ -216,6 +260,31 @@ "azure.ai.projects.models.OpenApiManagedSecurityScheme": "Azure.AI.Projects.OpenApiManagedSecurityScheme", "azure.ai.projects.models.OpenApiProjectConnectionAuthDetails": "Azure.AI.Projects.OpenApiProjectConnectionAuthDetails", "azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme": "Azure.AI.Projects.OpenApiProjectConnectionSecurityScheme", + "azure.ai.projects.models.OutputContent": "OpenAI.OutputContent", + "azure.ai.projects.models.OutputContentOutputTextContent": "OpenAI.OutputContentOutputTextContent", + "azure.ai.projects.models.OutputContentRefusalContent": "OpenAI.OutputContentRefusalContent", + "azure.ai.projects.models.OutputItem": "OpenAI.OutputItem", + "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", @@ -226,14 +295,14 @@ "azure.ai.projects.models.RaiConfig": "Azure.AI.Projects.RaiConfig", "azure.ai.projects.models.RankingOptions": "OpenAI.RankingOptions", "azure.ai.projects.models.Reasoning": "OpenAI.Reasoning", - "azure.ai.projects.models.ReasoningItemParam": "OpenAI.ReasoningItemParam", - "azure.ai.projects.models.ReasoningItemResource": "OpenAI.ReasoningItemResource", - "azure.ai.projects.models.ReasoningItemSummaryPart": "OpenAI.ReasoningItemSummaryPart", - "azure.ai.projects.models.ReasoningItemSummaryTextPart": "OpenAI.ReasoningItemSummaryTextPart", + "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.ResponseStreamEvent": "OpenAI.ResponseStreamEvent", + "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", @@ -242,23 +311,27 @@ "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.ResponseConversation1": "OpenAI.Response.conversation.anonymous", "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.ResponseFormatJsonSchemaSchema": "OpenAI.ResponseFormatJsonSchemaSchema", "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.ResponseIncompleteDetails1": "OpenAI.Response.incomplete_details.anonymous", + "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", @@ -269,70 +342,75 @@ "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.ResponseReasoningDeltaEvent": "OpenAI.ResponseReasoningDeltaEvent", - "azure.ai.projects.models.ResponseReasoningDoneEvent": "OpenAI.ResponseReasoningDoneEvent", - "azure.ai.projects.models.ResponseReasoningSummaryDeltaEvent": "OpenAI.ResponseReasoningSummaryDeltaEvent", - "azure.ai.projects.models.ResponseReasoningSummaryDoneEvent": "OpenAI.ResponseReasoningSummaryDoneEvent", "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.ResponsesMessageItemParam": "OpenAI.ResponsesMessageItemParam", - "azure.ai.projects.models.ResponsesAssistantMessageItemParam": "OpenAI.ResponsesAssistantMessageItemParam", - "azure.ai.projects.models.ResponsesMessageItemResource": "OpenAI.ResponsesMessageItemResource", - "azure.ai.projects.models.ResponsesAssistantMessageItemResource": "OpenAI.ResponsesAssistantMessageItemResource", - "azure.ai.projects.models.ResponsesDeveloperMessageItemParam": "OpenAI.ResponsesDeveloperMessageItemParam", - "azure.ai.projects.models.ResponsesDeveloperMessageItemResource": "OpenAI.ResponsesDeveloperMessageItemResource", - "azure.ai.projects.models.ResponsesSystemMessageItemParam": "OpenAI.ResponsesSystemMessageItemParam", - "azure.ai.projects.models.ResponsesSystemMessageItemResource": "OpenAI.ResponsesSystemMessageItemResource", - "azure.ai.projects.models.ResponsesUserMessageItemParam": "OpenAI.ResponsesUserMessageItemParam", - "azure.ai.projects.models.ResponsesUserMessageItemResource": "OpenAI.ResponsesUserMessageItemResource", - "azure.ai.projects.models.ResponseText": "OpenAI.Response.text.anonymous", "azure.ai.projects.models.ResponseTextDeltaEvent": "OpenAI.ResponseTextDeltaEvent", "azure.ai.projects.models.ResponseTextDoneEvent": "OpenAI.ResponseTextDoneEvent", - "azure.ai.projects.models.ResponseTextFormatConfiguration": "OpenAI.ResponseTextFormatConfiguration", - "azure.ai.projects.models.ResponseTextFormatConfigurationJsonObject": "OpenAI.ResponseTextFormatConfigurationJsonObject", - "azure.ai.projects.models.ResponseTextFormatConfigurationJsonSchema": "OpenAI.ResponseTextFormatConfigurationJsonSchema", - "azure.ai.projects.models.ResponseTextFormatConfigurationText": "OpenAI.ResponseTextFormatConfigurationText", + "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", + "azure.ai.projects.models.Screenshot": "OpenAI.Screenshot", + "azure.ai.projects.models.Scroll": "OpenAI.Scroll", "azure.ai.projects.models.SharepointAgentTool": "Azure.AI.Projects.SharepointAgentTool", "azure.ai.projects.models.SharepointGroundingToolParameters": "Azure.AI.Projects.SharepointGroundingToolParameters", + "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", + "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", - "azure.ai.projects.models.ToolChoiceObject": "OpenAI.ToolChoiceObject", - "azure.ai.projects.models.ToolChoiceObjectCodeInterpreter": "OpenAI.ToolChoiceObjectCodeInterpreter", - "azure.ai.projects.models.ToolChoiceObjectComputer": "OpenAI.ToolChoiceObjectComputer", - "azure.ai.projects.models.ToolChoiceObjectFileSearch": "OpenAI.ToolChoiceObjectFileSearch", - "azure.ai.projects.models.ToolChoiceObjectFunction": "OpenAI.ToolChoiceObjectFunction", - "azure.ai.projects.models.ToolChoiceObjectImageGen": "OpenAI.ToolChoiceObjectImageGen", - "azure.ai.projects.models.ToolChoiceObjectMCP": "OpenAI.ToolChoiceObjectMCP", - "azure.ai.projects.models.ToolChoiceObjectWebSearch": "OpenAI.ToolChoiceObjectWebSearch", + "azure.ai.projects.models.TextResponseFormatConfiguration": "OpenAI.TextResponseFormatConfiguration", + "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", + "azure.ai.projects.models.Type": "OpenAI.Type", + "azure.ai.projects.models.UrlCitationBody": "OpenAI.UrlCitationBody", "azure.ai.projects.models.UserProfileMemoryItem": "Azure.AI.Projects.UserProfileMemoryItem", "azure.ai.projects.models.VectorStoreFileAttributes": "OpenAI.VectorStoreFileAttributes", - "azure.ai.projects.models.WebSearchAction": "OpenAI.WebSearchAction", + "azure.ai.projects.models.Wait": "OpenAI.Wait", "azure.ai.projects.models.WebSearchActionFind": "OpenAI.WebSearchActionFind", "azure.ai.projects.models.WebSearchActionOpenPage": "OpenAI.WebSearchActionOpenPage", "azure.ai.projects.models.WebSearchActionSearch": "OpenAI.WebSearchActionSearch", "azure.ai.projects.models.WebSearchActionSearchSources": "OpenAI.WebSearchActionSearchSources", + "azure.ai.projects.models.WebSearchApproximateLocation": "OpenAI.WebSearchApproximateLocation", + "azure.ai.projects.models.WebSearchConfiguration": "Azure.AI.Projects.WebSearchConfiguration", "azure.ai.projects.models.WebSearchPreviewTool": "OpenAI.WebSearchPreviewTool", - "azure.ai.projects.models.WebSearchToolCallItemParam": "OpenAI.WebSearchToolCallItemParam", - "azure.ai.projects.models.WebSearchToolCallItemResource": "OpenAI.WebSearchToolCallItemResource", + "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", @@ -340,21 +418,35 @@ "azure.ai.projects.models.AgentProtocol": "Azure.AI.Projects.AgentProtocol", "azure.ai.projects.models.ToolType": "OpenAI.ToolType", "azure.ai.projects.models.AzureAISearchQueryType": "Azure.AI.Projects.AzureAISearchQueryType", + "azure.ai.projects.models.ContainerMemoryLimit": "OpenAI.ContainerMemoryLimit", + "azure.ai.projects.models.ComputerEnvironment": "OpenAI.ComputerEnvironment", + "azure.ai.projects.models.CustomToolParamFormatType": "OpenAI.CustomToolParamFormatType", + "azure.ai.projects.models.GrammarSyntax1": "OpenAI.GrammarSyntax1", + "azure.ai.projects.models.RankerVersionType": "OpenAI.RankerVersionType", + "azure.ai.projects.models.InputFidelity": "OpenAI.InputFidelity", "azure.ai.projects.models.OpenApiAuthType": "Azure.AI.Projects.OpenApiAuthType", - "azure.ai.projects.models.LocationType": "OpenAI.LocationType", - "azure.ai.projects.models.ReasoningEffort": "OpenAI.ReasoningEffort", - "azure.ai.projects.models.ResponseTextFormatConfigurationType": "OpenAI.ResponseTextFormatConfigurationType", + "azure.ai.projects.models.SearchContextSize": "OpenAI.SearchContextSize", + "azure.ai.projects.models.TextResponseFormatConfigurationType": "OpenAI.TextResponseFormatConfigurationType", + "azure.ai.projects.models.PageOrder": "Azure.AI.Projects.PageOrder", "azure.ai.projects.models.MemoryStoreKind": "Azure.AI.Projects.MemoryStoreKind", "azure.ai.projects.models.MemoryItemKind": "Azure.AI.Projects.MemoryItemKind", "azure.ai.projects.models.ItemType": "OpenAI.ItemType", - "azure.ai.projects.models.CodeInterpreterOutputType": "OpenAI.CodeInterpreterOutputType", + "azure.ai.projects.models.ApplyPatchCallStatusParam": "OpenAI.ApplyPatchCallStatusParam", + "azure.ai.projects.models.ApplyPatchOperationParamType": "OpenAI.ApplyPatchOperationParamType", + "azure.ai.projects.models.ApplyPatchCallOutputStatusParam": "OpenAI.ApplyPatchCallOutputStatusParam", "azure.ai.projects.models.ComputerActionType": "OpenAI.ComputerActionType", - "azure.ai.projects.models.ComputerToolCallOutputItemOutputType": "OpenAI.ComputerToolCallOutputItemOutputType", - "azure.ai.projects.models.ResponsesMessageRole": "OpenAI.ResponsesMessageRole", - "azure.ai.projects.models.ItemContentType": "OpenAI.ItemContentType", + "azure.ai.projects.models.ClickButtonType": "OpenAI.ClickButtonType", + "azure.ai.projects.models.FunctionCallItemStatus": "OpenAI.FunctionCallItemStatus", + "azure.ai.projects.models.FunctionAndCustomToolCallOutputType": "OpenAI.FunctionAndCustomToolCallOutputType", + "azure.ai.projects.models.ImageDetail": "OpenAI.ImageDetail", + "azure.ai.projects.models.DetailEnum": "OpenAI.DetailEnum", + "azure.ai.projects.models.MCPToolCallStatus": "OpenAI.MCPToolCallStatus", + "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.ReasoningItemSummaryPartType": "OpenAI.ReasoningItemSummaryPartType", - "azure.ai.projects.models.WebSearchActionType": "OpenAI.WebSearchActionType", + "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", "azure.ai.projects.models.ConnectionType": "Azure.AI.Projects.ConnectionType", "azure.ai.projects.models.CredentialType": "Azure.AI.Projects.CredentialType", @@ -382,11 +474,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.ServiceTier": "OpenAI.ServiceTier", - "azure.ai.projects.models.ToolChoiceOptions": "OpenAI.ToolChoiceOptions", - "azure.ai.projects.models.ToolChoiceObjectType": "OpenAI.ToolChoiceObjectType", + "azure.ai.projects.models.ToolChoiceParamType": "OpenAI.ToolChoiceParamType", "azure.ai.projects.models.ResponseErrorCode": "OpenAI.ResponseErrorCode", - "azure.ai.projects.models.ResponseStreamEventType": "OpenAI.ResponseStreamEventType", + "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.InputItemType": "OpenAI.InputItemType", + "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/_types.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_types.py index 5e23b3911701..380d39c39ab4 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_types.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_types.py @@ -10,4 +10,5 @@ if TYPE_CHECKING: from . import models as _models +ComparisonFilterValueItems = Union[str, float] Filters = Union["_models.ComparisonFilter", "_models.CompoundFilter"] 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 03b8c4ce34a0..1a01c0b81a6d 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 @@ -171,6 +171,21 @@ def default(self, o): # pylint: disable=too-many-return-statements r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" ) +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: """Deserialize ISO-8601 formatted string into Datetime object. @@ -315,6 +330,8 @@ def _deserialize_int_as_str(attr): def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore @@ -353,9 +370,39 @@ def __contains__(self, key: typing.Any) -> bool: return key in self._data def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized return self._data.__getitem__(key) def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass self._data.__setitem__(key, value) def __delitem__(self, key: str) -> None: @@ -483,6 +530,8 @@ def _is_model(obj: typing.Any) -> bool: def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) return [_serialize(x, format) for x in o] if isinstance(o, dict): return {k: _serialize(v, format) for k, v in o.items()} @@ -638,6 +687,10 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if not rf._rest_name_input: rf._rest_name_input = attr cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._backcompat_attr_to_rest_field: dict[str, _RestField] = { + Model._get_backcompat_attribute_name(cls._attr_to_rest_field, attr): rf + for attr, rf in cls._attr_to_rest_field.items() + } cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -647,6 +700,16 @@ def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: if hasattr(base, "__mapping__"): base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + @classmethod + def _get_backcompat_attribute_name(cls, attr_to_rest_field: dict[str, "_RestField"], attr_name: str) -> str: + rest_field_obj = attr_to_rest_field.get(attr_name) # pylint: disable=protected-access + if rest_field_obj is None: + return attr_name + original_tsp_name = getattr(rest_field_obj, "_original_tsp_name", None) # pylint: disable=protected-access + if original_tsp_name: + return original_tsp_name + return attr_name + @classmethod def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: for v in cls.__dict__.values(): @@ -767,6 +830,17 @@ def _deserialize_sequence( return obj if isinstance(obj, ET.Element): obj = list(obj) + try: + if ( + isinstance(obj, str) + and isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ): + # encoded string may be deserialized to sequence + return deserializer(obj) + except: # pylint: disable=bare-except + pass return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) @@ -972,6 +1046,7 @@ def _failsafe_deserialize_xml( return None +# pylint: disable=too-many-instance-attributes class _RestField: def __init__( self, @@ -984,6 +1059,7 @@ def __init__( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + original_tsp_name: typing.Optional[str] = None, ): self._type = type self._rest_name_input = name @@ -995,10 +1071,15 @@ def __init__( self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._original_tsp_name = original_tsp_name @property def _class_type(self) -> typing.Any: - return getattr(self._type, "args", [None])[0] + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result @property def _rest_name(self) -> str: @@ -1009,14 +1090,37 @@ def _rest_name(self) -> str: def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class - item = obj.get(self._rest_name) + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name) if item is None: return item if self._is_model: return item - return _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + if value is None: # we want to wipe out entries if users set attr to None try: @@ -1046,6 +1150,7 @@ def rest_field( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + original_tsp_name: typing.Optional[str] = None, ) -> typing.Any: return _RestField( name=name, @@ -1055,6 +1160,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + original_tsp_name=original_tsp_name, ) diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/serialization.py b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/serialization.py index 45a3e44e45cb..81ec1de5922b 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/serialization.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/_utils/serialization.py @@ -821,13 +821,20 @@ def serialize_basic(cls, data, data_type, **kwargs): :param str data_type: Type of object in the iterable. :rtype: str, int, float, bool :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) @classmethod def serialize_unicode(cls, data): @@ -1757,7 +1764,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises TypeError: if string format is not valid. + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1783,7 +1790,11 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) @staticmethod def deserialize_unicode(data): 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 0bb1dcad35d4..099de3de04f3 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 @@ -1042,7 +1042,7 @@ def list( *, kind: Optional[Union[str, _models.AgentKind]] = None, limit: Optional[int] = None, - order: Optional[Literal["asc", "desc"]] = None, + order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.AgentDetails"]: @@ -1057,9 +1057,8 @@ def list( :paramtype limit: int :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for ascending order and``desc`` - for descending order. Is either a Literal["asc"] type or a Literal["desc"] type. Default value - is None. - :paramtype order: str or str + 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 @@ -1698,7 +1697,7 @@ def list_versions( agent_name: str, *, limit: Optional[int] = None, - order: Optional[Literal["asc", "desc"]] = None, + order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.AgentVersionDetails"]: @@ -1712,9 +1711,8 @@ def list_versions( :paramtype limit: int :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for ascending order and``desc`` - for descending order. Is either a Literal["asc"] type or a Literal["desc"] type. Default value - is None. - :paramtype order: str or str + 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 @@ -2206,7 +2204,7 @@ def list( self, *, limit: Optional[int] = None, - order: Optional[Literal["asc", "desc"]] = None, + order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.MemoryStoreDetails"]: @@ -2218,9 +2216,8 @@ def list( :paramtype limit: int :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for ascending order and``desc`` - for descending order. Is either a Literal["asc"] type or a Literal["desc"] type. Default value - is None. - :paramtype order: str or str + 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 @@ -2365,7 +2362,7 @@ async def search_memories( *, scope: str, content_type: str = "application/json", - items: Optional[List[_models.ItemParam]] = None, + items: Optional[List[_models.Item]] = None, previous_search_id: Optional[str] = None, options: Optional[_models.MemorySearchOptions] = None, **kwargs: Any @@ -2381,7 +2378,7 @@ async def search_memories( 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.ItemParam] + :paramtype items: list[~azure.ai.projects.models.Item] :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 @@ -2440,7 +2437,7 @@ async def search_memories( body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, - items: Optional[List[_models.ItemParam]] = None, + items: Optional[List[_models.Item]] = None, previous_search_id: Optional[str] = None, options: Optional[_models.MemorySearchOptions] = None, **kwargs: Any @@ -2455,7 +2452,7 @@ async def search_memories( 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.ItemParam] + :paramtype items: list[~azure.ai.projects.models.Item] :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 @@ -2550,7 +2547,7 @@ async def _update_memories_initial( body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, - items: Optional[List[_models.ItemParam]] = None, + items: Optional[List[_models.Item]] = None, previous_update_id: Optional[str] = None, update_delay: Optional[int] = None, **kwargs: Any @@ -2635,7 +2632,7 @@ async def _begin_update_memories( *, scope: str, content_type: str = "application/json", - items: Optional[List[_models.ItemParam]] = None, + items: Optional[List[_models.Item]] = None, previous_update_id: Optional[str] = None, update_delay: Optional[int] = None, **kwargs: Any @@ -2661,7 +2658,7 @@ async def _begin_update_memories( body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, - items: Optional[List[_models.ItemParam]] = None, + items: Optional[List[_models.Item]] = None, previous_update_id: Optional[str] = None, update_delay: Optional[int] = None, **kwargs: Any @@ -2676,7 +2673,7 @@ async def _begin_update_memories( Required. :paramtype scope: str :keyword items: Conversation items from which to extract memories. Default value is None. - :paramtype items: list[~azure.ai.projects.models.ItemParam] + :paramtype items: list[~azure.ai.projects.models.Item] :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 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 61b4ac43a42f..34bdbf1b8653 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 @@ -14,8 +14,8 @@ from ... import models as _models from ...models import ( MemoryStoreOperationUsage, - MemoryStoreOperationUsageInputTokensDetails, - MemoryStoreOperationUsageOutputTokensDetails, + ResponseUsageInputTokensDetails, + ResponseUsageOutputTokensDetails, MemoryStoreUpdateCompletedResult, AsyncUpdateMemoriesLROPoller, AsyncUpdateMemoriesLROPollingMethod, @@ -34,7 +34,7 @@ async def begin_update_memories( *, scope: str, content_type: str = "application/json", - items: Optional[List[_models.ItemParam]] = None, + items: Optional[List[_models.Item]] = None, previous_update_id: Optional[str] = None, update_delay: Optional[int] = None, **kwargs: Any, @@ -119,7 +119,7 @@ async def begin_update_memories( body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, - items: Optional[List[_models.ItemParam]] = None, + items: Optional[List[_models.Item]] = None, previous_update_id: Optional[str] = None, update_delay: Optional[int] = None, **kwargs: Any, @@ -193,9 +193,9 @@ def get_long_running_output(pipeline_response): usage = MemoryStoreOperationUsage( embedding_tokens=0, input_tokens=0, - input_tokens_details=MemoryStoreOperationUsageInputTokensDetails(cached_tokens=0), + input_tokens_details=ResponseUsageInputTokensDetails(cached_tokens=0), output_tokens=0, - output_tokens_details=MemoryStoreOperationUsageOutputTokensDetails(reasoning_tokens=0), + output_tokens_details=ResponseUsageOutputTokensDetails(reasoning_tokens=0), total_tokens=0, ) deserialized = MemoryStoreUpdateCompletedResult(memory_operations=[], usage=usage) 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 a352198a33b9..afb092a080fd 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 @@ -27,11 +27,19 @@ AgentVersionDetails, AgenticIdentityCredentials, Annotation, - AnnotationFileCitation, - AnnotationFilePath, - AnnotationUrlCitation, ApiErrorResponse, ApiKeyCredentials, + ApplyPatchCreateFileOperation, + ApplyPatchCreateFileOperationParam, + ApplyPatchDeleteFileOperation, + ApplyPatchDeleteFileOperationParam, + ApplyPatchFileOperation, + ApplyPatchOperationParam, + ApplyPatchToolCallItemParam, + ApplyPatchToolCallOutputItemParam, + ApplyPatchToolParam, + ApplyPatchUpdateFileOperation, + ApplyPatchUpdateFileOperationParam, ApproximateLocation, AzureAIAgentTarget, AzureAISearchAgentTool, @@ -58,44 +66,35 @@ CaptureStructuredOutputsTool, ChartCoordinate, ChatSummaryMemoryItem, + ClickParam, ClusterInsightResult, ClusterTokenUsage, CodeBasedEvaluatorDefinition, - CodeInterpreterOutput, + CodeInterpreterContainerAuto, CodeInterpreterOutputImage, CodeInterpreterOutputLogs, CodeInterpreterTool, - CodeInterpreterToolAuto, - CodeInterpreterToolCallItemParam, - CodeInterpreterToolCallItemResource, + CompactionSummaryItemParam, ComparisonFilter, CompoundFilter, ComputerAction, - ComputerActionClick, - ComputerActionDoubleClick, - ComputerActionDrag, - ComputerActionKeyPress, - ComputerActionMove, - ComputerActionScreenshot, - ComputerActionScroll, - ComputerActionTypeKeys, - ComputerActionWait, - ComputerToolCallItemParam, - ComputerToolCallItemResource, - ComputerToolCallOutputItemOutput, - ComputerToolCallOutputItemOutputComputerScreenshot, - ComputerToolCallOutputItemParam, - ComputerToolCallOutputItemResource, - ComputerToolCallSafetyCheck, + ComputerCallOutputItemParam, + ComputerCallSafetyCheckParam, + ComputerScreenshotImage, ComputerUsePreviewTool, Connection, ContainerAppAgentDefinition, + ContainerFileCitationBody, ContinuousEvaluationRuleAction, - Coordinate, + ConversationReference, CosmosDBIndex, CreatedBy, CronTrigger, CustomCredential, + CustomGrammarFormatParam, + CustomTextFormatParam, + CustomToolParam, + CustomToolParamFormat, DailyRecurrenceSchedule, DatasetCredential, DatasetVersion, @@ -103,6 +102,10 @@ DeleteAgentVersionResponse, DeleteMemoryStoreResult, Deployment, + DoubleClickAction, + Drag, + DragPoint, + EasyInputMessage, EmbeddingConfiguration, EntraIDCredentials, Error, @@ -126,26 +129,52 @@ EvaluatorVersion, FabricDataAgentToolParameters, FieldMapping, + FileCitationBody, FileDatasetVersion, + FilePath, FileSearchTool, - FileSearchToolCallItemParam, - FileSearchToolCallItemParamResult, - FileSearchToolCallItemResource, + FileSearchToolCallResults, FolderDatasetVersion, + FunctionAndCustomToolCallOutput, + FunctionAndCustomToolCallOutputInputFileContent, + FunctionAndCustomToolCallOutputInputImageContent, + FunctionAndCustomToolCallOutputInputTextContent, + FunctionCallOutputItemParam, + FunctionShellAction, + FunctionShellActionParam, + FunctionShellCallItemParam, + FunctionShellCallOutputContent, + FunctionShellCallOutputContentParam, + FunctionShellCallOutputExitOutcome, + FunctionShellCallOutputExitOutcomeParam, + FunctionShellCallOutputItemParam, + FunctionShellCallOutputOutcome, + FunctionShellCallOutputOutcomeParam, + FunctionShellCallOutputTimeoutOutcome, + FunctionShellCallOutputTimeoutOutcomeParam, + FunctionShellToolParam, FunctionTool, - FunctionToolCallItemParam, - FunctionToolCallItemResource, - FunctionToolCallOutputItemParam, - FunctionToolCallOutputItemResource, HostedAgentDefinition, HourlyRecurrenceSchedule, HumanEvaluationRuleAction, + HybridSearchOptions, ImageBasedHostedAgentDefinition, ImageGenTool, - ImageGenToolCallItemParam, - ImageGenToolCallItemResource, ImageGenToolInputImageMask, Index, + InputContent, + InputContentInputFileContent, + InputContentInputImageContent, + InputContentInputTextContent, + InputFileContent, + InputFileContentParam, + InputImageContent, + InputImageContentParamAutoParam, + InputItem, + InputMessage, + InputMessageResource, + InputTextContent, + InputTextContentParam, Insight, InsightCluster, InsightModelConfiguration, @@ -155,39 +184,54 @@ InsightScheduleTask, InsightSummary, InsightsMetadata, - ItemContent, - ItemContentInputAudio, - ItemContentInputFile, - ItemContentInputImage, - ItemContentInputText, - ItemContentOutputAudio, - ItemContentOutputText, - ItemContentRefusal, - ItemParam, - ItemReferenceItemParam, + Item, + ItemCodeInterpreterToolCall, + ItemComputerToolCall, + ItemCustomToolCall, + ItemCustomToolCallOutput, + ItemFileSearchToolCall, + ItemFunctionToolCall, + ItemImageGenToolCall, + ItemLocalShellToolCall, + ItemLocalShellToolCallOutput, + ItemMcpApprovalRequest, + ItemMcpListTools, + ItemMcpToolCall, + ItemOutputMessage, + ItemReasoningItem, + ItemReferenceParam, ItemResource, + ItemResourceApplyPatchToolCall, + ItemResourceApplyPatchToolCallOutput, + ItemResourceCodeInterpreterToolCall, + ItemResourceComputerToolCall, + ItemResourceComputerToolCallOutputResource, + ItemResourceFileSearchToolCall, + ItemResourceFunctionShellCall, + ItemResourceFunctionShellCallOutput, + ItemResourceFunctionToolCallOutputResource, + ItemResourceFunctionToolCallResource, + ItemResourceImageGenToolCall, + ItemResourceLocalShellToolCall, + ItemResourceLocalShellToolCallOutput, + ItemResourceMcpApprovalRequest, + ItemResourceMcpApprovalResponseResource, + ItemResourceMcpListTools, + ItemResourceMcpToolCall, + ItemResourceOutputMessage, + ItemResourceWebSearchToolCall, + ItemWebSearchToolCall, + KeyPressAction, LocalShellExecAction, - LocalShellTool, - LocalShellToolCallItemParam, - LocalShellToolCallItemResource, - LocalShellToolCallOutputItemParam, - LocalShellToolCallOutputItemResource, - Location, + LocalShellToolParam, LogProb, - MCPApprovalRequestItemParam, - MCPApprovalRequestItemResource, - MCPApprovalResponseItemParam, - MCPApprovalResponseItemResource, - MCPCallItemParam, - MCPCallItemResource, - MCPListToolsItemParam, - MCPListToolsItemResource, + MCPApprovalResponse, MCPListToolsTool, + MCPListToolsToolAnnotations, + MCPListToolsToolInputSchema, MCPTool, - MCPToolAllowedTools1, - MCPToolRequireApproval1, - MCPToolRequireApprovalAlways, - MCPToolRequireApprovalNever, + MCPToolFilter, + MCPToolRequireApproval, ManagedAzureAISearchIndex, MemoryItem, MemoryOperation, @@ -202,15 +246,15 @@ MemoryStoreDeleteScopeResult, MemoryStoreDetails, MemoryStoreOperationUsage, - MemoryStoreOperationUsageInputTokensDetails, - MemoryStoreOperationUsageOutputTokensDetails, MemoryStoreSearchResult, MemoryStoreUpdateCompletedResult, MemoryStoreUpdateResult, + Metadata, MicrosoftFabricAgentTool, ModelDeployment, ModelDeploymentSku, MonthlyRecurrenceSchedule, + Move, NoAuthenticationCredentials, OAuthConsentRequestItemResource, OneTimeTrigger, @@ -223,6 +267,31 @@ OpenApiManagedSecurityScheme, OpenApiProjectConnectionAuthDetails, OpenApiProjectConnectionSecurityScheme, + OutputContent, + OutputContentOutputTextContent, + 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, @@ -233,14 +302,15 @@ RaiConfig, RankingOptions, Reasoning, - ReasoningItemParam, - ReasoningItemResource, - ReasoningItemSummaryPart, - ReasoningItemSummaryTextPart, + ReasoningTextContent, RecurrenceSchedule, RecurrenceTrigger, RedTeam, Response, + ResponseAudioDeltaEvent, + ResponseAudioDoneEvent, + ResponseAudioTranscriptDeltaEvent, + ResponseAudioTranscriptDoneEvent, ResponseCodeInterpreterCallCodeDeltaEvent, ResponseCodeInterpreterCallCodeDoneEvent, ResponseCodeInterpreterCallCompletedEvent, @@ -249,14 +319,16 @@ ResponseCompletedEvent, ResponseContentPartAddedEvent, ResponseContentPartDoneEvent, - ResponseConversation1, ResponseCreatedEvent, + ResponseCustomToolCallInputDeltaEvent, + ResponseCustomToolCallInputDoneEvent, ResponseError, ResponseErrorEvent, ResponseFailedEvent, ResponseFileSearchCallCompletedEvent, ResponseFileSearchCallInProgressEvent, ResponseFileSearchCallSearchingEvent, + ResponseFormatJsonSchemaSchema, ResponseFunctionCallArgumentsDeltaEvent, ResponseFunctionCallArgumentsDoneEvent, ResponseImageGenCallCompletedEvent, @@ -264,8 +336,10 @@ ResponseImageGenCallInProgressEvent, ResponseImageGenCallPartialImageEvent, ResponseInProgressEvent, - ResponseIncompleteDetails1, + ResponseIncompleteDetails, ResponseIncompleteEvent, + ResponseLogProb, + ResponseLogProbTopLogprobs, ResponseMCPCallArgumentsDeltaEvent, ResponseMCPCallArgumentsDoneEvent, ResponseMCPCallCompletedEvent, @@ -276,76 +350,80 @@ ResponseMCPListToolsInProgressEvent, ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, + ResponseOutputTextAnnotationAddedEvent, ResponsePromptVariables, ResponseQueuedEvent, - ResponseReasoningDeltaEvent, - ResponseReasoningDoneEvent, - ResponseReasoningSummaryDeltaEvent, - ResponseReasoningSummaryDoneEvent, ResponseReasoningSummaryPartAddedEvent, + ResponseReasoningSummaryPartAddedEventPart, ResponseReasoningSummaryPartDoneEvent, + ResponseReasoningSummaryPartDoneEventPart, ResponseReasoningSummaryTextDeltaEvent, ResponseReasoningSummaryTextDoneEvent, + ResponseReasoningTextDeltaEvent, + ResponseReasoningTextDoneEvent, ResponseRefusalDeltaEvent, ResponseRefusalDoneEvent, - ResponseStreamEvent, - ResponseText, ResponseTextDeltaEvent, ResponseTextDoneEvent, - ResponseTextFormatConfiguration, - ResponseTextFormatConfigurationJsonObject, - ResponseTextFormatConfigurationJsonSchema, - ResponseTextFormatConfigurationText, + ResponseTextParam, ResponseUsage, + ResponseUsageInputTokensDetails, + ResponseUsageOutputTokensDetails, ResponseWebSearchCallCompletedEvent, ResponseWebSearchCallInProgressEvent, ResponseWebSearchCallSearchingEvent, - ResponsesAssistantMessageItemParam, - ResponsesAssistantMessageItemResource, - ResponsesDeveloperMessageItemParam, - ResponsesDeveloperMessageItemResource, - ResponsesMessageItemParam, - ResponsesMessageItemResource, - ResponsesSystemMessageItemParam, - ResponsesSystemMessageItemResource, - ResponsesUserMessageItemParam, - ResponsesUserMessageItemResource, SASCredentials, Schedule, ScheduleRun, ScheduleTask, + Screenshot, + Scroll, SharepointAgentTool, SharepointGroundingToolParameters, + SpecificApplyPatchParam, + SpecificFunctionShellParam, StructuredInputDefinition, StructuredOutputDefinition, StructuredOutputsItemResource, + Summary, Target, TargetConfig, TaxonomyCategory, TaxonomySubCategory, + TextResponseFormatConfiguration, + TextResponseFormatConfigurationResponseFormatJsonObject, + TextResponseFormatConfigurationResponseFormatText, + TextResponseFormatJsonSchema, Tool, - ToolChoiceObject, - ToolChoiceObjectCodeInterpreter, - ToolChoiceObjectComputer, - ToolChoiceObjectFileSearch, - ToolChoiceObjectFunction, - ToolChoiceObjectImageGen, - ToolChoiceObjectMCP, - ToolChoiceObjectWebSearch, + ToolChoiceAllowed, + ToolChoiceCodeInterpreter, + ToolChoiceComputerUsePreview, + ToolChoiceCustom, + ToolChoiceFileSearch, + ToolChoiceFunction, + ToolChoiceImageGeneration, + ToolChoiceMCP, + ToolChoiceParam, + ToolChoiceWebSearchPreview, + ToolChoiceWebSearchPreview20250311, ToolDescription, ToolProjectConnection, TopLogProb, Trigger, + Type, + UrlCitationBody, UserProfileMemoryItem, VectorStoreFileAttributes, - WebSearchAction, + Wait, WebSearchActionFind, WebSearchActionOpenPage, WebSearchActionSearch, WebSearchActionSearchSources, + WebSearchApproximateLocation, + WebSearchConfiguration, WebSearchPreviewTool, - WebSearchToolCallItemParam, - WebSearchToolCallItemResource, + WebSearchTool, + WebSearchToolFilters, WeeklyRecurrenceSchedule, WorkflowActionOutputItemResource, WorkflowAgentDefinition, @@ -355,16 +433,25 @@ AgentKind, AgentProtocol, AnnotationType, + ApplyPatchCallOutputStatus, + ApplyPatchCallOutputStatusParam, + ApplyPatchCallStatus, + ApplyPatchCallStatusParam, + ApplyPatchFileOperationType, + ApplyPatchOperationParamType, AttackStrategy, AzureAISearchQueryType, - CodeInterpreterOutputType, + ClickButtonType, ComputerActionType, - ComputerToolCallOutputItemOutputType, + ComputerEnvironment, ConnectionType, + ContainerMemoryLimit, CredentialType, + CustomToolParamFormatType, DatasetType, DayOfWeek, DeploymentType, + DetailEnum, EvaluationRuleActionType, EvaluationRuleEventType, EvaluationTaxonomyInputType, @@ -373,36 +460,46 @@ EvaluatorMetricDirection, EvaluatorMetricType, EvaluatorType, + FunctionAndCustomToolCallOutputType, + FunctionCallItemStatus, + FunctionShellCallItemStatus, + FunctionShellCallOutputOutcomeParamType, + FunctionShellCallOutputOutcomeType, + GrammarSyntax1, + ImageDetail, IndexType, + InputContentType, + InputFidelity, + InputItemType, InsightType, - ItemContentType, + ItemResourceType, ItemType, - LocationType, + LocalShellCallStatus, + MCPToolCallStatus, MemoryItemKind, MemoryOperationKind, MemoryStoreKind, MemoryStoreUpdateStatus, OpenApiAuthType, OperationState, + OutputContentType, + OutputItemType, + OutputMessageContentType, + PageOrder, PendingUploadType, - ReasoningEffort, - ReasoningItemSummaryPartType, + RankerVersionType, RecurrenceType, ResponseErrorCode, - ResponseStreamEventType, - ResponseTextFormatConfigurationType, - ResponsesMessageRole, RiskCategory, SampleType, ScheduleProvisioningStatus, ScheduleTaskType, - ServiceTier, - ToolChoiceObjectType, - ToolChoiceOptions, + SearchContextSize, + TextResponseFormatConfigurationType, + ToolChoiceParamType, ToolType, TreatmentEffectType, TriggerType, - WebSearchActionType, ) from ._patch import __all__ as _patch_all from ._patch import * @@ -422,11 +519,19 @@ "AgentVersionDetails", "AgenticIdentityCredentials", "Annotation", - "AnnotationFileCitation", - "AnnotationFilePath", - "AnnotationUrlCitation", "ApiErrorResponse", "ApiKeyCredentials", + "ApplyPatchCreateFileOperation", + "ApplyPatchCreateFileOperationParam", + "ApplyPatchDeleteFileOperation", + "ApplyPatchDeleteFileOperationParam", + "ApplyPatchFileOperation", + "ApplyPatchOperationParam", + "ApplyPatchToolCallItemParam", + "ApplyPatchToolCallOutputItemParam", + "ApplyPatchToolParam", + "ApplyPatchUpdateFileOperation", + "ApplyPatchUpdateFileOperationParam", "ApproximateLocation", "AzureAIAgentTarget", "AzureAISearchAgentTool", @@ -453,44 +558,35 @@ "CaptureStructuredOutputsTool", "ChartCoordinate", "ChatSummaryMemoryItem", + "ClickParam", "ClusterInsightResult", "ClusterTokenUsage", "CodeBasedEvaluatorDefinition", - "CodeInterpreterOutput", + "CodeInterpreterContainerAuto", "CodeInterpreterOutputImage", "CodeInterpreterOutputLogs", "CodeInterpreterTool", - "CodeInterpreterToolAuto", - "CodeInterpreterToolCallItemParam", - "CodeInterpreterToolCallItemResource", + "CompactionSummaryItemParam", "ComparisonFilter", "CompoundFilter", "ComputerAction", - "ComputerActionClick", - "ComputerActionDoubleClick", - "ComputerActionDrag", - "ComputerActionKeyPress", - "ComputerActionMove", - "ComputerActionScreenshot", - "ComputerActionScroll", - "ComputerActionTypeKeys", - "ComputerActionWait", - "ComputerToolCallItemParam", - "ComputerToolCallItemResource", - "ComputerToolCallOutputItemOutput", - "ComputerToolCallOutputItemOutputComputerScreenshot", - "ComputerToolCallOutputItemParam", - "ComputerToolCallOutputItemResource", - "ComputerToolCallSafetyCheck", + "ComputerCallOutputItemParam", + "ComputerCallSafetyCheckParam", + "ComputerScreenshotImage", "ComputerUsePreviewTool", "Connection", "ContainerAppAgentDefinition", + "ContainerFileCitationBody", "ContinuousEvaluationRuleAction", - "Coordinate", + "ConversationReference", "CosmosDBIndex", "CreatedBy", "CronTrigger", "CustomCredential", + "CustomGrammarFormatParam", + "CustomTextFormatParam", + "CustomToolParam", + "CustomToolParamFormat", "DailyRecurrenceSchedule", "DatasetCredential", "DatasetVersion", @@ -498,6 +594,10 @@ "DeleteAgentVersionResponse", "DeleteMemoryStoreResult", "Deployment", + "DoubleClickAction", + "Drag", + "DragPoint", + "EasyInputMessage", "EmbeddingConfiguration", "EntraIDCredentials", "Error", @@ -521,26 +621,52 @@ "EvaluatorVersion", "FabricDataAgentToolParameters", "FieldMapping", + "FileCitationBody", "FileDatasetVersion", + "FilePath", "FileSearchTool", - "FileSearchToolCallItemParam", - "FileSearchToolCallItemParamResult", - "FileSearchToolCallItemResource", + "FileSearchToolCallResults", "FolderDatasetVersion", + "FunctionAndCustomToolCallOutput", + "FunctionAndCustomToolCallOutputInputFileContent", + "FunctionAndCustomToolCallOutputInputImageContent", + "FunctionAndCustomToolCallOutputInputTextContent", + "FunctionCallOutputItemParam", + "FunctionShellAction", + "FunctionShellActionParam", + "FunctionShellCallItemParam", + "FunctionShellCallOutputContent", + "FunctionShellCallOutputContentParam", + "FunctionShellCallOutputExitOutcome", + "FunctionShellCallOutputExitOutcomeParam", + "FunctionShellCallOutputItemParam", + "FunctionShellCallOutputOutcome", + "FunctionShellCallOutputOutcomeParam", + "FunctionShellCallOutputTimeoutOutcome", + "FunctionShellCallOutputTimeoutOutcomeParam", + "FunctionShellToolParam", "FunctionTool", - "FunctionToolCallItemParam", - "FunctionToolCallItemResource", - "FunctionToolCallOutputItemParam", - "FunctionToolCallOutputItemResource", "HostedAgentDefinition", "HourlyRecurrenceSchedule", "HumanEvaluationRuleAction", + "HybridSearchOptions", "ImageBasedHostedAgentDefinition", "ImageGenTool", - "ImageGenToolCallItemParam", - "ImageGenToolCallItemResource", "ImageGenToolInputImageMask", "Index", + "InputContent", + "InputContentInputFileContent", + "InputContentInputImageContent", + "InputContentInputTextContent", + "InputFileContent", + "InputFileContentParam", + "InputImageContent", + "InputImageContentParamAutoParam", + "InputItem", + "InputMessage", + "InputMessageResource", + "InputTextContent", + "InputTextContentParam", "Insight", "InsightCluster", "InsightModelConfiguration", @@ -550,39 +676,54 @@ "InsightScheduleTask", "InsightSummary", "InsightsMetadata", - "ItemContent", - "ItemContentInputAudio", - "ItemContentInputFile", - "ItemContentInputImage", - "ItemContentInputText", - "ItemContentOutputAudio", - "ItemContentOutputText", - "ItemContentRefusal", - "ItemParam", - "ItemReferenceItemParam", + "Item", + "ItemCodeInterpreterToolCall", + "ItemComputerToolCall", + "ItemCustomToolCall", + "ItemCustomToolCallOutput", + "ItemFileSearchToolCall", + "ItemFunctionToolCall", + "ItemImageGenToolCall", + "ItemLocalShellToolCall", + "ItemLocalShellToolCallOutput", + "ItemMcpApprovalRequest", + "ItemMcpListTools", + "ItemMcpToolCall", + "ItemOutputMessage", + "ItemReasoningItem", + "ItemReferenceParam", "ItemResource", + "ItemResourceApplyPatchToolCall", + "ItemResourceApplyPatchToolCallOutput", + "ItemResourceCodeInterpreterToolCall", + "ItemResourceComputerToolCall", + "ItemResourceComputerToolCallOutputResource", + "ItemResourceFileSearchToolCall", + "ItemResourceFunctionShellCall", + "ItemResourceFunctionShellCallOutput", + "ItemResourceFunctionToolCallOutputResource", + "ItemResourceFunctionToolCallResource", + "ItemResourceImageGenToolCall", + "ItemResourceLocalShellToolCall", + "ItemResourceLocalShellToolCallOutput", + "ItemResourceMcpApprovalRequest", + "ItemResourceMcpApprovalResponseResource", + "ItemResourceMcpListTools", + "ItemResourceMcpToolCall", + "ItemResourceOutputMessage", + "ItemResourceWebSearchToolCall", + "ItemWebSearchToolCall", + "KeyPressAction", "LocalShellExecAction", - "LocalShellTool", - "LocalShellToolCallItemParam", - "LocalShellToolCallItemResource", - "LocalShellToolCallOutputItemParam", - "LocalShellToolCallOutputItemResource", - "Location", + "LocalShellToolParam", "LogProb", - "MCPApprovalRequestItemParam", - "MCPApprovalRequestItemResource", - "MCPApprovalResponseItemParam", - "MCPApprovalResponseItemResource", - "MCPCallItemParam", - "MCPCallItemResource", - "MCPListToolsItemParam", - "MCPListToolsItemResource", + "MCPApprovalResponse", "MCPListToolsTool", + "MCPListToolsToolAnnotations", + "MCPListToolsToolInputSchema", "MCPTool", - "MCPToolAllowedTools1", - "MCPToolRequireApproval1", - "MCPToolRequireApprovalAlways", - "MCPToolRequireApprovalNever", + "MCPToolFilter", + "MCPToolRequireApproval", "ManagedAzureAISearchIndex", "MemoryItem", "MemoryOperation", @@ -597,15 +738,15 @@ "MemoryStoreDeleteScopeResult", "MemoryStoreDetails", "MemoryStoreOperationUsage", - "MemoryStoreOperationUsageInputTokensDetails", - "MemoryStoreOperationUsageOutputTokensDetails", "MemoryStoreSearchResult", "MemoryStoreUpdateCompletedResult", "MemoryStoreUpdateResult", + "Metadata", "MicrosoftFabricAgentTool", "ModelDeployment", "ModelDeploymentSku", "MonthlyRecurrenceSchedule", + "Move", "NoAuthenticationCredentials", "OAuthConsentRequestItemResource", "OneTimeTrigger", @@ -618,6 +759,31 @@ "OpenApiManagedSecurityScheme", "OpenApiProjectConnectionAuthDetails", "OpenApiProjectConnectionSecurityScheme", + "OutputContent", + "OutputContentOutputTextContent", + "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", @@ -628,14 +794,15 @@ "RaiConfig", "RankingOptions", "Reasoning", - "ReasoningItemParam", - "ReasoningItemResource", - "ReasoningItemSummaryPart", - "ReasoningItemSummaryTextPart", + "ReasoningTextContent", "RecurrenceSchedule", "RecurrenceTrigger", "RedTeam", "Response", + "ResponseAudioDeltaEvent", + "ResponseAudioDoneEvent", + "ResponseAudioTranscriptDeltaEvent", + "ResponseAudioTranscriptDoneEvent", "ResponseCodeInterpreterCallCodeDeltaEvent", "ResponseCodeInterpreterCallCodeDoneEvent", "ResponseCodeInterpreterCallCompletedEvent", @@ -644,14 +811,16 @@ "ResponseCompletedEvent", "ResponseContentPartAddedEvent", "ResponseContentPartDoneEvent", - "ResponseConversation1", "ResponseCreatedEvent", + "ResponseCustomToolCallInputDeltaEvent", + "ResponseCustomToolCallInputDoneEvent", "ResponseError", "ResponseErrorEvent", "ResponseFailedEvent", "ResponseFileSearchCallCompletedEvent", "ResponseFileSearchCallInProgressEvent", "ResponseFileSearchCallSearchingEvent", + "ResponseFormatJsonSchemaSchema", "ResponseFunctionCallArgumentsDeltaEvent", "ResponseFunctionCallArgumentsDoneEvent", "ResponseImageGenCallCompletedEvent", @@ -659,8 +828,10 @@ "ResponseImageGenCallInProgressEvent", "ResponseImageGenCallPartialImageEvent", "ResponseInProgressEvent", - "ResponseIncompleteDetails1", + "ResponseIncompleteDetails", "ResponseIncompleteEvent", + "ResponseLogProb", + "ResponseLogProbTopLogprobs", "ResponseMCPCallArgumentsDeltaEvent", "ResponseMCPCallArgumentsDoneEvent", "ResponseMCPCallCompletedEvent", @@ -671,92 +842,105 @@ "ResponseMCPListToolsInProgressEvent", "ResponseOutputItemAddedEvent", "ResponseOutputItemDoneEvent", + "ResponseOutputTextAnnotationAddedEvent", "ResponsePromptVariables", "ResponseQueuedEvent", - "ResponseReasoningDeltaEvent", - "ResponseReasoningDoneEvent", - "ResponseReasoningSummaryDeltaEvent", - "ResponseReasoningSummaryDoneEvent", "ResponseReasoningSummaryPartAddedEvent", + "ResponseReasoningSummaryPartAddedEventPart", "ResponseReasoningSummaryPartDoneEvent", + "ResponseReasoningSummaryPartDoneEventPart", "ResponseReasoningSummaryTextDeltaEvent", "ResponseReasoningSummaryTextDoneEvent", + "ResponseReasoningTextDeltaEvent", + "ResponseReasoningTextDoneEvent", "ResponseRefusalDeltaEvent", "ResponseRefusalDoneEvent", - "ResponseStreamEvent", - "ResponseText", "ResponseTextDeltaEvent", "ResponseTextDoneEvent", - "ResponseTextFormatConfiguration", - "ResponseTextFormatConfigurationJsonObject", - "ResponseTextFormatConfigurationJsonSchema", - "ResponseTextFormatConfigurationText", + "ResponseTextParam", "ResponseUsage", + "ResponseUsageInputTokensDetails", + "ResponseUsageOutputTokensDetails", "ResponseWebSearchCallCompletedEvent", "ResponseWebSearchCallInProgressEvent", "ResponseWebSearchCallSearchingEvent", - "ResponsesAssistantMessageItemParam", - "ResponsesAssistantMessageItemResource", - "ResponsesDeveloperMessageItemParam", - "ResponsesDeveloperMessageItemResource", - "ResponsesMessageItemParam", - "ResponsesMessageItemResource", - "ResponsesSystemMessageItemParam", - "ResponsesSystemMessageItemResource", - "ResponsesUserMessageItemParam", - "ResponsesUserMessageItemResource", "SASCredentials", "Schedule", "ScheduleRun", "ScheduleTask", + "Screenshot", + "Scroll", "SharepointAgentTool", "SharepointGroundingToolParameters", + "SpecificApplyPatchParam", + "SpecificFunctionShellParam", "StructuredInputDefinition", "StructuredOutputDefinition", "StructuredOutputsItemResource", + "Summary", "Target", "TargetConfig", "TaxonomyCategory", "TaxonomySubCategory", + "TextResponseFormatConfiguration", + "TextResponseFormatConfigurationResponseFormatJsonObject", + "TextResponseFormatConfigurationResponseFormatText", + "TextResponseFormatJsonSchema", "Tool", - "ToolChoiceObject", - "ToolChoiceObjectCodeInterpreter", - "ToolChoiceObjectComputer", - "ToolChoiceObjectFileSearch", - "ToolChoiceObjectFunction", - "ToolChoiceObjectImageGen", - "ToolChoiceObjectMCP", - "ToolChoiceObjectWebSearch", + "ToolChoiceAllowed", + "ToolChoiceCodeInterpreter", + "ToolChoiceComputerUsePreview", + "ToolChoiceCustom", + "ToolChoiceFileSearch", + "ToolChoiceFunction", + "ToolChoiceImageGeneration", + "ToolChoiceMCP", + "ToolChoiceParam", + "ToolChoiceWebSearchPreview", + "ToolChoiceWebSearchPreview20250311", "ToolDescription", "ToolProjectConnection", "TopLogProb", "Trigger", + "Type", + "UrlCitationBody", "UserProfileMemoryItem", "VectorStoreFileAttributes", - "WebSearchAction", + "Wait", "WebSearchActionFind", "WebSearchActionOpenPage", "WebSearchActionSearch", "WebSearchActionSearchSources", + "WebSearchApproximateLocation", + "WebSearchConfiguration", "WebSearchPreviewTool", - "WebSearchToolCallItemParam", - "WebSearchToolCallItemResource", + "WebSearchTool", + "WebSearchToolFilters", "WeeklyRecurrenceSchedule", "WorkflowActionOutputItemResource", "WorkflowAgentDefinition", "AgentKind", "AgentProtocol", "AnnotationType", + "ApplyPatchCallOutputStatus", + "ApplyPatchCallOutputStatusParam", + "ApplyPatchCallStatus", + "ApplyPatchCallStatusParam", + "ApplyPatchFileOperationType", + "ApplyPatchOperationParamType", "AttackStrategy", "AzureAISearchQueryType", - "CodeInterpreterOutputType", + "ClickButtonType", "ComputerActionType", - "ComputerToolCallOutputItemOutputType", + "ComputerEnvironment", "ConnectionType", + "ContainerMemoryLimit", "CredentialType", + "CustomToolParamFormatType", "DatasetType", "DayOfWeek", "DeploymentType", + "DetailEnum", "EvaluationRuleActionType", "EvaluationRuleEventType", "EvaluationTaxonomyInputType", @@ -765,36 +949,46 @@ "EvaluatorMetricDirection", "EvaluatorMetricType", "EvaluatorType", + "FunctionAndCustomToolCallOutputType", + "FunctionCallItemStatus", + "FunctionShellCallItemStatus", + "FunctionShellCallOutputOutcomeParamType", + "FunctionShellCallOutputOutcomeType", + "GrammarSyntax1", + "ImageDetail", "IndexType", + "InputContentType", + "InputFidelity", + "InputItemType", "InsightType", - "ItemContentType", + "ItemResourceType", "ItemType", - "LocationType", + "LocalShellCallStatus", + "MCPToolCallStatus", "MemoryItemKind", "MemoryOperationKind", "MemoryStoreKind", "MemoryStoreUpdateStatus", "OpenApiAuthType", "OperationState", + "OutputContentType", + "OutputItemType", + "OutputMessageContentType", + "PageOrder", "PendingUploadType", - "ReasoningEffort", - "ReasoningItemSummaryPartType", + "RankerVersionType", "RecurrenceType", "ResponseErrorCode", - "ResponseStreamEventType", - "ResponseTextFormatConfigurationType", - "ResponsesMessageRole", "RiskCategory", "SampleType", "ScheduleProvisioningStatus", "ScheduleTaskType", - "ServiceTier", - "ToolChoiceObjectType", - "ToolChoiceOptions", + "SearchContextSize", + "TextResponseFormatConfigurationType", + "ToolChoiceParamType", "ToolType", "TreatmentEffectType", "TriggerType", - "WebSearchActionType", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_enums.py index 62d671d2c619..08ef6c9826f6 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 @@ -31,8 +31,52 @@ class AnnotationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): FILE_CITATION = "file_citation" URL_CITATION = "url_citation" - FILE_PATH = "file_path" CONTAINER_FILE_CITATION = "container_file_citation" + FILE_PATH = "file_path" + + +class ApplyPatchCallOutputStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ApplyPatchCallOutputStatus.""" + + COMPLETED = "completed" + FAILED = "failed" + + +class ApplyPatchCallOutputStatusParam(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Apply patch call output status.""" + + COMPLETED = "completed" + FAILED = "failed" + + +class ApplyPatchCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ApplyPatchCallStatus.""" + + IN_PROGRESS = "in_progress" + COMPLETED = "completed" + + +class ApplyPatchCallStatusParam(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Apply patch call status.""" + + IN_PROGRESS = "in_progress" + COMPLETED = "completed" + + +class ApplyPatchFileOperationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ApplyPatchFileOperationType.""" + + CREATE_FILE = "create_file" + DELETE_FILE = "delete_file" + UPDATE_FILE = "update_file" + + +class ApplyPatchOperationParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ApplyPatchOperationParamType.""" + + CREATE_FILE = "create_file" + DELETE_FILE = "delete_file" + UPDATE_FILE = "update_file" class AttackStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -121,31 +165,38 @@ class AzureAISearchQueryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Query type ``vector_semantic_hybrid``""" -class CodeInterpreterOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of CodeInterpreterOutputType.""" +class ClickButtonType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ClickButtonType.""" - LOGS = "logs" - IMAGE = "image" + LEFT = "left" + RIGHT = "right" + WHEEL = "wheel" + BACK = "back" + FORWARD = "forward" class ComputerActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of ComputerActionType.""" - SCREENSHOT = "screenshot" CLICK = "click" DOUBLE_CLICK = "double_click" + DRAG = "drag" + KEYPRESS = "keypress" + MOVE = "move" + SCREENSHOT = "screenshot" SCROLL = "scroll" TYPE = "type" WAIT = "wait" - KEYPRESS = "keypress" - DRAG = "drag" - MOVE = "move" -class ComputerToolCallOutputItemOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """A computer screenshot image used with the computer use tool.""" +class ComputerEnvironment(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ComputerEnvironment.""" - SCREENSHOT = "computer_screenshot" + WINDOWS = "windows" + MAC = "mac" + LINUX = "linux" + UBUNTU = "ubuntu" + BROWSER = "browser" class ConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -173,6 +224,15 @@ class ConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Remote tool""" +class ContainerMemoryLimit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ContainerMemoryLimit.""" + + ENUM_1_G = "1g" + ENUM_4_G = "4g" + ENUM_16_G = "16g" + ENUM_64_G = "64g" + + class CredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The credential type used by the connection.""" @@ -190,6 +250,13 @@ class CredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Agentic identity credential""" +class CustomToolParamFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of CustomToolParamFormatType.""" + + TEXT = "text" + GRAMMAR = "grammar" + + class DatasetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Enum to determine the type of data.""" @@ -225,6 +292,14 @@ class DeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Model deployment""" +class DetailEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of DetailEnum.""" + + LOW = "low" + HIGH = "high" + AUTO = "auto" + + class EvaluationRuleActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of the evaluation action.""" @@ -311,6 +386,59 @@ class EvaluatorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Custom evaluator""" +class FunctionAndCustomToolCallOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of FunctionAndCustomToolCallOutputType.""" + + INPUT_TEXT = "input_text" + INPUT_IMAGE = "input_image" + INPUT_FILE = "input_file" + + +class FunctionCallItemStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of FunctionCallItemStatus.""" + + IN_PROGRESS = "in_progress" + COMPLETED = "completed" + INCOMPLETE = "incomplete" + + +class FunctionShellCallItemStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Shell call status.""" + + IN_PROGRESS = "in_progress" + COMPLETED = "completed" + INCOMPLETE = "incomplete" + + +class FunctionShellCallOutputOutcomeParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of FunctionShellCallOutputOutcomeParamType.""" + + TIMEOUT = "timeout" + EXIT = "exit" + + +class FunctionShellCallOutputOutcomeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of FunctionShellCallOutputOutcomeType.""" + + TIMEOUT = "timeout" + EXIT = "exit" + + +class GrammarSyntax1(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of GrammarSyntax1.""" + + LARK = "lark" + REGEX = "regex" + + +class ImageDetail(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ImageDetail.""" + + LOW = "low" + HIGH = "high" + AUTO = "auto" + + class IndexType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of IndexType.""" @@ -322,6 +450,31 @@ class IndexType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Managed Azure Search""" +class InputContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of InputContentType.""" + + INPUT_TEXT = "input_text" + INPUT_IMAGE = "input_image" + INPUT_FILE = "input_file" + + +class InputFidelity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Control how much effort the model will exert to match the style and features, especially facial + features, of input images. This parameter is only supported for ``gpt-image-1``. Unsupported + for ``gpt-image-1-mini``. Supports ``high`` and ``low``. Defaults to ``low``. + """ + + HIGH = "high" + LOW = "low" + + +class InputItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of InputItemType.""" + + MESSAGE = "message" + ITEM_REFERENCE = "item_reference" + + class InsightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The request of the insights.""" @@ -333,48 +486,80 @@ class InsightType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Evaluation Comparison.""" -class ItemContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Multi-modal input and output contents.""" +class ItemResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ItemResourceType.""" - INPUT_TEXT = "input_text" - INPUT_AUDIO = "input_audio" - INPUT_IMAGE = "input_image" - INPUT_FILE = "input_file" - OUTPUT_TEXT = "output_text" - OUTPUT_AUDIO = "output_audio" - REFUSAL = "refusal" + MESSAGE = "message" + OUTPUT_MESSAGE = "output_message" + FILE_SEARCH_CALL = "file_search_call" + COMPUTER_CALL = "computer_call" + COMPUTER_CALL_OUTPUT = "computer_call_output" + WEB_SEARCH_CALL = "web_search_call" + FUNCTION_CALL = "function_call" + FUNCTION_CALL_OUTPUT = "function_call_output" + IMAGE_GENERATION_CALL = "image_generation_call" + CODE_INTERPRETER_CALL = "code_interpreter_call" + LOCAL_SHELL_CALL = "local_shell_call" + LOCAL_SHELL_CALL_OUTPUT = "local_shell_call_output" + SHELL_CALL = "shell_call" + SHELL_CALL_OUTPUT = "shell_call_output" + APPLY_PATCH_CALL = "apply_patch_call" + APPLY_PATCH_CALL_OUTPUT = "apply_patch_call_output" + MCP_LIST_TOOLS = "mcp_list_tools" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + MCP_CALL = "mcp_call" class ItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of ItemType.""" MESSAGE = "message" + OUTPUT_MESSAGE = "output_message" FILE_SEARCH_CALL = "file_search_call" - FUNCTION_CALL = "function_call" - FUNCTION_CALL_OUTPUT = "function_call_output" COMPUTER_CALL = "computer_call" COMPUTER_CALL_OUTPUT = "computer_call_output" WEB_SEARCH_CALL = "web_search_call" + FUNCTION_CALL = "function_call" + FUNCTION_CALL_OUTPUT = "function_call_output" REASONING = "reasoning" - ITEM_REFERENCE = "item_reference" + COMPACTION = "compaction" IMAGE_GENERATION_CALL = "image_generation_call" CODE_INTERPRETER_CALL = "code_interpreter_call" LOCAL_SHELL_CALL = "local_shell_call" LOCAL_SHELL_CALL_OUTPUT = "local_shell_call_output" + SHELL_CALL = "shell_call" + SHELL_CALL_OUTPUT = "shell_call_output" + APPLY_PATCH_CALL = "apply_patch_call" + APPLY_PATCH_CALL_OUTPUT = "apply_patch_call_output" MCP_LIST_TOOLS = "mcp_list_tools" MCP_APPROVAL_REQUEST = "mcp_approval_request" MCP_APPROVAL_RESPONSE = "mcp_approval_response" MCP_CALL = "mcp_call" + CUSTOM_TOOL_CALL_OUTPUT = "custom_tool_call_output" + CUSTOM_TOOL_CALL = "custom_tool_call" STRUCTURED_OUTPUTS = "structured_outputs" WORKFLOW_ACTION = "workflow_action" MEMORY_SEARCH_CALL = "memory_search_call" OAUTH_CONSENT_REQUEST = "oauth_consent_request" -class LocationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of LocationType.""" +class LocalShellCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of LocalShellCallStatus.""" - APPROXIMATE = "approximate" + IN_PROGRESS = "in_progress" + COMPLETED = "completed" + INCOMPLETE = "incomplete" + + +class MCPToolCallStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of MCPToolCallStatus.""" + + IN_PROGRESS = "in_progress" + COMPLETED = "completed" + INCOMPLETE = "incomplete" + CALLING = "calling" + FAILED = "failed" class MemoryItemKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -442,43 +627,65 @@ class OperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The operation has been canceled by the user.""" -class PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of pending upload.""" +class OutputContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of OutputContentType.""" - NONE = "None" - """No pending upload.""" - BLOB_REFERENCE = "BlobReference" - """Blob Reference is the only supported type.""" + OUTPUT_TEXT = "output_text" + REFUSAL = "refusal" + REASONING_TEXT = "reasoning_text" -class ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Constrains effort on reasoning for reasoning models. +class OutputItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of OutputItemType.""" - Currently supported values are none, minimal, low, medium, and high. + OUTPUT_MESSAGE = "output_message" + FILE_SEARCH_CALL = "file_search_call" + FUNCTION_CALL = "function_call" + WEB_SEARCH_CALL = "web_search_call" + COMPUTER_CALL = "computer_call" + REASONING = "reasoning" + COMPACTION = "compaction" + IMAGE_GENERATION_CALL = "image_generation_call" + CODE_INTERPRETER_CALL = "code_interpreter_call" + LOCAL_SHELL_CALL = "local_shell_call" + SHELL_CALL = "shell_call" + SHELL_CALL_OUTPUT = "shell_call_output" + APPLY_PATCH_CALL = "apply_patch_call" + APPLY_PATCH_CALL_OUTPUT = "apply_patch_call_output" + MCP_CALL = "mcp_call" + MCP_LIST_TOOLS = "mcp_list_tools" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + CUSTOM_TOOL_CALL = "custom_tool_call" - Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in - a response. - gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for - gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in - gpt-5.1. +class OutputMessageContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of OutputMessageContentType.""" - All models before gpt-5.1 default to medium reasoning effort, and do not support none. + OUTPUT_TEXT = "output_text" + REFUSAL = "refusal" - The gpt-5-pro model defaults to (and only supports) high reasoning effort. - """ - NONE = "none" - MINIMAL = "minimal" - LOW = "low" - MEDIUM = "medium" - HIGH = "high" +class PageOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of PageOrder.""" + ASC = "asc" + DESC = "desc" -class ReasoningItemSummaryPartType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ReasoningItemSummaryPartType.""" - SUMMARY_TEXT = "summary_text" +class PendingUploadType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of pending upload.""" + + NONE = "None" + """No pending upload.""" + BLOB_REFERENCE = "BlobReference" + """Blob Reference is the only supported type.""" + + +class RankerVersionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RankerVersionType.""" + + AUTO = "auto" + DEFAULT2024_11_15 = "default-2024-11-15" class RecurrenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -517,94 +724,6 @@ class ResponseErrorCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): IMAGE_FILE_NOT_FOUND = "image_file_not_found" -class ResponsesMessageRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The collection of valid roles for responses message items.""" - - SYSTEM = "system" - DEVELOPER = "developer" - USER = "user" - ASSISTANT = "assistant" - - -class ResponseStreamEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ResponseStreamEventType.""" - - RESPONSE_AUDIO_DELTA = "response.audio.delta" - RESPONSE_AUDIO_DONE = "response.audio.done" - RESPONSE_AUDIO_TRANSCRIPT_DELTA = "response.audio_transcript.delta" - RESPONSE_AUDIO_TRANSCRIPT_DONE = "response.audio_transcript.done" - RESPONSE_CODE_INTERPRETER_CALL_CODE_DELTA = "response.code_interpreter_call_code.delta" - RESPONSE_CODE_INTERPRETER_CALL_CODE_DONE = "response.code_interpreter_call_code.done" - RESPONSE_CODE_INTERPRETER_CALL_COMPLETED = "response.code_interpreter_call.completed" - RESPONSE_CODE_INTERPRETER_CALL_IN_PROGRESS = "response.code_interpreter_call.in_progress" - RESPONSE_CODE_INTERPRETER_CALL_INTERPRETING = "response.code_interpreter_call.interpreting" - RESPONSE_COMPLETED = "response.completed" - RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" - RESPONSE_CONTENT_PART_DONE = "response.content_part.done" - RESPONSE_CREATED = "response.created" - ERROR = "error" - RESPONSE_FILE_SEARCH_CALL_COMPLETED = "response.file_search_call.completed" - RESPONSE_FILE_SEARCH_CALL_IN_PROGRESS = "response.file_search_call.in_progress" - RESPONSE_FILE_SEARCH_CALL_SEARCHING = "response.file_search_call.searching" - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" - RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" - RESPONSE_IN_PROGRESS = "response.in_progress" - RESPONSE_FAILED = "response.failed" - RESPONSE_INCOMPLETE = "response.incomplete" - RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" - RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" - RESPONSE_REFUSAL_DELTA = "response.refusal.delta" - RESPONSE_REFUSAL_DONE = "response.refusal.done" - RESPONSE_OUTPUT_TEXT_ANNOTATION_ADDED = "response.output_text.annotation.added" - RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" - RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" - RESPONSE_REASONING_SUMMARY_PART_ADDED = "response.reasoning_summary_part.added" - RESPONSE_REASONING_SUMMARY_PART_DONE = "response.reasoning_summary_part.done" - RESPONSE_REASONING_SUMMARY_TEXT_DELTA = "response.reasoning_summary_text.delta" - RESPONSE_REASONING_SUMMARY_TEXT_DONE = "response.reasoning_summary_text.done" - RESPONSE_WEB_SEARCH_CALL_COMPLETED = "response.web_search_call.completed" - RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS = "response.web_search_call.in_progress" - RESPONSE_WEB_SEARCH_CALL_SEARCHING = "response.web_search_call.searching" - RESPONSE_IMAGE_GENERATION_CALL_COMPLETED = "response.image_generation_call.completed" - RESPONSE_IMAGE_GENERATION_CALL_GENERATING = "response.image_generation_call.generating" - RESPONSE_IMAGE_GENERATION_CALL_IN_PROGRESS = "response.image_generation_call.in_progress" - RESPONSE_IMAGE_GENERATION_CALL_PARTIAL_IMAGE = "response.image_generation_call.partial_image" - RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call.arguments_delta" - RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call.arguments_done" - RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" - RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" - RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" - RESPONSE_MCP_LIST_TOOLS_COMPLETED = "response.mcp_list_tools.completed" - RESPONSE_MCP_LIST_TOOLS_FAILED = "response.mcp_list_tools.failed" - RESPONSE_MCP_LIST_TOOLS_IN_PROGRESS = "response.mcp_list_tools.in_progress" - RESPONSE_QUEUED = "response.queued" - RESPONSE_REASONING_DELTA = "response.reasoning.delta" - RESPONSE_REASONING_DONE = "response.reasoning.done" - RESPONSE_REASONING_SUMMARY_DELTA = "response.reasoning_summary.delta" - RESPONSE_REASONING_SUMMARY_DONE = "response.reasoning_summary.done" - - -class ResponseTextFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """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. - """ - - TEXT = "text" - JSON_SCHEMA = "json_schema" - JSON_OBJECT = "json_object" - - class RiskCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Risk category for the attack objective.""" @@ -661,73 +780,54 @@ class ScheduleTaskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Insight task.""" -class ServiceTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Specifies the processing type used for serving the request. +class SearchContextSize(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of SearchContextSize.""" - * If set to 'auto', then the request will be processed with the service tier - configured in the Project settings. Unless otherwise configured, the Project will use - 'default'. - * If set to 'default', then the request will be processed with the standard - pricing and performance for the selected model. - * If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' - or 'priority', then the request will be processed with the corresponding service - tier. [Contact sales](https://openai.com/contact-sales) to learn more about Priority - processing. - * When not set, the default behavior is 'auto'. + LOW = "low" + MEDIUM = "medium" + HIGH = "high" - When the ``service_tier`` parameter is set, the response body will include the ``service_tier`` - value based on the processing mode actually used to serve the request. This response value - may be different from the value set in the parameter. - """ - AUTO = "auto" - DEFAULT = "default" - FLEX = "flex" - SCALE = "scale" - PRIORITY = "priority" +class TextResponseFormatConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of TextResponseFormatConfigurationType.""" + TEXT = "text" + JSON_SCHEMA = "json_schema" + JSON_OBJECT = "json_object" -class ToolChoiceObjectType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates that the model should use a built-in tool to generate a response. - `Learn more about built-in tools `_. - """ - FILE_SEARCH = "file_search" +class ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ToolChoiceParamType.""" + + ALLOWED_TOOLS = "allowed_tools" FUNCTION = "function" - COMPUTER = "computer_use_preview" - WEB_SEARCH = "web_search_preview" + MCP = "mcp" + CUSTOM = "custom" + APPLY_PATCH = "apply_patch" + SHELL = "shell" + FILE_SEARCH = "file_search" + WEB_SEARCH_PREVIEW = "web_search_preview" + COMPUTER_USE_PREVIEW = "computer_use_preview" + WEB_SEARCH_PREVIEW2025_03_11 = "web_search_preview_2025_03_11" IMAGE_GENERATION = "image_generation" CODE_INTERPRETER = "code_interpreter" - MCP = "mcp" - - -class ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Controls which (if any) tool is called by the model. - - ``none`` means the model will not call any tool and instead generates a message. - - ``auto`` means the model can pick between generating a message or calling one or - more tools. - - ``required`` means the model must call one or more tools. - """ - - NONE = "none" - AUTO = "auto" - REQUIRED = "required" class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """A tool that can be used to generate a response.""" + """Type of ToolType.""" - FILE_SEARCH = "file_search" FUNCTION = "function" + FILE_SEARCH = "file_search" COMPUTER_USE_PREVIEW = "computer_use_preview" - WEB_SEARCH_PREVIEW = "web_search_preview" + WEB_SEARCH = "web_search" MCP = "mcp" CODE_INTERPRETER = "code_interpreter" IMAGE_GENERATION = "image_generation" LOCAL_SHELL = "local_shell" + SHELL = "shell" + CUSTOM = "custom" + WEB_SEARCH_PREVIEW = "web_search_preview" + APPLY_PATCH = "apply_patch" BING_GROUNDING = "bing_grounding" BROWSER_AUTOMATION_PREVIEW = "browser_automation_preview" FABRIC_DATAAGENT_PREVIEW = "fabric_dataagent_preview" @@ -765,11 +865,3 @@ class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Recurrence based trigger.""" ONE_TIME = "OneTime" """One-time trigger.""" - - -class WebSearchActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of WebSearchActionType.""" - - SEARCH = "search" - OPEN_PAGE = "open_page" - FIND = "find" 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 14f27ed091ef..cacb7a7a9dc0 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 @@ -15,35 +15,39 @@ from ._enums import ( AgentKind, AnnotationType, - CodeInterpreterOutputType, + ApplyPatchFileOperationType, + ApplyPatchOperationParamType, ComputerActionType, - ComputerToolCallOutputItemOutputType, CredentialType, + CustomToolParamFormatType, DatasetType, DeploymentType, EvaluationRuleActionType, EvaluationTaxonomyInputType, EvaluatorDefinitionType, + FunctionAndCustomToolCallOutputType, + FunctionShellCallOutputOutcomeParamType, + FunctionShellCallOutputOutcomeType, IndexType, + InputContentType, + InputItemType, InsightType, - ItemContentType, + ItemResourceType, ItemType, - LocationType, MemoryItemKind, MemoryStoreKind, OpenApiAuthType, + OutputContentType, + OutputItemType, + OutputMessageContentType, PendingUploadType, - ReasoningItemSummaryPartType, RecurrenceType, - ResponseStreamEventType, - ResponseTextFormatConfigurationType, - ResponsesMessageRole, SampleType, ScheduleTaskType, - ToolChoiceObjectType, + TextResponseFormatConfigurationType, + ToolChoiceParamType, ToolType, TriggerType, - WebSearchActionType, ) if TYPE_CHECKING: @@ -51,31 +55,33 @@ class Tool(_Model): - """Tool. + """A tool that can be used to generate a response. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - A2ATool, AzureAISearchAgentTool, AzureFunctionAgentTool, BingCustomSearchAgentTool, - BingGroundingAgentTool, BrowserAutomationAgentTool, CaptureStructuredOutputsTool, - CodeInterpreterTool, ComputerUsePreviewTool, MicrosoftFabricAgentTool, FileSearchTool, - FunctionTool, ImageGenTool, LocalShellTool, MCPTool, MemorySearchTool, OpenApiAgentTool, - SharepointAgentTool, WebSearchPreviewTool - - :ivar type: Required. Known values are: "file_search", "function", "computer_use_preview", - "web_search_preview", "mcp", "code_interpreter", "image_generation", "local_shell", - "bing_grounding", "browser_automation_preview", "fabric_dataagent_preview", - "sharepoint_grounding_preview", "azure_ai_search", "openapi", "bing_custom_search_preview", - "capture_structured_outputs", "a2a_preview", "azure_function", and "memory_search". + A2ATool, ApplyPatchToolParam, AzureAISearchAgentTool, AzureFunctionAgentTool, + BingCustomSearchAgentTool, BingGroundingAgentTool, BrowserAutomationAgentTool, + CaptureStructuredOutputsTool, CodeInterpreterTool, ComputerUsePreviewTool, CustomToolParam, + MicrosoftFabricAgentTool, FileSearchTool, FunctionTool, ImageGenTool, LocalShellToolParam, + MCPTool, MemorySearchTool, OpenApiAgentTool, SharepointAgentTool, FunctionShellToolParam, + WebSearchTool, WebSearchPreviewTool + + :ivar type: Required. Known values are: "function", "file_search", "computer_use_preview", + "web_search", "mcp", "code_interpreter", "image_generation", "local_shell", "shell", "custom", + "web_search_preview", "apply_patch", "bing_grounding", "browser_automation_preview", + "fabric_dataagent_preview", "sharepoint_grounding_preview", "azure_ai_search", "openapi", + "bing_custom_search_preview", "capture_structured_outputs", "a2a_preview", "azure_function", + and "memory_search". :vartype type: str or ~azure.ai.projects.models.ToolType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"file_search\", \"function\", \"computer_use_preview\", - \"web_search_preview\", \"mcp\", \"code_interpreter\", \"image_generation\", \"local_shell\", - \"bing_grounding\", \"browser_automation_preview\", \"fabric_dataagent_preview\", - \"sharepoint_grounding_preview\", \"azure_ai_search\", \"openapi\", - \"bing_custom_search_preview\", \"capture_structured_outputs\", \"a2a_preview\", - \"azure_function\", and \"memory_search\".""" + """Required. Known values are: \"function\", \"file_search\", \"computer_use_preview\", + \"web_search\", \"mcp\", \"code_interpreter\", \"image_generation\", \"local_shell\", + \"shell\", \"custom\", \"web_search_preview\", \"apply_patch\", \"bing_grounding\", + \"browser_automation_preview\", \"fabric_dataagent_preview\", \"sharepoint_grounding_preview\", + \"azure_ai_search\", \"openapi\", \"bing_custom_search_preview\", + \"capture_structured_outputs\", \"a2a_preview\", \"azure_function\", and \"memory_search\".""" @overload def __init__( @@ -749,17 +755,17 @@ class Annotation(_Model): """Annotation. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AnnotationFileCitation, AnnotationFilePath, AnnotationUrlCitation + ContainerFileCitationBody, FileCitationBody, FilePath, UrlCitationBody - :ivar type: Required. Known values are: "file_citation", "url_citation", "file_path", and - "container_file_citation". + :ivar type: Required. Known values are: "file_citation", "url_citation", + "container_file_citation", and "file_path". :vartype type: str or ~azure.ai.projects.models.AnnotationType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"file_citation\", \"url_citation\", \"file_path\", and - \"container_file_citation\".""" + """Required. Known values are: \"file_citation\", \"url_citation\", \"container_file_citation\", + and \"file_path\".""" @overload def __init__( @@ -779,35 +785,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AnnotationFileCitation(Annotation, discriminator="file_citation"): - """A citation to a file. +class ApiErrorResponse(_Model): + """Error response for API failures. - :ivar type: The type of the file citation. Always ``file_citation``. Required. - :vartype type: str or ~azure.ai.projects.models.FILE_CITATION - :ivar file_id: The ID of the file. Required. - :vartype file_id: str - :ivar index: The index of the file in the list of files. Required. - :vartype index: int - :ivar filename: The filename of the file cited. Required. - :vartype filename: str + :ivar error: Required. + :vartype error: ~azure.ai.projects.models.Error """ - 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.""" - 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"]) - """The index of the file in the list of files. Required.""" - filename: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The filename of the file cited. Required.""" + error: "_models.Error" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - file_id: str, - index: int, - filename: str, + error: "_models.Error", ) -> None: ... @overload @@ -819,33 +811,25 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AnnotationType.FILE_CITATION # type: ignore -class AnnotationFilePath(Annotation, discriminator="file_path"): - """A path to a file. +class ApiKeyCredentials(BaseCredentials, discriminator="ApiKey"): + """API Key Credential definition. - :ivar type: The type of the file path. Always ``file_path``. Required. - :vartype type: str or ~azure.ai.projects.models.FILE_PATH - :ivar file_id: The ID of the file. Required. - :vartype file_id: str - :ivar index: The index of the file in the list of files. Required. - :vartype index: int + :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[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.""" - 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"]) - """The index of the file in the list of files. Required.""" + type: Literal[CredentialType.API_KEY] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. API Key credential""" + api_key: Optional[str] = rest_field(name="key", visibility=["read"]) + """API Key.""" @overload def __init__( self, - *, - file_id: str, - index: int, ) -> None: ... @overload @@ -857,44 +841,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AnnotationType.FILE_PATH # type: ignore + self.type = CredentialType.API_KEY # type: ignore -class AnnotationUrlCitation(Annotation, discriminator="url_citation"): - """A citation for a web resource used to generate a model response. +class ApplyPatchFileOperation(_Model): + """Apply patch operation. - :ivar type: The type of the URL citation. Always ``url_citation``. Required. - :vartype type: str or ~azure.ai.projects.models.URL_CITATION - :ivar url: The URL of the web resource. Required. - :vartype url: str - :ivar start_index: The index of the first character of the URL citation in the message. - Required. - :vartype start_index: int - :ivar end_index: The index of the last character of the URL citation in the message. Required. - :vartype end_index: int - :ivar title: The title of the web resource. Required. - :vartype title: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ApplyPatchCreateFileOperation, ApplyPatchDeleteFileOperation, ApplyPatchUpdateFileOperation + + :ivar type: Required. Known values are: "create_file", "delete_file", and "update_file". + :vartype type: str or ~azure.ai.projects.models.ApplyPatchFileOperationType """ - 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.""" - 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"]) - """The index of the first character of the URL citation in the message. Required.""" - end_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the last character of the URL citation in the message. Required.""" - title: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The title of the web resource. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"create_file\", \"delete_file\", and \"update_file\".""" @overload def __init__( self, *, - url: str, - start_index: int, - end_index: int, - title: str, + type: str, ) -> None: ... @overload @@ -906,24 +874,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = AnnotationType.URL_CITATION # type: ignore -class ApiErrorResponse(_Model): - """Error response for API failures. +class ApplyPatchCreateFileOperation(ApplyPatchFileOperation, discriminator="create_file"): + """Apply patch create file operation. - :ivar error: Required. - :vartype error: ~azure.ai.projects.models.Error + :ivar type: Create a new file with the provided diff. Required. + :vartype type: str or ~azure.ai.projects.models.CREATE_FILE + :ivar path: Path of the file to create. Required. + :vartype path: str + :ivar diff: Diff to apply. Required. + :vartype diff: str """ - error: "_models.Error" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + 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.""" + 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"]) + """Diff to apply. Required.""" @overload def __init__( self, *, - error: "_models.Error", + path: str, + diff: str, ) -> None: ... @overload @@ -935,25 +911,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ApplyPatchFileOperationType.CREATE_FILE # type: ignore -class ApiKeyCredentials(BaseCredentials, discriminator="ApiKey"): - """API Key Credential definition. +class ApplyPatchOperationParam(_Model): + """Apply patch operation. - :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 + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ApplyPatchCreateFileOperationParam, ApplyPatchDeleteFileOperationParam, + ApplyPatchUpdateFileOperationParam + + :ivar type: Required. Known values are: "create_file", "delete_file", and "update_file". + :vartype type: str or ~azure.ai.projects.models.ApplyPatchOperationParamType """ - type: Literal[CredentialType.API_KEY] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. API Key credential""" - api_key: Optional[str] = rest_field(name="key", visibility=["read"]) - """API Key.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"create_file\", \"delete_file\", and \"update_file\".""" @overload def __init__( self, + *, + type: str, ) -> None: ... @overload @@ -965,28 +945,65 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CredentialType.API_KEY # type: ignore -class Location(_Model): - """Location. +class ApplyPatchCreateFileOperationParam(ApplyPatchOperationParam, discriminator="create_file"): + """Apply patch create file operation. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ApproximateLocation + :ivar type: The operation type. Always ``create_file``. Required. + :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 + :ivar diff: Unified diff content to apply when creating the file. Required. + :vartype diff: str + """ + + type: Literal[ApplyPatchOperationParamType.CREATE_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The operation type. Always ``create_file``. Required.""" + 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"]) + """Unified diff content to apply when creating the file. Required.""" + + @overload + def __init__( + self, + *, + path: str, + diff: 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 = ApplyPatchOperationParamType.CREATE_FILE # type: ignore - :ivar type: Required. "approximate" - :vartype type: str or ~azure.ai.projects.models.LocationType + +class ApplyPatchDeleteFileOperation(ApplyPatchFileOperation, discriminator="delete_file"): + """Apply patch delete file operation. + + :ivar type: Delete the specified file. Required. + :vartype type: str or ~azure.ai.projects.models.DELETE_FILE + :ivar path: Path of the file to delete. Required. + :vartype path: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. \"approximate\"""" + type: Literal[ApplyPatchFileOperationType.DELETE_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Delete the specified file. Required.""" + path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Path of the file to delete. Required.""" @overload def __init__( self, *, - type: str, + path: str, ) -> None: ... @overload @@ -998,38 +1015,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ApplyPatchFileOperationType.DELETE_FILE # type: ignore -class ApproximateLocation(Location, discriminator="approximate"): - """ApproximateLocation. +class ApplyPatchDeleteFileOperationParam(ApplyPatchOperationParam, discriminator="delete_file"): + """Apply patch delete file operation. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.APPROXIMATE - :ivar country: - :vartype country: str - :ivar region: - :vartype region: str - :ivar city: - :vartype city: str - :ivar timezone: - :vartype timezone: str + :ivar type: The operation type. Always ``delete_file``. Required. + :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[LocationType.APPROXIMATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - country: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - region: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - city: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - timezone: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[ApplyPatchOperationParamType.DELETE_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The operation type. Always ``delete_file``. Required.""" + path: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Path of the file to delete relative to the workspace root. Required.""" @overload def __init__( self, *, - country: Optional[str] = None, - region: Optional[str] = None, - city: Optional[str] = None, - timezone: Optional[str] = None, + path: str, ) -> None: ... @overload @@ -1041,22 +1048,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = LocationType.APPROXIMATE # type: ignore + self.type = ApplyPatchOperationParamType.DELETE_FILE # type: ignore -class Target(_Model): - """Base class for targets with discriminator support. +class Item(_Model): + """Content item used to generate a response. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureAIAgentTarget, AzureAIAssistantTarget, AzureAIModelTarget - - :ivar type: The type of target. Required. Default value is None. - :vartype type: str + ApplyPatchToolCallItemParam, ApplyPatchToolCallOutputItemParam, ItemCodeInterpreterToolCall, + CompactionSummaryItemParam, ItemComputerToolCall, ComputerCallOutputItemParam, + ItemCustomToolCall, ItemCustomToolCallOutput, ItemFileSearchToolCall, ItemFunctionToolCall, + FunctionCallOutputItemParam, ItemImageGenToolCall, ItemLocalShellToolCall, + ItemLocalShellToolCallOutput, ItemMcpApprovalRequest, MCPApprovalResponse, ItemMcpToolCall, + ItemMcpListTools, MemorySearchToolCallItemParam, InputMessage, ItemOutputMessage, + ItemReasoningItem, FunctionShellCallItemParam, FunctionShellCallOutputItemParam, + ItemWebSearchToolCall + + :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", "reasoning", "compaction", "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", "custom_tool_call_output", + "custom_tool_call", "structured_outputs", "workflow_action", "memory_search_call", and + "oauth_consent_request". + :vartype type: str or ~azure.ai.projects.models.ItemType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of target. Required. Default value is None.""" + """Required. Known values are: \"message\", \"output_message\", \"file_search_call\", + \"computer_call\", \"computer_call_output\", \"web_search_call\", \"function_call\", + \"function_call_output\", \"reasoning\", \"compaction\", \"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\", \"custom_tool_call_output\", + \"custom_tool_call\", \"structured_outputs\", \"workflow_action\", \"memory_search_call\", and + \"oauth_consent_request\".""" @overload def __init__( @@ -1076,39 +1104,46 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureAIAgentTarget(Target, discriminator="azure_ai_agent"): - """Represents a target specifying an Azure AI agent. +class ApplyPatchToolCallItemParam(Item, discriminator="apply_patch_call"): + """Apply patch tool call. - :ivar type: The type of target, always ``azure_ai_agent``. Required. Default value is - "azure_ai_agent". - :vartype type: str - :ivar name: The unique identifier of the Azure AI agent. Required. - :vartype name: str - :ivar version: The version of the Azure AI agent. - :vartype version: str - :ivar tool_descriptions: The parameters used to control the sampling behavior of the agent - during text generation. - :vartype tool_descriptions: list[~azure.ai.projects.models.ToolDescription] + :ivar type: The type of the item. Always ``apply_patch_call``. Required. + :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH_CALL + :ivar id: + :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.ApplyPatchCallStatusParam + :ivar operation: The specific create, delete, or update instruction for the apply_patch tool + call. Required. + :vartype operation: ~azure.ai.projects.models.ApplyPatchOperationParam """ - type: Literal["azure_ai_agent"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of target, always ``azure_ai_agent``. Required. Default value is \"azure_ai_agent\".""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the Azure AI agent. Required.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version of the Azure AI agent.""" - tool_descriptions: Optional[list["_models.ToolDescription"]] = rest_field( + type: Literal[ItemType.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.""" + 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.""" + status: Union[str, "_models.ApplyPatchCallStatusParam"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The parameters used to control the sampling behavior of the agent during text generation.""" + """The status of the apply patch tool call. One of ``in_progress`` or ``completed``. Required. + Known values are: \"in_progress\" and \"completed\".""" + operation: "_models.ApplyPatchOperationParam" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The specific create, delete, or update instruction for the apply_patch tool call. Required.""" @overload def __init__( self, *, - name: str, - version: Optional[str] = None, - tool_descriptions: Optional[list["_models.ToolDescription"]] = None, + call_id: str, + status: Union[str, "_models.ApplyPatchCallStatusParam"], + operation: "_models.ApplyPatchOperationParam", + id: Optional[str] = None, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -1120,30 +1155,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "azure_ai_agent" # type: ignore + self.type = ItemType.APPLY_PATCH_CALL # type: ignore -class AzureAISearchAgentTool(Tool, discriminator="azure_ai_search"): - """The input definition information for an Azure AI search tool as used to configure an agent. +class ApplyPatchToolCallOutputItemParam(Item, discriminator="apply_patch_call_output"): + """Apply patch tool call output. - :ivar type: The object type, which is always 'azure_ai_search'. Required. - :vartype type: str or ~azure.ai.projects.models.AZURE_AI_SEARCH - :ivar azure_ai_search: The azure ai search index resource. Required. - :vartype azure_ai_search: ~azure.ai.projects.models.AzureAISearchToolResource + :ivar type: The type of the item. Always ``apply_patch_call_output``. Required. + :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH_CALL_OUTPUT + :ivar id: + :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.ApplyPatchCallOutputStatusParam + :ivar output: + :vartype output: str """ - type: Literal[ToolType.AZURE_AI_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'azure_ai_search'. Required.""" - azure_ai_search: "_models.AzureAISearchToolResource" = rest_field( + type: Literal[ItemType.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.""" + 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.""" + status: Union[str, "_models.ApplyPatchCallOutputStatusParam"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The azure ai search index resource. Required.""" + """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"]) @overload def __init__( self, *, - azure_ai_search: "_models.AzureAISearchToolResource", + call_id: str, + status: Union[str, "_models.ApplyPatchCallOutputStatusParam"], + id: Optional[str] = None, # pylint: disable=redefined-builtin + output: Optional[str] = None, ) -> None: ... @overload @@ -1155,52 +1205,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.AZURE_AI_SEARCH # type: ignore - + self.type = ItemType.APPLY_PATCH_CALL_OUTPUT # type: ignore -class Index(_Model): - """Index resource Definition. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureAISearchIndex, CosmosDBIndex, ManagedAzureAISearchIndex +class ApplyPatchToolParam(Tool, discriminator="apply_patch"): + """Apply patch tool. - :ivar type: Type of index. Required. Known values are: "AzureSearch", - "CosmosDBNoSqlVectorStore", and "ManagedAzureSearch". - :vartype type: str or ~azure.ai.projects.models.IndexType - :ivar id: Asset ID, a unique identifier for the asset. - :vartype id: str - :ivar name: The name of the resource. Required. - :vartype name: str - :ivar version: The version of the resource. Required. - :vartype version: str - :ivar description: The asset description text. - :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] + :ivar type: The type of the tool. Always ``apply_patch``. Required. + :vartype type: str or ~azure.ai.projects.models.APPLY_PATCH """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of index. Required. Known values are: \"AzureSearch\", \"CosmosDBNoSqlVectorStore\", and - \"ManagedAzureSearch\".""" - id: Optional[str] = rest_field(visibility=["read"]) - """Asset ID, a unique identifier for the asset.""" - name: str = rest_field(visibility=["read"]) - """The name of the resource. Required.""" - version: str = rest_field(visibility=["read"]) - """The version of the resource. Required.""" - description: Optional[str] = rest_field(visibility=["create", "update"]) - """The asset description text.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) - """Tag dictionary. Tags can be added, removed, and updated.""" + 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.""" @overload def __init__( self, - *, - type: str, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -1212,82 +1232,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.APPLY_PATCH # type: ignore -class AzureAISearchIndex(Index, discriminator="AzureSearch"): - """Azure AI Search Index Definition. +class ApplyPatchUpdateFileOperation(ApplyPatchFileOperation, discriminator="update_file"): + """Apply patch update file operation. - :ivar id: Asset ID, a unique identifier for the asset. - :vartype id: str - :ivar name: The name of the resource. Required. - :vartype name: str - :ivar version: The version of the resource. Required. - :vartype version: str - :ivar description: The asset description text. - :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar type: Type of index. Required. Azure search - :vartype type: str or ~azure.ai.projects.models.AZURE_SEARCH - :ivar connection_name: Name of connection to Azure AI Search. Required. - :vartype connection_name: str - :ivar index_name: Name of index in Azure AI Search resource to attach. Required. - :vartype index_name: str - :ivar field_mapping: Field mapping configuration. - :vartype field_mapping: ~azure.ai.projects.models.FieldMapping - """ - - type: Literal[IndexType.AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of index. Required. Azure search""" - connection_name: str = rest_field(name="connectionName", visibility=["create"]) - """Name of connection to Azure AI Search. Required.""" - index_name: str = rest_field(name="indexName", visibility=["create"]) - """Name of index in Azure AI Search resource to attach. Required.""" - field_mapping: Optional["_models.FieldMapping"] = rest_field(name="fieldMapping", visibility=["create"]) - """Field mapping configuration.""" - - @overload - def __init__( - self, - *, - connection_name: str, - index_name: str, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - field_mapping: Optional["_models.FieldMapping"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = IndexType.AZURE_SEARCH # type: ignore - - -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. - :vartype indexes: list[~azure.ai.projects.models.AISearchIndexResource] + :ivar type: Update an existing file with the provided diff. Required. + :vartype type: str or ~azure.ai.projects.models.UPDATE_FILE + :ivar path: Path of the file to update. Required. + :vartype path: str + :ivar diff: Diff to apply. Required. + :vartype diff: str """ - indexes: list["_models.AISearchIndexResource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The indices attached to this agent. There can be a maximum of 1 index - resource attached to the agent. Required.""" + type: Literal[ApplyPatchFileOperationType.UPDATE_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Update an existing file with the provided diff. Required.""" + 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"]) + """Diff to apply. Required.""" @overload def __init__( self, *, - indexes: list["_models.AISearchIndexResource"], + path: str, + diff: str, ) -> None: ... @overload @@ -1299,29 +1270,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ApplyPatchFileOperationType.UPDATE_FILE # type: ignore -class AzureFunctionAgentTool(Tool, discriminator="azure_function"): - """The input definition information for an Azure Function Tool, as used to configure an Agent. +class ApplyPatchUpdateFileOperationParam(ApplyPatchOperationParam, discriminator="update_file"): + """Apply patch update file operation. - :ivar type: The object type, which is always 'browser_automation'. Required. - :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 + :ivar type: The operation type. Always ``update_file``. Required. + :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 + :ivar diff: Unified diff content to apply to the existing file. Required. + :vartype diff: str """ - type: Literal[ToolType.AZURE_FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'browser_automation'. Required.""" - azure_function: "_models.AzureFunctionDefinition" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The Azure Function Tool definition. Required.""" + type: Literal[ApplyPatchOperationParamType.UPDATE_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The operation type. Always ``update_file``. Required.""" + 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"]) + """Unified diff content to apply to the existing file. Required.""" @overload def __init__( self, *, - azure_function: "_models.AzureFunctionDefinition", + path: str, + diff: str, ) -> None: ... @overload @@ -1333,32 +1308,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.AZURE_FUNCTION # type: ignore + self.type = ApplyPatchOperationParamType.UPDATE_FILE # type: ignore -class AzureFunctionBinding(_Model): - """The structure for keeping storage queue name and URI. +class ApproximateLocation(_Model): + """ApproximateLocation. - :ivar type: The type of binding, which is always 'storage_queue'. Required. Default value is - "storage_queue". + :ivar type: The type of location approximation. Always ``approximate``. Required. Default value + is "approximate". :vartype type: str - :ivar storage_queue: Storage queue. Required. - :vartype storage_queue: ~azure.ai.projects.models.AzureFunctionStorageQueue + :ivar country: + :vartype country: str + :ivar region: + :vartype region: str + :ivar city: + :vartype city: str + :ivar timezone: + :vartype timezone: str """ - type: Literal["storage_queue"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of binding, which is always 'storage_queue'. Required. Default value is - \"storage_queue\".""" - storage_queue: "_models.AzureFunctionStorageQueue" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Storage queue. Required.""" + type: Literal["approximate"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of location approximation. Always ``approximate``. Required. Default value is + \"approximate\".""" + country: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + region: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + city: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + timezone: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - storage_queue: "_models.AzureFunctionStorageQueue", + country: Optional[str] = None, + region: Optional[str] = None, + city: Optional[str] = None, + timezone: Optional[str] = None, ) -> None: ... @overload @@ -1370,44 +1354,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["storage_queue"] = "storage_queue" + self.type: Literal["approximate"] = "approximate" -class AzureFunctionDefinition(_Model): - """The definition of Azure function. +class Target(_Model): + """Base class for targets with discriminator support. - :ivar function: The definition of azure function and its parameters. Required. - :vartype function: ~azure.ai.projects.models.AzureFunctionDefinitionFunction - :ivar input_binding: Input storage queue. The queue storage trigger runs a function as messages - are added to it. Required. - :vartype input_binding: ~azure.ai.projects.models.AzureFunctionBinding - :ivar output_binding: Output storage queue. The function writes output to this queue when the - input items are processed. Required. - :vartype output_binding: ~azure.ai.projects.models.AzureFunctionBinding + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureAIAgentTarget, AzureAIModelTarget + + :ivar type: The type of target. Required. Default value is None. + :vartype type: str """ - function: "_models.AzureFunctionDefinitionFunction" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The definition of azure function and its parameters. Required.""" - input_binding: "_models.AzureFunctionBinding" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input storage queue. The queue storage trigger runs a function as messages are added to it. - Required.""" - output_binding: "_models.AzureFunctionBinding" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Output storage queue. The function writes output to this queue when the input items are - processed. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of target. Required. Default value is None.""" @overload def __init__( self, *, - function: "_models.AzureFunctionDefinitionFunction", - input_binding: "_models.AzureFunctionBinding", - output_binding: "_models.AzureFunctionBinding", + type: str, ) -> None: ... @overload @@ -1421,34 +1389,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureFunctionDefinitionFunction(_Model): - """AzureFunctionDefinitionFunction. +class AzureAIAgentTarget(Target, discriminator="azure_ai_agent"): + """Represents a target specifying an Azure AI agent. - :ivar name: The name of the function to be called. Required. + :ivar type: The type of target, always ``azure_ai_agent``. Required. Default value is + "azure_ai_agent". + :vartype type: str + :ivar name: The unique identifier of the Azure AI agent. Required. :vartype name: str - :ivar description: A description of what the function does, used by the model to choose when - and how to call the function. - :vartype description: str - :ivar parameters: The parameters the functions accepts, described as a JSON Schema object. - Required. - :vartype parameters: any + :ivar version: The version of the Azure AI agent. + :vartype version: str + :ivar tool_descriptions: The parameters used to control the sampling behavior of the agent + during text generation. + :vartype tool_descriptions: list[~azure.ai.projects.models.ToolDescription] """ + type: Literal["azure_ai_agent"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of target, always ``azure_ai_agent``. Required. Default value is \"azure_ai_agent\".""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function to be called. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description of what the function does, used by the model to choose when and how to call the - function.""" - parameters: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The parameters the functions accepts, described as a JSON Schema object. Required.""" + """The unique identifier of the Azure AI agent. Required.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of the Azure AI agent.""" + tool_descriptions: Optional[list["_models.ToolDescription"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The parameters used to control the sampling behavior of the agent during text generation.""" @overload def __init__( self, *, name: str, - parameters: Any, - description: Optional[str] = None, + version: Optional[str] = None, + tool_descriptions: Optional[list["_models.ToolDescription"]] = None, ) -> None: ... @overload @@ -1460,29 +1433,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "azure_ai_agent" # type: ignore -class AzureFunctionStorageQueue(_Model): - """The structure for keeping storage queue name and URI. +class AzureAISearchAgentTool(Tool, discriminator="azure_ai_search"): + """The input definition information for an Azure AI search tool as used to configure an agent. - :ivar queue_service_endpoint: URI to the Azure Storage Queue service allowing you to manipulate - a queue. Required. - :vartype queue_service_endpoint: str - :ivar queue_name: The name of an Azure function storage queue. Required. - :vartype queue_name: str + :ivar type: The object type, which is always 'azure_ai_search'. Required. + :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 """ - queue_service_endpoint: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """URI to the Azure Storage Queue service allowing you to manipulate a queue. Required.""" - queue_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of an Azure function storage queue. Required.""" + type: Literal[ToolType.AZURE_AI_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'azure_ai_search'. Required.""" + azure_ai_search: "_models.AzureAISearchToolResource" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The azure ai search index resource. Required.""" @overload def __init__( self, *, - queue_service_endpoint: str, - queue_name: str, + azure_ai_search: "_models.AzureAISearchToolResource", ) -> None: ... @overload @@ -1494,27 +1468,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.AZURE_AI_SEARCH # type: ignore -class TargetConfig(_Model): - """Abstract class for target configuration. +class Index(_Model): + """Index resource Definition. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureOpenAIModelConfiguration + AzureAISearchIndex, CosmosDBIndex, ManagedAzureAISearchIndex - :ivar type: Type of the model configuration. Required. Default value is None. - :vartype type: str + :ivar type: Type of index. Required. Known values are: "AzureSearch", + "CosmosDBNoSqlVectorStore", and "ManagedAzureSearch". + :vartype type: str or ~azure.ai.projects.models.IndexType + :ivar id: Asset ID, a unique identifier for the asset. + :vartype id: str + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of the model configuration. Required. Default value is None.""" + """Type of index. Required. Known values are: \"AzureSearch\", \"CosmosDBNoSqlVectorStore\", and + \"ManagedAzureSearch\".""" + id: Optional[str] = rest_field(visibility=["read"]) + """Asset ID, a unique identifier for the asset.""" + name: str = rest_field(visibility=["read"]) + """The name of the resource. Required.""" + version: str = rest_field(visibility=["read"]) + """The version of the resource. Required.""" + description: Optional[str] = rest_field(visibility=["create", "update"]) + """The asset description text.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["create", "update"]) + """Tag dictionary. Tags can be added, removed, and updated.""" @overload def __init__( self, *, type: str, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -1528,31 +1527,47 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AzureOpenAIModelConfiguration(TargetConfig, discriminator="AzureOpenAIModel"): - """Azure OpenAI model configuration. The API version would be selected by the service for querying - the model. - - :ivar type: Required. Default value is "AzureOpenAIModel". - :vartype type: str - :ivar model_deployment_name: Deployment name for AOAI model. Example: gpt-4o if in AIServices - or connection based ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). - Required. - :vartype model_deployment_name: str - """ +class AzureAISearchIndex(Index, discriminator="AzureSearch"): + """Azure AI Search Index Definition. - type: Literal["AzureOpenAIModel"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"AzureOpenAIModel\".""" - model_deployment_name: str = rest_field( - name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"] - ) - """Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based - ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). Required.""" + :ivar id: Asset ID, a unique identifier for the asset. + :vartype id: str + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar type: Type of index. Required. Azure search + :vartype type: str or ~azure.ai.projects.models.AZURE_SEARCH + :ivar connection_name: Name of connection to Azure AI Search. Required. + :vartype connection_name: str + :ivar index_name: Name of index in Azure AI Search resource to attach. Required. + :vartype index_name: str + :ivar field_mapping: Field mapping configuration. + :vartype field_mapping: ~azure.ai.projects.models.FieldMapping + """ + + type: Literal[IndexType.AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Type of index. Required. Azure search""" + connection_name: str = rest_field(name="connectionName", visibility=["create"]) + """Name of connection to Azure AI Search. Required.""" + index_name: str = rest_field(name="indexName", visibility=["create"]) + """Name of index in Azure AI Search resource to attach. Required.""" + field_mapping: Optional["_models.FieldMapping"] = rest_field(name="fieldMapping", visibility=["create"]) + """Field mapping configuration.""" @overload def __init__( self, *, - model_deployment_name: str, + connection_name: str, + index_name: str, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + field_mapping: Optional["_models.FieldMapping"] = None, ) -> None: ... @overload @@ -1564,30 +1579,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = "AzureOpenAIModel" # type: ignore + self.type = IndexType.AZURE_SEARCH # type: ignore -class BingCustomSearchAgentTool(Tool, discriminator="bing_custom_search_preview"): - """The input definition information for a Bing custom search tool as used to configure an agent. +class AzureAISearchToolResource(_Model): + """A set of index resources used by the ``azure_ai_search`` tool. - :ivar type: The object type, which is always 'bing_custom_search'. Required. - :vartype type: str or ~azure.ai.projects.models.BING_CUSTOM_SEARCH_PREVIEW - :ivar bing_custom_search_preview: The bing custom search tool parameters. Required. - :vartype bing_custom_search_preview: ~azure.ai.projects.models.BingCustomSearchToolParameters + :ivar 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] """ - 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'. Required.""" - bing_custom_search_preview: "_models.BingCustomSearchToolParameters" = rest_field( + indexes: list["_models.AISearchIndexResource"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The bing custom search tool parameters. Required.""" + """The indices attached to this agent. There can be a maximum of 1 index + resource attached to the agent. Required.""" @overload def __init__( self, *, - bing_custom_search_preview: "_models.BingCustomSearchToolParameters", + indexes: list["_models.AISearchIndexResource"], ) -> None: ... @overload @@ -1599,51 +1612,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.BING_CUSTOM_SEARCH_PREVIEW # type: ignore -class BingCustomSearchConfiguration(_Model): - """A bing custom search configuration. +class AzureFunctionAgentTool(Tool, discriminator="azure_function"): + """The input definition information for an Azure Function Tool, as used to configure an Agent. - :ivar project_connection_id: Project connection id for grounding with bing search. Required. - :vartype project_connection_id: str - :ivar instance_name: Name of the custom configuration instance given to config. Required. - :vartype instance_name: str - :ivar market: The market where the results come from. - :vartype market: str - :ivar set_lang: The language to use for user interface strings when calling Bing API. - :vartype set_lang: str - :ivar count: The number of search results to return in the bing api response. - :vartype count: int - :ivar freshness: Filter search results by a specific time range. See `accepted values here - `_. - :vartype freshness: str + :ivar type: The object type, which is always 'browser_automation'. Required. + :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 """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Project connection id for grounding with bing search. Required.""" - instance_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the custom configuration instance given to config. Required.""" - market: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The market where the results come from.""" - set_lang: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The language to use for user interface strings when calling Bing API.""" - count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of search results to return in the bing api response.""" - freshness: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Filter search results by a specific time range. See `accepted values here - `_.""" + type: Literal[ToolType.AZURE_FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'browser_automation'. Required.""" + azure_function: "_models.AzureFunctionDefinition" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Azure Function Tool definition. Required.""" @overload def __init__( self, *, - project_connection_id: str, - instance_name: str, - market: Optional[str] = None, - set_lang: Optional[str] = None, - count: Optional[int] = None, - freshness: Optional[str] = None, + azure_function: "_models.AzureFunctionDefinition", ) -> None: ... @overload @@ -1655,28 +1646,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.AZURE_FUNCTION # type: ignore -class BingCustomSearchToolParameters(_Model): - """The bing custom search tool parameters. +class AzureFunctionBinding(_Model): + """The structure for keeping storage queue name and URI. - :ivar search_configurations: The project connections attached to this tool. There can be a - maximum of 1 connection - resource attached to the tool. Required. - :vartype search_configurations: list[~azure.ai.projects.models.BingCustomSearchConfiguration] + :ivar type: The type of binding, which is always 'storage_queue'. Required. Default value is + "storage_queue". + :vartype type: str + :ivar storage_queue: Storage queue. Required. + :vartype storage_queue: ~azure.ai.projects.models.AzureFunctionStorageQueue """ - search_configurations: list["_models.BingCustomSearchConfiguration"] = rest_field( + type: Literal["storage_queue"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of binding, which is always 'storage_queue'. Required. Default value is + \"storage_queue\".""" + storage_queue: "_models.AzureFunctionStorageQueue" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The project connections attached to this tool. There can be a maximum of 1 connection - resource attached to the tool. Required.""" + """Storage queue. Required.""" @overload def __init__( self, *, - search_configurations: list["_models.BingCustomSearchConfiguration"], + storage_queue: "_models.AzureFunctionStorageQueue", ) -> None: ... @overload @@ -1688,30 +1683,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["storage_queue"] = "storage_queue" -class BingGroundingAgentTool(Tool, discriminator="bing_grounding"): - """The input definition information for a bing grounding search tool as used to configure an - agent. +class AzureFunctionDefinition(_Model): + """The definition of Azure function. - :ivar type: The object type, which is always 'bing_grounding'. Required. - :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 + :ivar function: The definition of azure function and its parameters. Required. + :vartype function: ~azure.ai.projects.models.AzureFunctionDefinitionFunction + :ivar input_binding: Input storage queue. The queue storage trigger runs a function as messages + are added to it. Required. + :vartype input_binding: ~azure.ai.projects.models.AzureFunctionBinding + :ivar output_binding: Output storage queue. The function writes output to this queue when the + input items are processed. Required. + :vartype output_binding: ~azure.ai.projects.models.AzureFunctionBinding """ - type: Literal[ToolType.BING_GROUNDING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'bing_grounding'. Required.""" - bing_grounding: "_models.BingGroundingSearchToolParameters" = rest_field( + function: "_models.AzureFunctionDefinitionFunction" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The bing grounding search tool parameters. Required.""" + """The definition of azure function and its parameters. Required.""" + input_binding: "_models.AzureFunctionBinding" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Input storage queue. The queue storage trigger runs a function as messages are added to it. + Required.""" + output_binding: "_models.AzureFunctionBinding" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Output storage queue. The function writes output to this queue when the input items are + processed. Required.""" @overload def __init__( self, *, - bing_grounding: "_models.BingGroundingSearchToolParameters", + function: "_models.AzureFunctionDefinitionFunction", + input_binding: "_models.AzureFunctionBinding", + output_binding: "_models.AzureFunctionBinding", ) -> None: ... @overload @@ -1723,46 +1732,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.BING_GROUNDING # type: ignore -class BingGroundingSearchConfiguration(_Model): - """Search configuration for Bing Grounding. +class AzureFunctionDefinitionFunction(_Model): + """AzureFunctionDefinitionFunction. - :ivar project_connection_id: Project connection id for grounding with bing search. Required. - :vartype project_connection_id: str - :ivar market: The market where the results come from. - :vartype market: str - :ivar set_lang: The language to use for user interface strings when calling Bing API. - :vartype set_lang: str - :ivar count: The number of search results to return in the bing api response. - :vartype count: int - :ivar freshness: Filter search results by a specific time range. See `accepted values here - `_. - :vartype freshness: str + :ivar name: The name of the function to be called. Required. + :vartype name: str + :ivar description: A description of what the function does, used by the model to choose when + and how to call the function. + :vartype description: str + :ivar parameters: The parameters the functions accepts, described as a JSON Schema object. + Required. + :vartype parameters: any """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Project connection id for grounding with bing search. Required.""" - market: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The market where the results come from.""" - set_lang: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The language to use for user interface strings when calling Bing API.""" - count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of search results to return in the bing api response.""" - freshness: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Filter search results by a specific time range. See `accepted values here - `_.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function to be called. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of what the function does, used by the model to choose when and how to call the + function.""" + parameters: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The parameters the functions accepts, described as a JSON Schema object. Required.""" @overload def __init__( self, *, - project_connection_id: str, - market: Optional[str] = None, - set_lang: Optional[str] = None, - count: Optional[int] = None, - freshness: Optional[str] = None, + name: str, + parameters: Any, + description: Optional[str] = None, ) -> None: ... @overload @@ -1776,27 +1775,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BingGroundingSearchToolParameters(_Model): - """The bing grounding search tool parameters. +class AzureFunctionStorageQueue(_Model): + """The structure for keeping storage queue name and URI. - :ivar search_configurations: The search configurations attached to this tool. There can be a - maximum of 1 - search configuration resource attached to the tool. Required. - :vartype search_configurations: - list[~azure.ai.projects.models.BingGroundingSearchConfiguration] + :ivar queue_service_endpoint: URI to the Azure Storage Queue service allowing you to manipulate + a queue. Required. + :vartype queue_service_endpoint: str + :ivar queue_name: The name of an Azure function storage queue. Required. + :vartype queue_name: str """ - 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.""" + queue_service_endpoint: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """URI to the Azure Storage Queue service allowing you to manipulate a queue. Required.""" + queue_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of an Azure function storage queue. Required.""" @overload def __init__( self, *, - search_configurations: list["_models.BingGroundingSearchConfiguration"], + queue_service_endpoint: str, + queue_name: str, ) -> None: ... @overload @@ -1810,37 +1809,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BlobReference(_Model): - """Blob reference details. +class TargetConfig(_Model): + """Abstract class for target configuration. - :ivar blob_uri: Blob URI path for client to upload data. Example: - ``https://blob.windows.core.net/Container/Path``. Required. - :vartype blob_uri: str - :ivar storage_account_arm_id: ARM ID of the storage account to use. Required. - :vartype storage_account_arm_id: str - :ivar credential: Credential info to access the storage account. Required. - :vartype credential: ~azure.ai.projects.models.BlobReferenceSasCredential + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureOpenAIModelConfiguration + + :ivar type: Type of the model configuration. Required. Default value is None. + :vartype type: str """ - blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) - """Blob URI path for client to upload data. Example: - ``https://blob.windows.core.net/Container/Path``. Required.""" - storage_account_arm_id: str = rest_field( - name="storageAccountArmId", visibility=["read", "create", "update", "delete", "query"] - ) - """ARM ID of the storage account to use. Required.""" - credential: "_models.BlobReferenceSasCredential" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Credential info to access the storage account. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Type of the model configuration. Required. Default value is None.""" @overload def __init__( self, *, - blob_uri: str, - storage_account_arm_id: str, - credential: "_models.BlobReferenceSasCredential", + type: str, ) -> None: ... @overload @@ -1854,46 +1841,66 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BlobReferenceSasCredential(_Model): - """SAS Credential definition. +class AzureOpenAIModelConfiguration(TargetConfig, discriminator="AzureOpenAIModel"): + """Azure OpenAI model configuration. The API version would be selected by the service for querying + the model. - :ivar sas_uri: SAS uri. Required. - :vartype sas_uri: str - :ivar type: Type of credential. Required. Default value is "SAS". + :ivar type: Required. Default value is "AzureOpenAIModel". :vartype type: str + :ivar model_deployment_name: Deployment name for AOAI model. Example: gpt-4o if in AIServices + or connection based ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). + Required. + :vartype model_deployment_name: str """ - sas_uri: str = rest_field(name="sasUri", visibility=["read"]) - """SAS uri. Required.""" - type: Literal["SAS"] = rest_field(visibility=["read"]) - """Type of credential. Required. Default value is \"SAS\".""" + type: Literal["AzureOpenAIModel"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"AzureOpenAIModel\".""" + model_deployment_name: str = rest_field( + name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"] + ) + """Deployment name for AOAI model. Example: gpt-4o if in AIServices or connection based + ``connection_name/deployment_name`` (e.g. ``my-aoai-connection/gpt-4o``). Required.""" + + @overload + def __init__( + self, + *, + model_deployment_name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["SAS"] = "SAS" + self.type = "AzureOpenAIModel" # type: ignore -class BrowserAutomationAgentTool(Tool, discriminator="browser_automation_preview"): - """The input definition information for a Browser Automation Tool, as used to configure an Agent. +class BingCustomSearchAgentTool(Tool, discriminator="bing_custom_search_preview"): + """The input definition information for a Bing custom search tool as used to configure an agent. - :ivar type: The object type, which is always 'browser_automation'. Required. - :vartype type: str or ~azure.ai.projects.models.BROWSER_AUTOMATION_PREVIEW - :ivar browser_automation_preview: The Browser Automation Tool parameters. Required. - :vartype browser_automation_preview: ~azure.ai.projects.models.BrowserAutomationToolParameters + :ivar type: The object type, which is always 'bing_custom_search'. Required. + :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.BROWSER_AUTOMATION_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'browser_automation'. Required.""" - browser_automation_preview: "_models.BrowserAutomationToolParameters" = rest_field( + type: Literal[ToolType.BING_CUSTOM_SEARCH_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'bing_custom_search'. Required.""" + bing_custom_search_preview: "_models.BingCustomSearchToolParameters" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The Browser Automation Tool parameters. Required.""" + """The bing custom search tool parameters. Required.""" @overload def __init__( self, *, - browser_automation_preview: "_models.BrowserAutomationToolParameters", + bing_custom_search_preview: "_models.BingCustomSearchToolParameters", ) -> None: ... @overload @@ -1905,25 +1912,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore + self.type = ToolType.BING_CUSTOM_SEARCH_PREVIEW # type: ignore -class BrowserAutomationToolConnectionParameters(_Model): # pylint: disable=name-too-long - """Definition of input parameters for the connection used by the Browser Automation Tool. +class BingCustomSearchConfiguration(_Model): + """A bing custom search configuration. - :ivar project_connection_id: The ID of the project connection to your Azure Playwright - resource. Required. + :ivar project_connection_id: Project connection id for grounding with bing search. Required. :vartype project_connection_id: str + :ivar instance_name: Name of the custom configuration instance given to config. Required. + :vartype instance_name: str + :ivar market: The market where the results come from. + :vartype market: str + :ivar set_lang: The language to use for user interface strings when calling Bing API. + :vartype set_lang: str + :ivar count: The number of search results to return in the bing api response. + :vartype count: int + :ivar freshness: Filter search results by a specific time range. See `accepted values here + `_. + :vartype freshness: str """ project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the project connection to your Azure Playwright resource. Required.""" + """Project connection id for grounding with bing search. Required.""" + instance_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the custom configuration instance given to config. Required.""" + market: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The market where the results come from.""" + set_lang: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The language to use for user interface strings when calling Bing API.""" + count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of search results to return in the bing api response.""" + freshness: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Filter search results by a specific time range. See `accepted values here + `_.""" @overload def __init__( self, *, project_connection_id: str, + instance_name: str, + market: Optional[str] = None, + set_lang: Optional[str] = None, + count: Optional[int] = None, + freshness: Optional[str] = None, ) -> None: ... @overload @@ -1937,24 +1970,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BrowserAutomationToolParameters(_Model): - """Definition of input parameters for the Browser Automation Tool. +class BingCustomSearchToolParameters(_Model): + """The bing custom search tool parameters. - :ivar connection: The project connection parameters associated with the Browser Automation - Tool. Required. - :vartype connection: ~azure.ai.projects.models.BrowserAutomationToolConnectionParameters + :ivar search_configurations: The project connections attached to this tool. There can be a + maximum of 1 connection + resource attached to the tool. Required. + :vartype search_configurations: list[~azure.ai.projects.models.BingCustomSearchConfiguration] """ - connection: "_models.BrowserAutomationToolConnectionParameters" = rest_field( + search_configurations: list["_models.BingCustomSearchConfiguration"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The project connection parameters associated with the Browser Automation 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__( self, *, - connection: "_models.BrowserAutomationToolConnectionParameters", + search_configurations: list["_models.BingCustomSearchConfiguration"], ) -> None: ... @overload @@ -1968,27 +2003,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CaptureStructuredOutputsTool(Tool, discriminator="capture_structured_outputs"): - """A tool for capturing structured outputs. +class BingGroundingAgentTool(Tool, discriminator="bing_grounding"): + """The input definition information for a bing grounding search tool as used to configure an + agent. - :ivar type: The type of the tool. Always ``capture_structured_outputs``. Required. - :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 + :ivar type: The object type, which is always 'bing_grounding'. Required. + :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.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.""" - outputs: "_models.StructuredOutputDefinition" = rest_field( + type: Literal[ToolType.BING_GROUNDING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'bing_grounding'. Required.""" + bing_grounding: "_models.BingGroundingSearchToolParameters" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The structured outputs to capture from the model. Required.""" + """The bing grounding search tool parameters. Required.""" @overload def __init__( self, *, - outputs: "_models.StructuredOutputDefinition", + bing_grounding: "_models.BingGroundingSearchToolParameters", ) -> None: ... @overload @@ -2000,34 +2036,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.CAPTURE_STRUCTURED_OUTPUTS # type: ignore + self.type = ToolType.BING_GROUNDING # type: ignore -class ChartCoordinate(_Model): - """Coordinates for the analysis chart. +class BingGroundingSearchConfiguration(_Model): + """Search configuration for Bing Grounding. - :ivar x: X-axis coordinate. Required. - :vartype x: int - :ivar y: Y-axis coordinate. Required. - :vartype y: int - :ivar size: Size of the chart element. Required. - :vartype size: int + :ivar project_connection_id: Project connection id for grounding with bing search. Required. + :vartype project_connection_id: str + :ivar market: The market where the results come from. + :vartype market: str + :ivar set_lang: The language to use for user interface strings when calling Bing API. + :vartype set_lang: str + :ivar count: The number of search results to return in the bing api response. + :vartype count: int + :ivar freshness: Filter search results by a specific time range. See `accepted values here + `_. + :vartype freshness: str """ - x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """X-axis coordinate. Required.""" - y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Y-axis coordinate. Required.""" - size: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Size of the chart element. Required.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Project connection id for grounding with bing search. Required.""" + market: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The market where the results come from.""" + set_lang: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The language to use for user interface strings when calling Bing API.""" + count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of search results to return in the bing api response.""" + freshness: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Filter search results by a specific time range. See `accepted values here + `_.""" @overload def __init__( self, *, - x: int, - y: int, - size: int, + project_connection_id: str, + market: Optional[str] = None, + set_lang: Optional[str] = None, + count: Optional[int] = None, + freshness: Optional[str] = None, ) -> None: ... @overload @@ -2041,49 +2089,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryItem(_Model): - """A single memory item stored in the memory store, containing content and metadata. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ChatSummaryMemoryItem, UserProfileMemoryItem +class BingGroundingSearchToolParameters(_Model): + """The bing grounding search tool parameters. - :ivar memory_id: The unique ID of the memory item. Required. - :vartype memory_id: str - :ivar updated_at: The last update time of the memory item. Required. - :vartype updated_at: ~datetime.datetime - :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. - Required. - :vartype scope: str - :ivar content: The content of the memory. Required. - :vartype content: str - :ivar kind: The kind of the memory item. Required. Known values are: "user_profile" and - "chat_summary". - :vartype kind: str or ~azure.ai.projects.models.MemoryItemKind + :ivar search_configurations: The search configurations attached to this tool. There can be a + maximum of 1 + search configuration resource attached to the tool. Required. + :vartype search_configurations: + list[~azure.ai.projects.models.BingGroundingSearchConfiguration] """ - __mapping__: dict[str, _Model] = {} - memory_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the memory item. Required.""" - updated_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + search_configurations: list["_models.BingGroundingSearchConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The last update time of the memory item. Required.""" - scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The namespace that logically groups and isolates memories, such as a user ID. Required.""" - content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The content of the memory. Required.""" - kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) - """The kind of the memory item. Required. Known values are: \"user_profile\" and \"chat_summary\".""" + """The search configurations attached to this tool. There can be a maximum of 1 + search configuration resource attached to the tool. Required.""" @overload def __init__( self, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, - kind: str, + search_configurations: list["_models.BingGroundingSearchConfiguration"], ) -> None: ... @overload @@ -2097,33 +2123,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ChatSummaryMemoryItem(MemoryItem, discriminator="chat_summary"): - """A memory item containing a summary extracted from conversations. +class BlobReference(_Model): + """Blob reference details. - :ivar memory_id: The unique ID of the memory item. Required. - :vartype memory_id: str - :ivar updated_at: The last update time of the memory item. Required. - :vartype updated_at: ~datetime.datetime - :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. - Required. - :vartype scope: str - :ivar content: The content of the memory. Required. - :vartype content: str - :ivar kind: The kind of the memory item. Required. Summary of chat conversations. - :vartype kind: str or ~azure.ai.projects.models.CHAT_SUMMARY + :ivar blob_uri: Blob URI path for client to upload data. Example: + ``https://blob.windows.core.net/Container/Path``. Required. + :vartype blob_uri: str + :ivar storage_account_arm_id: ARM ID of the storage account to use. Required. + :vartype storage_account_arm_id: str + :ivar credential: Credential info to access the storage account. Required. + :vartype credential: ~azure.ai.projects.models.BlobReferenceSasCredential """ - kind: Literal[MemoryItemKind.CHAT_SUMMARY] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The kind of the memory item. Required. Summary of chat conversations.""" + blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) + """Blob URI path for client to upload data. Example: + ``https://blob.windows.core.net/Container/Path``. Required.""" + storage_account_arm_id: str = rest_field( + name="storageAccountArmId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM ID of the storage account to use. Required.""" + credential: "_models.BlobReferenceSasCredential" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Credential info to access the storage account. Required.""" @overload def __init__( self, *, - memory_id: str, - updated_at: datetime.datetime, - scope: str, - content: str, + blob_uri: str, + storage_account_arm_id: str, + credential: "_models.BlobReferenceSasCredential", ) -> None: ... @overload @@ -2135,73 +2165,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = MemoryItemKind.CHAT_SUMMARY # type: ignore - -class ClusterInsightResult(_Model): - """Insights from the cluster analysis. - :ivar summary: Summary of the insights report. Required. - :vartype summary: ~azure.ai.projects.models.InsightSummary - :ivar clusters: List of clusters identified in the insights. Required. - :vartype clusters: list[~azure.ai.projects.models.InsightCluster] - :ivar coordinates: Optional mapping of IDs to 2D coordinates used by the UX for - visualization. +class BlobReferenceSasCredential(_Model): + """SAS Credential definition. - The map keys are string identifiers (for example, a cluster id or a sample id) - and the values are the coordinates and visual size for rendering on a 2D chart. + :ivar sas_uri: SAS uri. Required. + :vartype sas_uri: str + :ivar type: Type of credential. Required. Default value is "SAS". + :vartype type: str + """ - This property is omitted unless the client requests coordinates (for example, - by passing ``includeCoordinates=true`` as a query parameter). + sas_uri: str = rest_field(name="sasUri", visibility=["read"]) + """SAS uri. Required.""" + type: Literal["SAS"] = rest_field(visibility=["read"]) + """Type of credential. Required. Default value is \"SAS\".""" - Example: + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type: Literal["SAS"] = "SAS" - .. code-block:: - { - "cluster-1": { "x": 12, "y": 34, "size": 8 }, - "sample-123": { "x": 18, "y": 22, "size": 4 } - } +class BrowserAutomationAgentTool(Tool, discriminator="browser_automation_preview"): + """The input definition information for a Browser Automation Tool, as used to configure an Agent. - Coordinates are intended only for client-side visualization and do not - modify the canonical insights results. - :vartype coordinates: dict[str, ~azure.ai.projects.models.ChartCoordinate] + :ivar type: The object type, which is always 'browser_automation'. Required. + :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 """ - summary: "_models.InsightSummary" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Summary of the insights report. Required.""" - clusters: list["_models.InsightCluster"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of clusters identified in the insights. Required.""" - coordinates: Optional[dict[str, "_models.ChartCoordinate"]] = rest_field( + 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'. Required.""" + browser_automation_preview: "_models.BrowserAutomationToolParameters" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """ Optional mapping of IDs to 2D coordinates used by the UX for visualization. - - The map keys are string identifiers (for example, a cluster id or a sample id) - and the values are the coordinates and visual size for rendering on a 2D chart. - - This property is omitted unless the client requests coordinates (for example, - by passing ``includeCoordinates=true`` as a query parameter). - - Example: - - .. code-block:: - - { - \"cluster-1\": { \"x\": 12, \"y\": 34, \"size\": 8 }, - \"sample-123\": { \"x\": 18, \"y\": 22, \"size\": 4 } - } - - Coordinates are intended only for client-side visualization and do not - modify the canonical insights results.""" + """The Browser Automation Tool parameters. Required.""" @overload def __init__( self, *, - summary: "_models.InsightSummary", - clusters: list["_models.InsightCluster"], - coordinates: Optional[dict[str, "_models.ChartCoordinate"]] = None, + browser_automation_preview: "_models.BrowserAutomationToolParameters", ) -> None: ... @overload @@ -2213,39 +2218,25 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.BROWSER_AUTOMATION_PREVIEW # type: ignore -class ClusterTokenUsage(_Model): - """Token usage for cluster analysis. +class BrowserAutomationToolConnectionParameters(_Model): # pylint: disable=name-too-long + """Definition of input parameters for the connection used by the Browser Automation Tool. - :ivar input_token_usage: input token usage. Required. - :vartype input_token_usage: int - :ivar output_token_usage: output token usage. Required. - :vartype output_token_usage: int - :ivar total_token_usage: total token usage. Required. - :vartype total_token_usage: int + :ivar project_connection_id: The ID of the project connection to your Azure Playwright + resource. Required. + :vartype project_connection_id: str """ - input_token_usage: int = rest_field( - name="inputTokenUsage", visibility=["read", "create", "update", "delete", "query"] - ) - """input token usage. Required.""" - output_token_usage: int = rest_field( - name="outputTokenUsage", visibility=["read", "create", "update", "delete", "query"] - ) - """output token usage. Required.""" - total_token_usage: int = rest_field( - name="totalTokenUsage", visibility=["read", "create", "update", "delete", "query"] - ) - """total token usage. Required.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the project connection to your Azure Playwright resource. Required.""" @overload def __init__( self, *, - input_token_usage: int, - output_token_usage: int, - total_token_usage: int, + project_connection_id: str, ) -> None: ... @overload @@ -2259,48 +2250,24 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EvaluatorDefinition(_Model): - """Base evaluator configuration with discriminator. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CodeBasedEvaluatorDefinition, PromptBasedEvaluatorDefinition +class BrowserAutomationToolParameters(_Model): + """Definition of input parameters for the Browser Automation Tool. - :ivar type: The type of evaluator definition. Required. Known values are: "prompt", "code", - "prompt_and_code", "service", and "openai_graders". - :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 - :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 - :ivar metrics: List of output metrics produced by this evaluator. - :vartype metrics: dict[str, ~azure.ai.projects.models.EvaluatorMetric] + :ivar connection: The project connection parameters associated with the Browser Automation + Tool. Required. + :vartype connection: ~azure.ai.projects.models.BrowserAutomationToolConnectionParameters """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of evaluator definition. Required. Known values are: \"prompt\", \"code\", - \"prompt_and_code\", \"service\", and \"openai_graders\".""" - init_parameters: Optional[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"]) - """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( + connection: "_models.BrowserAutomationToolConnectionParameters" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """List of output metrics produced by this evaluator.""" + """The project connection parameters associated with the Browser Automation Tool. Required.""" @overload def __init__( self, *, - type: str, - init_parameters: Optional[Any] = None, - data_schema: Optional[Any] = None, - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, + connection: "_models.BrowserAutomationToolConnectionParameters", ) -> None: ... @overload @@ -2314,36 +2281,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CodeBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="code"): - """Code-based evaluator definition using python code. +class CaptureStructuredOutputsTool(Tool, discriminator="capture_structured_outputs"): + """A tool for capturing structured outputs. - :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 - :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 - :ivar metrics: List of output metrics produced by this evaluator. - :vartype metrics: dict[str, ~azure.ai.projects.models.EvaluatorMetric] - :ivar type: Required. Code-based definition - :vartype type: str or ~azure.ai.projects.models.CODE - :ivar code_text: Inline code text for the evaluator. Required. - :vartype code_text: str + :ivar type: The type of the tool. Always ``capture_structured_outputs``. Required. + :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[EvaluatorDefinitionType.CODE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Code-based definition""" - code_text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Inline code text for the evaluator. Required.""" + 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.""" + outputs: "_models.StructuredOutputDefinition" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The structured outputs to capture from the model. Required.""" @overload def __init__( self, *, - code_text: str, - init_parameters: Optional[Any] = None, - data_schema: Optional[Any] = None, - metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, + outputs: "_models.StructuredOutputDefinition", ) -> None: ... @overload @@ -2355,28 +2313,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluatorDefinitionType.CODE # type: ignore - + self.type = ToolType.CAPTURE_STRUCTURED_OUTPUTS # type: ignore -class CodeInterpreterOutput(_Model): - """CodeInterpreterOutput. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CodeInterpreterOutputImage, CodeInterpreterOutputLogs +class ChartCoordinate(_Model): + """Coordinates for the analysis chart. - :ivar type: Required. Known values are: "logs" and "image". - :vartype type: str or ~azure.ai.projects.models.CodeInterpreterOutputType + :ivar x: X-axis coordinate. Required. + :vartype x: int + :ivar y: Y-axis coordinate. Required. + :vartype y: int + :ivar size: Size of the chart element. Required. + :vartype size: int """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"logs\" and \"image\".""" + x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """X-axis coordinate. Required.""" + y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Y-axis coordinate. Required.""" + size: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Size of the chart element. Required.""" @overload def __init__( self, *, - type: str, + x: int, + y: int, + size: int, ) -> None: ... @overload @@ -2390,25 +2354,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CodeInterpreterOutputImage(CodeInterpreterOutput, discriminator="image"): - """The image output from the code interpreter. +class MemoryItem(_Model): + """A single memory item stored in the memory store, containing content and metadata. - :ivar type: The type of the output. Always 'image'. Required. - :vartype type: str or ~azure.ai.projects.models.IMAGE - :ivar url: The URL of the image output from the code interpreter. Required. - :vartype url: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ChatSummaryMemoryItem, UserProfileMemoryItem + + :ivar memory_id: The unique ID of the memory item. Required. + :vartype memory_id: str + :ivar updated_at: The last update time of the memory item. Required. + :vartype updated_at: ~datetime.datetime + :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :vartype scope: str + :ivar content: The content of the memory. Required. + :vartype content: str + :ivar kind: The kind of the memory item. Required. Known values are: "user_profile" and + "chat_summary". + :vartype kind: str or ~azure.ai.projects.models.MemoryItemKind """ - type: Literal[CodeInterpreterOutputType.IMAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the output. Always 'image'. Required.""" - url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The URL of the image output from the code interpreter. Required.""" + __mapping__: dict[str, _Model] = {} + memory_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the memory item. Required.""" + updated_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The last update time of the memory item. Required.""" + scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The namespace that logically groups and isolates memories, such as a user ID. Required.""" + content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The content of the memory. Required.""" + kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) + """The kind of the memory item. Required. Known values are: \"user_profile\" and \"chat_summary\".""" @overload def __init__( self, *, - url: str, + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: str, + kind: str, ) -> None: ... @overload @@ -2420,28 +2408,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CodeInterpreterOutputType.IMAGE # type: ignore -class CodeInterpreterOutputLogs(CodeInterpreterOutput, discriminator="logs"): - """The logs output from the code interpreter. +class ChatSummaryMemoryItem(MemoryItem, discriminator="chat_summary"): + """A memory item containing a summary extracted from conversations. - :ivar type: The type of the output. Always 'logs'. Required. - :vartype type: str or ~azure.ai.projects.models.LOGS - :ivar logs: The logs output from the code interpreter. Required. - :vartype logs: str + :ivar memory_id: The unique ID of the memory item. Required. + :vartype memory_id: str + :ivar updated_at: The last update time of the memory item. Required. + :vartype updated_at: ~datetime.datetime + :ivar scope: The namespace that logically groups and isolates memories, such as a user ID. + Required. + :vartype scope: str + :ivar content: The content of the memory. Required. + :vartype content: str + :ivar kind: The kind of the memory item. Required. Summary of chat conversations. + :vartype kind: str or ~azure.ai.projects.models.CHAT_SUMMARY """ - type: Literal[CodeInterpreterOutputType.LOGS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the output. Always 'logs'. Required.""" - logs: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The logs output from the code interpreter. Required.""" + kind: Literal[MemoryItemKind.CHAT_SUMMARY] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The kind of the memory item. Required. Summary of chat conversations.""" @overload def __init__( self, *, - logs: str, + memory_id: str, + updated_at: datetime.datetime, + scope: str, + content: str, ) -> None: ... @overload @@ -2453,34 +2448,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CodeInterpreterOutputType.LOGS # type: ignore + self.kind = MemoryItemKind.CHAT_SUMMARY # type: ignore -class CodeInterpreterTool(Tool, discriminator="code_interpreter"): - """A tool that runs Python code to help generate a response to a prompt. +class ComputerAction(_Model): + """ComputerAction. - :ivar type: The type of the code interpreter tool. Always ``code_interpreter``. Required. - :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. Required. Is either a str type or a - CodeInterpreterToolAuto type. - :vartype container: str or ~azure.ai.projects.models.CodeInterpreterToolAuto + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ClickParam, DoubleClickAction, Drag, KeyPressAction, Move, Screenshot, Scroll, Type, Wait + + :ivar type: Required. Known values are: "click", "double_click", "drag", "keypress", "move", + "screenshot", "scroll", "type", and "wait". + :vartype type: str or ~azure.ai.projects.models.ComputerActionType """ - 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.CodeInterpreterToolAuto"] = 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. Required. Is either a str type or a - CodeInterpreterToolAuto type.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"click\", \"double_click\", \"drag\", \"keypress\", \"move\", + \"screenshot\", \"scroll\", \"type\", and \"wait\".""" @overload def __init__( self, *, - container: Union[str, "_models.CodeInterpreterToolAuto"], + type: str, ) -> None: ... @overload @@ -2492,29 +2483,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.CODE_INTERPRETER # type: ignore -class CodeInterpreterToolAuto(_Model): - """Configuration for a code interpreter container. Optionally specify the IDs - of the files to run the code on. +class ClickParam(ComputerAction, discriminator="click"): + """Click. - :ivar type: Always ``auto``. Required. Default value is "auto". - :vartype type: str - :ivar file_ids: An optional list of uploaded files to make available to your code. - :vartype file_ids: list[str] + :ivar type: Specifies the event type. For a click action, this property is always ``click``. + Required. + :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", + "wheel", "back", and "forward". + :vartype button: str or ~azure.ai.projects.models.ClickButtonType + :ivar x: The x-coordinate where the click occurred. Required. + :vartype x: int + :ivar y: The y-coordinate where the click occurred. Required. + :vartype y: int """ - type: Literal["auto"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Always ``auto``. Required. Default value is \"auto\".""" - file_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional list of uploaded files to make available to your code.""" + 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.""" + button: Union[str, "_models.ClickButtonType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates which mouse button was pressed during the click. One of ``left``, ``right``, + ``wheel``, ``back``, or ``forward``. Required. Known values are: \"left\", \"right\", + \"wheel\", \"back\", and \"forward\".""" + x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The x-coordinate where the click occurred. Required.""" + y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The y-coordinate where the click occurred. Required.""" @overload def __init__( self, *, - file_ids: Optional[list[str]] = None, + button: Union[str, "_models.ClickButtonType"], + x: int, + y: int, ) -> None: ... @overload @@ -2526,43 +2532,73 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["auto"] = "auto" + self.type = ComputerActionType.CLICK # type: ignore -class ItemParam(_Model): - """Content item used to generate a response. +class ClusterInsightResult(_Model): + """Insights from the cluster analysis. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CodeInterpreterToolCallItemParam, ComputerToolCallItemParam, ComputerToolCallOutputItemParam, - FileSearchToolCallItemParam, FunctionToolCallItemParam, FunctionToolCallOutputItemParam, - ImageGenToolCallItemParam, ItemReferenceItemParam, LocalShellToolCallItemParam, - LocalShellToolCallOutputItemParam, MCPApprovalRequestItemParam, MCPApprovalResponseItemParam, - MCPCallItemParam, MCPListToolsItemParam, MemorySearchToolCallItemParam, - ResponsesMessageItemParam, ReasoningItemParam, WebSearchToolCallItemParam - - :ivar type: Required. Known values are: "message", "file_search_call", "function_call", - "function_call_output", "computer_call", "computer_call_output", "web_search_call", - "reasoning", "item_reference", "image_generation_call", "code_interpreter_call", - "local_shell_call", "local_shell_call_output", "mcp_list_tools", "mcp_approval_request", - "mcp_approval_response", "mcp_call", "structured_outputs", "workflow_action", - "memory_search_call", and "oauth_consent_request". - :vartype type: str or ~azure.ai.projects.models.ItemType + :ivar summary: Summary of the insights report. Required. + :vartype summary: ~azure.ai.projects.models.InsightSummary + :ivar clusters: List of clusters identified in the insights. Required. + :vartype clusters: list[~azure.ai.projects.models.InsightCluster] + :ivar coordinates: Optional mapping of IDs to 2D coordinates used by the UX for + visualization. + + The map keys are string identifiers (for example, a cluster id or a sample id) + and the values are the coordinates and visual size for rendering on a 2D chart. + + This property is omitted unless the client requests coordinates (for example, + by passing ``includeCoordinates=true`` as a query parameter). + + Example: + + .. code-block:: + + { + "cluster-1": { "x": 12, "y": 34, "size": 8 }, + "sample-123": { "x": 18, "y": 22, "size": 4 } + } + + Coordinates are intended only for client-side visualization and do not + modify the canonical insights results. + :vartype coordinates: dict[str, ~azure.ai.projects.models.ChartCoordinate] """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"message\", \"file_search_call\", \"function_call\", - \"function_call_output\", \"computer_call\", \"computer_call_output\", \"web_search_call\", - \"reasoning\", \"item_reference\", \"image_generation_call\", \"code_interpreter_call\", - \"local_shell_call\", \"local_shell_call_output\", \"mcp_list_tools\", - \"mcp_approval_request\", \"mcp_approval_response\", \"mcp_call\", \"structured_outputs\", - \"workflow_action\", \"memory_search_call\", and \"oauth_consent_request\".""" + summary: "_models.InsightSummary" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Summary of the insights report. Required.""" + clusters: list["_models.InsightCluster"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of clusters identified in the insights. Required.""" + coordinates: Optional[dict[str, "_models.ChartCoordinate"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """ Optional mapping of IDs to 2D coordinates used by the UX for visualization. + + The map keys are string identifiers (for example, a cluster id or a sample id) + and the values are the coordinates and visual size for rendering on a 2D chart. + + This property is omitted unless the client requests coordinates (for example, + by passing ``includeCoordinates=true`` as a query parameter). + + Example: + + .. code-block:: + + { + \"cluster-1\": { \"x\": 12, \"y\": 34, \"size\": 8 }, + \"sample-123\": { \"x\": 18, \"y\": 22, \"size\": 4 } + } + + Coordinates are intended only for client-side visualization and do not + modify the canonical insights results.""" @overload def __init__( self, *, - type: str, + summary: "_models.InsightSummary", + clusters: list["_models.InsightCluster"], + coordinates: Optional[dict[str, "_models.ChartCoordinate"]] = None, ) -> None: ... @overload @@ -2576,39 +2612,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CodeInterpreterToolCallItemParam(ItemParam, discriminator="code_interpreter_call"): - """A tool call to run code. +class ClusterTokenUsage(_Model): + """Token usage for cluster analysis. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER_CALL - :ivar container_id: The ID of the container used to run the code. Required. - :vartype container_id: str - :ivar code: The code to run, or null if not available. Required. - :vartype code: str - :ivar outputs: The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. Required. - :vartype outputs: list[~azure.ai.projects.models.CodeInterpreterOutput] + :ivar input_token_usage: input token usage. Required. + :vartype input_token_usage: int + :ivar output_token_usage: output token usage. Required. + :vartype output_token_usage: int + :ivar total_token_usage: total token usage. Required. + :vartype total_token_usage: int """ - type: Literal[ItemType.CODE_INTERPRETER_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - 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"]) - """The code to run, or null if not available. Required.""" - outputs: list["_models.CodeInterpreterOutput"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + input_token_usage: int = rest_field( + name="inputTokenUsage", visibility=["read", "create", "update", "delete", "query"] + ) + """input token usage. Required.""" + output_token_usage: int = rest_field( + name="outputTokenUsage", visibility=["read", "create", "update", "delete", "query"] + ) + """output token usage. Required.""" + total_token_usage: int = rest_field( + name="totalTokenUsage", visibility=["read", "create", "update", "delete", "query"] ) - """The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. Required.""" + """total token usage. Required.""" @overload def __init__( self, *, - container_id: str, - code: str, - outputs: list["_models.CodeInterpreterOutput"], + input_token_usage: int, + output_token_usage: int, + total_token_usage: int, ) -> None: ... @overload @@ -2620,55 +2654,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.CODE_INTERPRETER_CALL # type: ignore -class ItemResource(_Model): - """Content item used to generate a response. +class EvaluatorDefinition(_Model): + """Base evaluator configuration with discriminator. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CodeInterpreterToolCallItemResource, ComputerToolCallItemResource, - ComputerToolCallOutputItemResource, FileSearchToolCallItemResource, - FunctionToolCallItemResource, FunctionToolCallOutputItemResource, ImageGenToolCallItemResource, - LocalShellToolCallItemResource, LocalShellToolCallOutputItemResource, - MCPApprovalRequestItemResource, MCPApprovalResponseItemResource, MCPCallItemResource, - MCPListToolsItemResource, MemorySearchToolCallItemResource, ResponsesMessageItemResource, - OAuthConsentRequestItemResource, ReasoningItemResource, StructuredOutputsItemResource, - WebSearchToolCallItemResource, WorkflowActionOutputItemResource - - :ivar type: Required. Known values are: "message", "file_search_call", "function_call", - "function_call_output", "computer_call", "computer_call_output", "web_search_call", - "reasoning", "item_reference", "image_generation_call", "code_interpreter_call", - "local_shell_call", "local_shell_call_output", "mcp_list_tools", "mcp_approval_request", - "mcp_approval_response", "mcp_call", "structured_outputs", "workflow_action", - "memory_search_call", and "oauth_consent_request". - :vartype type: str or ~azure.ai.projects.models.ItemType - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy + CodeBasedEvaluatorDefinition, PromptBasedEvaluatorDefinition + + :ivar type: The type of evaluator definition. Required. Known values are: "prompt", "code", + "prompt_and_code", "service", and "openai_graders". + :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 + :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 + :ivar metrics: List of output metrics produced by this evaluator. + :vartype metrics: dict[str, ~azure.ai.projects.models.EvaluatorMetric] """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"message\", \"file_search_call\", \"function_call\", - \"function_call_output\", \"computer_call\", \"computer_call_output\", \"web_search_call\", - \"reasoning\", \"item_reference\", \"image_generation_call\", \"code_interpreter_call\", - \"local_shell_call\", \"local_shell_call_output\", \"mcp_list_tools\", - \"mcp_approval_request\", \"mcp_approval_response\", \"mcp_call\", \"structured_outputs\", - \"workflow_action\", \"memory_search_call\", and \"oauth_consent_request\".""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - created_by: Optional["_models.CreatedBy"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The information about the creator of the item.""" + """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"]) + """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"]) + """The JSON schema (Draft 2020-12) for the evaluator's input data. This includes parameters like + type, properties, required.""" + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of output metrics produced by this evaluator.""" @overload def __init__( self, *, type: str, - id: str, # pylint: disable=redefined-builtin - created_by: Optional["_models.CreatedBy"] = None, + init_parameters: Optional[Any] = None, + data_schema: Optional[Any] = None, + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, ) -> None: ... @overload @@ -2682,54 +2711,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CodeInterpreterToolCallItemResource(ItemResource, discriminator="code_interpreter_call"): - """A tool call to run code. - - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER_CALL - :ivar status: 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: The code to run, or null if not available. Required. - :vartype code: str - :ivar outputs: The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. Required. - :vartype outputs: list[~azure.ai.projects.models.CodeInterpreterOutput] - """ +class CodeBasedEvaluatorDefinition(EvaluatorDefinition, discriminator="code"): + """Code-based evaluator definition using python code. - type: Literal[ItemType.CODE_INTERPRETER_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - status: Literal["in_progress", "completed", "incomplete", "interpreting", "failed"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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"]) - """The code to run, or null if not available. Required.""" - outputs: list["_models.CodeInterpreterOutput"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. Required.""" + :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 + :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 + :ivar metrics: List of output metrics produced by this evaluator. + :vartype metrics: dict[str, ~azure.ai.projects.models.EvaluatorMetric] + :ivar type: Required. Code-based definition + :vartype type: str or ~azure.ai.projects.models.CODE + :ivar code_text: Inline code text for the evaluator. 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""" + code_text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Inline code text for the evaluator. 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["_models.CodeInterpreterOutput"], - created_by: Optional["_models.CreatedBy"] = None, + code_text: str, + init_parameters: Optional[Any] = None, + data_schema: Optional[Any] = None, + metrics: Optional[dict[str, "_models.EvaluatorMetric"]] = None, ) -> None: ... @overload @@ -2741,46 +2752,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.CODE_INTERPRETER_CALL # type: ignore + self.type = EvaluatorDefinitionType.CODE # type: ignore -class ComparisonFilter(_Model): - """A filter used to compare a specified attribute key to a given value using a defined comparison - operation. +class CodeInterpreterContainerAuto(_Model): + """CodeInterpreterToolAuto. - :ivar type: Specifies the comparison operator: - ``eq`` (equal), ``ne`` (not equal), ``gt`` (greater than), ``gte`` (greater than or equal), - ``lt`` (less than), ``lte`` (less than or equal). Required. Is one of the following types: - Literal["eq"], Literal["ne"], Literal["gt"], Literal["gte"], Literal["lt"], Literal["lte"] - :vartype type: str or str or str or str or str or str - :ivar key: The key to compare against the value. Required. - :vartype key: str - :ivar value: The value to compare against the attribute key; supports string, number, or - boolean types. Required. Is one of the following types: str, float, bool - :vartype value: str or float or bool + :ivar type: Always ``auto``. Required. Default value is "auto". + :vartype type: str + :ivar file_ids: An optional list of uploaded files to make available to your code. + :vartype file_ids: list[str] + :ivar memory_limit: Known values are: "1g", "4g", "16g", and "64g". + :vartype memory_limit: str or ~azure.ai.projects.models.ContainerMemoryLimit """ - type: Literal["eq", "ne", "gt", "gte", "lt", "lte"] = rest_field( + type: Literal["auto"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Always ``auto``. Required. Default value is \"auto\".""" + file_ids: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional list of uploaded files to make available to your code.""" + memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Specifies the comparison operator: - ``eq`` (equal), ``ne`` (not equal), ``gt`` (greater than), ``gte`` (greater than or equal), - ``lt`` (less than), ``lte`` (less than or equal). Required. Is one of the following types: - Literal[\"eq\"], Literal[\"ne\"], Literal[\"gt\"], Literal[\"gte\"], Literal[\"lt\"], - Literal[\"lte\"]""" - key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The key to compare against the value. Required.""" - value: Union[str, float, bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The value to compare against the attribute key; supports string, number, or boolean types. - Required. Is one of the following types: str, float, bool""" + """Known values are: \"1g\", \"4g\", \"16g\", and \"64g\".""" @overload def __init__( self, *, - type: Literal["eq", "ne", "gt", "gte", "lt", "lte"], - key: str, - value: Union[str, float, bool], + file_ids: Optional[list[str]] = None, + memory_limit: Optional[Union[str, "_models.ContainerMemoryLimit"]] = None, ) -> None: ... @overload @@ -2792,34 +2792,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["auto"] = "auto" -class CompoundFilter(_Model): - """Combine multiple filters using ``and`` or ``or``. +class CodeInterpreterOutputImage(_Model): + """Code interpreter output image. - :ivar type: Type of operation: ``and`` or ``or``. Required. Is either a Literal["and"] type or - a Literal["or"] type. - :vartype type: str or str - :ivar filters: Array of filters to combine. Items can be ``ComparisonFilter`` or - ``CompoundFilter``. Required. - :vartype filters: list[~azure.ai.projects.models.ComparisonFilter or - ~azure.ai.projects.models.CompoundFilter] + :ivar type: The type of the output. Always ``image``. Required. Default value is "image". + :vartype type: str + :ivar url: The URL of the image output from the code interpreter. Required. + :vartype url: str """ - type: Literal["and", "or"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Type of operation: ``and`` or ``or``. Required. Is either a Literal[\"and\"] type or a - Literal[\"or\"] type.""" - filters: list[Union["_models.ComparisonFilter", "_models.CompoundFilter"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Array of filters to combine. Items can be ``ComparisonFilter`` or ``CompoundFilter``. Required.""" + type: Literal["image"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the output. Always ``image``. Required. Default value is \"image\".""" + url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL of the image output from the code interpreter. Required.""" @overload def __init__( self, *, - type: Literal["and", "or"], - filters: list[Union["_models.ComparisonFilter", "_models.CompoundFilter"]], + url: str, ) -> None: ... @overload @@ -2831,31 +2825,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["image"] = "image" -class ComputerAction(_Model): - """ComputerAction. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ComputerActionClick, ComputerActionDoubleClick, ComputerActionDrag, ComputerActionKeyPress, - ComputerActionMove, ComputerActionScreenshot, ComputerActionScroll, ComputerActionTypeKeys, - ComputerActionWait +class CodeInterpreterOutputLogs(_Model): + """Code interpreter output logs. - :ivar type: Required. Known values are: "screenshot", "click", "double_click", "scroll", - "type", "wait", "keypress", "drag", and "move". - :vartype type: str or ~azure.ai.projects.models.ComputerActionType + :ivar type: The type of the output. Always ``logs``. Required. Default value is "logs". + :vartype type: str + :ivar logs: The logs output from the code interpreter. Required. + :vartype logs: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"screenshot\", \"click\", \"double_click\", \"scroll\", \"type\", - \"wait\", \"keypress\", \"drag\", and \"move\".""" + type: Literal["logs"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the output. Always ``logs``. Required. Default value is \"logs\".""" + logs: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The logs output from the code interpreter. Required.""" @overload def __init__( self, *, - type: str, + logs: str, ) -> None: ... @overload @@ -2867,46 +2858,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["logs"] = "logs" -class ComputerActionClick(ComputerAction, discriminator="click"): - """A click action. +class CodeInterpreterTool(Tool, discriminator="code_interpreter"): + """Code interpreter. - :ivar type: Specifies the event type. For a click action, this property is - always set to ``click``. Required. - :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. Is one of the following types: - Literal["left"], Literal["right"], Literal["wheel"], Literal["back"], Literal["forward"] - :vartype button: str or str or str or str or str - :ivar x: The x-coordinate where the click occurred. Required. - :vartype x: int - :ivar y: The y-coordinate where the click occurred. Required. - :vartype y: int + :ivar type: The type of the code interpreter tool. Always ``code_interpreter``. Required. + :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 + CodeInterpreterContainerAuto type. + :vartype container: str or ~azure.ai.projects.models.CodeInterpreterContainerAuto """ - 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 set to ``click``. Required.""" - button: Literal["left", "right", "wheel", "back", "forward"] = rest_field( + 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( visibility=["read", "create", "update", "delete", "query"] ) - """Indicates which mouse button was pressed during the click. One of ``left``, ``right``, - ``wheel``, ``back``, or ``forward``. Required. Is one of the following types: - Literal[\"left\"], Literal[\"right\"], Literal[\"wheel\"], Literal[\"back\"], - Literal[\"forward\"]""" - x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The x-coordinate where the click occurred. Required.""" - y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The y-coordinate where the click occurred. Required.""" + """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.""" @overload def __init__( self, *, - button: Literal["left", "right", "wheel", "back", "forward"], - x: int, - y: int, + container: Union[str, "_models.CodeInterpreterContainerAuto"], ) -> None: ... @overload @@ -2918,35 +2899,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ComputerActionType.CLICK # type: ignore + self.type = ToolType.CODE_INTERPRETER # type: ignore -class ComputerActionDoubleClick(ComputerAction, discriminator="double_click"): - """A double click action. +class CompactionSummaryItemParam(Item, discriminator="compaction"): + """Compaction item. - :ivar type: Specifies the event type. For a double click action, this property is - always set to ``double_click``. Required. - :vartype type: str or ~azure.ai.projects.models.DOUBLE_CLICK - :ivar x: The x-coordinate where the double click occurred. Required. - :vartype x: int - :ivar y: The y-coordinate where the double click occurred. Required. - :vartype y: int + :ivar id: + :vartype id: str + :ivar type: The type of the item. Always ``compaction``. Required. + :vartype type: str or ~azure.ai.projects.models.COMPACTION + :ivar encrypted_content: Required. + :vartype encrypted_content: str """ - 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.""" - 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"]) - """The y-coordinate where the double click occurred. Required.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[ItemType.COMPACTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``compaction``. Required.""" + encrypted_content: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - x: int, - y: int, + encrypted_content: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -2958,48 +2936,64 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ComputerActionType.DOUBLE_CLICK # type: ignore - - -class ComputerActionDrag(ComputerAction, discriminator="drag"): - """A drag action. - - :ivar type: Specifies the event type. For a drag action, this property is - always set to ``drag``. Required. - :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 + self.type = ItemType.COMPACTION # type: ignore - .. code-block:: - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ]. Required. - :vartype path: list[~azure.ai.projects.models.Coordinate] +class ComparisonFilter(_Model): + """Comparison Filter. + + :ivar type: Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, + ``lte``, ``in``, ``nin``. + + * `eq`: equals + * `ne`: not equal + * `gt`: greater than + * `gte`: greater than or equal + * `lt`: less than + * `lte`: less than or equal + * `in`: in + * `nin`: not in. Required. Is one of the following types: Literal["eq"], Literal["ne"], + Literal["gt"], Literal["gte"], Literal["lt"], Literal["lte"] + :vartype type: str or str or str or str or str or str + :ivar key: The key to compare against the value. Required. + :vartype key: str + :ivar value: The value to compare against the attribute key; supports string, number, or + boolean types. Required. Is one of the following types: str, float, bool, + ["_types.ComparisonFilterValueItems"] + :vartype value: str or float or bool or list[str or float] """ - 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.""" - path: list["_models.Coordinate"] = 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 - - .. code-block:: - - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ]. Required.""" + type: Literal["eq", "ne", "gt", "gte", "lt", "lte"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the comparison operator: ``eq``, ``ne``, ``gt``, ``gte``, ``lt``, ``lte``, ``in``, + ``nin``. + + * `eq`: equals + * `ne`: not equal + * `gt`: greater than + * `gte`: greater than or equal + * `lt`: less than + * `lte`: less than or equal + * `in`: in + * `nin`: not in. Required. Is one of the following types: Literal[\"eq\"], + Literal[\"ne\"], Literal[\"gt\"], Literal[\"gte\"], Literal[\"lt\"], Literal[\"lte\"]""" + key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The key to compare against the value. Required.""" + value: Union[str, float, bool, list["_types.ComparisonFilterValueItems"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The value to compare against the attribute key; supports string, number, or boolean types. + Required. Is one of the following types: str, float, bool, + [\"_types.ComparisonFilterValueItems\"]""" @overload def __init__( self, *, - path: list["_models.Coordinate"], + type: Literal["eq", "ne", "gt", "gte", "lt", "lte"], + key: str, + value: Union[str, float, bool, list["_types.ComparisonFilterValueItems"]], ) -> None: ... @overload @@ -3011,32 +3005,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ComputerActionType.DRAG # type: ignore -class ComputerActionKeyPress(ComputerAction, discriminator="keypress"): - """A collection of keypresses the model would like to perform. +class CompoundFilter(_Model): + """Compound Filter. - :ivar type: Specifies the event type. For a keypress action, this property is - always set to ``keypress``. Required. - :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. - :vartype keys_property: list[str] + :ivar type: Type of operation: ``and`` or ``or``. Required. Is either a Literal["and"] type or + a Literal["or"] type. + :vartype type: str or str + :ivar filters: Array of filters to combine. Items can be ``ComparisonFilter`` or + ``CompoundFilter``. Required. + :vartype filters: list[~azure.ai.projects.models.ComparisonFilter or any] """ - 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.""" - keys_property: list[str] = rest_field(name="keys", visibility=["read", "create", "update", "delete", "query"]) - """The combination of keys the model is requesting to be pressed. This is an - array of strings, each representing a key. Required.""" + type: Literal["and", "or"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Type of operation: ``and`` or ``or``. Required. Is either a Literal[\"and\"] type or a + Literal[\"or\"] type.""" + filters: list[Union["_models.ComparisonFilter", Any]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Array of filters to combine. Items can be ``ComparisonFilter`` or ``CompoundFilter``. Required.""" @overload def __init__( self, *, - keys_property: list[str], + type: Literal["and", "or"], + filters: list[Union["_models.ComparisonFilter", Any]], ) -> None: ... @overload @@ -3048,35 +3043,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ComputerActionType.KEYPRESS # type: ignore -class ComputerActionMove(ComputerAction, discriminator="move"): - """A mouse move action. +class ComputerCallOutputItemParam(Item, discriminator="computer_call_output"): + """Computer tool call output. - :ivar type: Specifies the event type. For a move action, this property is - always set to ``move``. Required. - :vartype type: str or ~azure.ai.projects.models.MOVE - :ivar x: The x-coordinate to move to. Required. - :vartype x: int - :ivar y: The y-coordinate to move to. Required. - :vartype y: int + :ivar id: + :vartype id: str + :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. + :vartype type: str or ~azure.ai.projects.models.COMPUTER_CALL_OUTPUT + :ivar output: Required. + :vartype output: ~azure.ai.projects.models.ComputerScreenshotImage + :ivar acknowledged_safety_checks: + :vartype acknowledged_safety_checks: + list[~azure.ai.projects.models.ComputerCallSafetyCheckParam] + :ivar status: Known values are: "in_progress", "completed", and "incomplete". + :vartype status: str or ~azure.ai.projects.models.FunctionCallItemStatus """ - 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.""" - 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"]) - """The y-coordinate to move to. Required.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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[ItemType.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.""" + output: "_models.ComputerScreenshotImage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + acknowledged_safety_checks: Optional[list["_models.ComputerCallSafetyCheckParam"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + status: Optional[Union[str, "_models.FunctionCallItemStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"in_progress\", \"completed\", and \"incomplete\".""" @overload def __init__( self, *, - x: int, - y: int, + call_id: str, + output: "_models.ComputerScreenshotImage", + id: Optional[str] = None, # pylint: disable=redefined-builtin + acknowledged_safety_checks: Optional[list["_models.ComputerCallSafetyCheckParam"]] = None, + status: Optional[Union[str, "_models.FunctionCallItemStatus"]] = None, ) -> None: ... @overload @@ -3088,24 +3099,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ComputerActionType.MOVE # type: ignore + self.type = ItemType.COMPUTER_CALL_OUTPUT # type: ignore -class ComputerActionScreenshot(ComputerAction, discriminator="screenshot"): - """A screenshot action. +class ComputerCallSafetyCheckParam(_Model): + """A pending safety check for the computer call. - :ivar type: Specifies the event type. For a screenshot action, this property is - always set to ``screenshot``. Required. - :vartype type: str or ~azure.ai.projects.models.SCREENSHOT + :ivar id: The ID of the pending safety check. Required. + :vartype id: str + :ivar code: + :vartype code: str + :ivar message: + :vartype message: str """ - 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.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the pending safety check. Required.""" + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, + *, + id: str, # pylint: disable=redefined-builtin + code: Optional[str] = None, + message: Optional[str] = None, ) -> None: ... @overload @@ -3117,45 +3136,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ComputerActionType.SCREENSHOT # type: ignore -class ComputerActionScroll(ComputerAction, discriminator="scroll"): - """A scroll action. +class ComputerScreenshotImage(_Model): + """A computer screenshot image used with the computer use tool. - :ivar type: Specifies the event type. For a scroll action, this property is - always set to ``scroll``. Required. - :vartype type: str or ~azure.ai.projects.models.SCROLL - :ivar x: The x-coordinate where the scroll occurred. Required. - :vartype x: int - :ivar y: The y-coordinate where the scroll occurred. Required. - :vartype y: int - :ivar scroll_x: The horizontal scroll distance. Required. - :vartype scroll_x: int - :ivar scroll_y: The vertical scroll distance. Required. - :vartype scroll_y: int + :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 + :ivar file_id: The identifier of an uploaded file that contains the screenshot. + :vartype file_id: str """ - 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.""" - 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"]) - """The y-coordinate where the scroll occurred. Required.""" - scroll_x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The horizontal scroll distance. Required.""" - scroll_y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The vertical scroll distance. Required.""" + 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\".""" + 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"]) + """The identifier of an uploaded file that contains the screenshot.""" @overload def __init__( self, *, - x: int, - y: int, - scroll_x: int, - scroll_y: int, + image_url: Optional[str] = None, + file_id: Optional[str] = None, ) -> None: ... @overload @@ -3167,30 +3175,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ComputerActionType.SCROLL # type: ignore + self.type: Literal["computer_screenshot"] = "computer_screenshot" -class ComputerActionTypeKeys(ComputerAction, discriminator="type"): - """An action to type in text. +class ComputerUsePreviewTool(Tool, discriminator="computer_use_preview"): + """Computer use preview. - :ivar type: Specifies the event type. For a type action, this property is - always set to ``type``. Required. - :vartype type: str or ~azure.ai.projects.models.TYPE - :ivar text: The text to type. Required. - :vartype text: str + :ivar type: The type of the computer use tool. Always ``computer_use_preview``. Required. + :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW + :ivar environment: The type of computer environment to control. Required. Known values are: + "windows", "mac", "linux", "ubuntu", and "browser". + :vartype environment: str or ~azure.ai.projects.models.ComputerEnvironment + :ivar display_width: The width of the computer display. Required. + :vartype display_width: int + :ivar display_height: The height of the computer display. Required. + :vartype display_height: int """ - type: Literal[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.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text to type. Required.""" + 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.""" + environment: Union[str, "_models.ComputerEnvironment"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of computer environment to control. Required. Known values are: \"windows\", \"mac\", + \"linux\", \"ubuntu\", and \"browser\".""" + display_width: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The width of the computer display. Required.""" + display_height: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The height of the computer display. Required.""" @overload def __init__( self, *, - text: str, + environment: Union[str, "_models.ComputerEnvironment"], + display_width: int, + display_height: int, ) -> None: ... @overload @@ -3202,71 +3222,90 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ComputerActionType.TYPE # type: ignore + self.type = ToolType.COMPUTER_USE_PREVIEW # type: ignore -class ComputerActionWait(ComputerAction, discriminator="wait"): - """A wait action. +class Connection(_Model): + """Response from the list and get connections operations. - :ivar type: Specifies the event type. For a wait action, this property is - always set to ``wait``. Required. - :vartype type: str or ~azure.ai.projects.models.WAIT + :ivar name: The friendly name of the connection, provided by the user. Required. + :vartype name: str + :ivar id: A unique identifier for the connection, generated by the service. Required. + :vartype id: str + :ivar type: Category of the connection. Required. Known values are: "AzureOpenAI", "AzureBlob", + "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", "AppConfig", "AppInsights", + "CustomKeys", and "RemoteTool". + :vartype type: str or ~azure.ai.projects.models.ConnectionType + :ivar target: The connection URL to be used for this service. Required. + :vartype target: str + :ivar is_default: Whether the connection is tagged as the default connection of its type. + Required. + :vartype is_default: bool + :ivar credentials: The credentials used by the connection. Required. + :vartype credentials: ~azure.ai.projects.models.BaseCredentials + :ivar metadata: Metadata of the connection. Required. + :vartype metadata: dict[str, str] """ - 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.""" - - @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 = ComputerActionType.WAIT # type: ignore + name: str = rest_field(visibility=["read"]) + """The friendly name of the connection, provided by the user. Required.""" + id: str = rest_field(visibility=["read"]) + """A unique identifier for the connection, generated by the service. Required.""" + type: Union[str, "_models.ConnectionType"] = rest_field(visibility=["read"]) + """Category of the connection. Required. Known values are: \"AzureOpenAI\", \"AzureBlob\", + \"AzureStorageAccount\", \"CognitiveSearch\", \"CosmosDB\", \"ApiKey\", \"AppConfig\", + \"AppInsights\", \"CustomKeys\", and \"RemoteTool\".""" + target: str = rest_field(visibility=["read"]) + """The connection URL to be used for this service. Required.""" + is_default: bool = rest_field(name="isDefault", visibility=["read"]) + """Whether the connection is tagged as the default connection of its type. Required.""" + credentials: "_models.BaseCredentials" = rest_field(visibility=["read"]) + """The credentials used by the connection. Required.""" + metadata: dict[str, str] = rest_field(visibility=["read"]) + """Metadata of the connection. Required.""" -class ComputerToolCallItemParam(ItemParam, discriminator="computer_call"): - """A tool call to a computer use tool. See the - `computer use guide `_ for more - information. +class ContainerAppAgentDefinition(AgentDefinition, discriminator="container_app"): + """The container app agent definition. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_CALL - :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.ComputerToolCallSafetyCheck] + :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.CONTAINER_APP + :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 container_app_resource_id: The resource ID of the Azure Container App that hosts this + agent. Not mutable across versions. Required. + :vartype container_app_resource_id: str + :ivar ingress_subdomain_suffix: The suffix to apply to the app subdomain when sending ingress + to the agent. This can be a label (e.g., '---current'), a specific revision (e.g., + '--0000001'), or empty to use the default endpoint for the container app. Required. + :vartype ingress_subdomain_suffix: str """ - type: Literal[ItemType.COMPUTER_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """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"]) + kind: Literal[AgentKind.CONTAINER_APP] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Required.""" - pending_safety_checks: list["_models.ComputerToolCallSafetyCheck"] = rest_field( + container_protocol_versions: list["_models.ProtocolVersionRecord"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The pending safety checks for the computer call. Required.""" + """The protocols that the agent supports for ingress communication of the containers. Required.""" + container_app_resource_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The resource ID of the Azure Container App that hosts this agent. Not mutable across versions. + Required.""" + ingress_subdomain_suffix: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The suffix to apply to the app subdomain when sending ingress to the agent. This can be a label + (e.g., '---current'), a specific revision (e.g., '--0000001'), or empty to use the default + endpoint for the container app. Required.""" @overload def __init__( self, *, - call_id: str, - action: "_models.ComputerAction", - pending_safety_checks: list["_models.ComputerToolCallSafetyCheck"], + container_protocol_versions: list["_models.ProtocolVersionRecord"], + container_app_resource_id: str, + ingress_subdomain_suffix: str, + rai_config: Optional["_models.RaiConfig"] = None, ) -> None: ... @overload @@ -3278,59 +3317,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.COMPUTER_CALL # type: ignore + self.kind = AgentKind.CONTAINER_APP # type: ignore -class ComputerToolCallItemResource(ItemResource, discriminator="computer_call"): - """A tool call to a computer use tool. See the - `computer use guide `_ for more - information. +class ContainerFileCitationBody(Annotation, discriminator="container_file_citation"): + """Container file citation. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_CALL - :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 - :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.ComputerToolCallSafetyCheck] + :ivar type: The type of the container file citation. Always ``container_file_citation``. + Required. + :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 + :ivar file_id: The ID of the file. Required. + :vartype file_id: str + :ivar start_index: The index of the first character of the container file citation in the + message. Required. + :vartype start_index: int + :ivar end_index: The index of the last character of the container file citation in the message. + Required. + :vartype end_index: int + :ivar filename: The filename of the container file cited. Required. + :vartype filename: str """ - type: Literal[ItemType.COMPUTER_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """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\"]""" - 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.ComputerToolCallSafetyCheck"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The pending safety checks for the computer call. Required.""" + 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.""" + 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"]) + """The ID of the file. Required.""" + start_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the first character of the container file citation in the message. Required.""" + end_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the last character of the container file citation in the message. Required.""" + filename: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The filename of the container file cited. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - status: Literal["in_progress", "completed", "incomplete"], - call_id: str, - action: "_models.ComputerAction", - pending_safety_checks: list["_models.ComputerToolCallSafetyCheck"], - created_by: Optional["_models.CreatedBy"] = None, + container_id: str, + file_id: str, + start_index: int, + end_index: int, + filename: str, ) -> None: ... @overload @@ -3342,22 +3373,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.COMPUTER_CALL # type: ignore + self.type = AnnotationType.CONTAINER_FILE_CITATION # type: ignore -class ComputerToolCallOutputItemOutput(_Model): - """ComputerToolCallOutputItemOutput. +class EvaluationRuleAction(_Model): + """Evaluation action model. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ComputerToolCallOutputItemOutputComputerScreenshot + ContinuousEvaluationRuleAction, HumanEvaluationRuleAction - :ivar type: Required. "computer_screenshot" - :vartype type: str or ~azure.ai.projects.models.ComputerToolCallOutputItemOutputType + :ivar type: Type of the evaluation action. Required. Known values are: "continuousEvaluation" + and "humanEvaluation". + :vartype type: str or ~azure.ai.projects.models.EvaluationRuleActionType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. \"computer_screenshot\"""" + """Type of the evaluation action. Required. Known values are: \"continuousEvaluation\" and + \"humanEvaluation\".""" @overload def __init__( @@ -3377,30 +3410,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ComputerToolCallOutputItemOutputComputerScreenshot( - ComputerToolCallOutputItemOutput, discriminator="computer_screenshot" -): # pylint: disable=name-too-long - """ComputerToolCallOutputItemOutputComputerScreenshot. +class ContinuousEvaluationRuleAction(EvaluationRuleAction, discriminator="continuousEvaluation"): + """Evaluation rule action for continuous evaluation. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.SCREENSHOT - :ivar image_url: - :vartype image_url: str - :ivar file_id: - :vartype file_id: str + :ivar type: Required. Continuous evaluation. + :vartype type: str or ~azure.ai.projects.models.CONTINUOUS_EVALUATION + :ivar eval_id: Eval Id to add continuous evaluation runs to. Required. + :vartype eval_id: str + :ivar max_hourly_runs: Maximum number of evaluation runs allowed per hour. + :vartype max_hourly_runs: int """ - type: Literal[ComputerToolCallOutputItemOutputType.SCREENSHOT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Continuous evaluation.""" + eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) + """Eval Id to add continuous evaluation runs to. Required.""" + max_hourly_runs: Optional[int] = rest_field( + name="maxHourlyRuns", visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of evaluation runs allowed per hour.""" @overload def __init__( self, *, - image_url: Optional[str] = None, - file_id: Optional[str] = None, + eval_id: str, + max_hourly_runs: Optional[int] = None, ) -> None: ... @overload @@ -3412,46 +3447,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ComputerToolCallOutputItemOutputType.SCREENSHOT # type: ignore + self.type = EvaluationRuleActionType.CONTINUOUS_EVALUATION # type: ignore -class ComputerToolCallOutputItemParam(ItemParam, discriminator="computer_call_output"): - """The output of a computer tool call. +class ConversationReference(_Model): + """Conversation. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_CALL_OUTPUT - :ivar call_id: The ID of the computer tool call that produced the output. Required. - :vartype call_id: str - :ivar acknowledged_safety_checks: The safety checks reported by the API that have been - acknowledged by the - developer. - :vartype acknowledged_safety_checks: - list[~azure.ai.projects.models.ComputerToolCallSafetyCheck] - :ivar output: Required. - :vartype output: ~azure.ai.projects.models.ComputerToolCallOutputItemOutput + :ivar id: The unique ID of the conversation. Required. + :vartype id: str """ - type: Literal[ItemType.COMPUTER_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the computer tool call that produced the output. Required.""" - acknowledged_safety_checks: Optional[list["_models.ComputerToolCallSafetyCheck"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The safety checks reported by the API that have been acknowledged by the - developer.""" - output: "_models.ComputerToolCallOutputItemOutput" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the conversation. Required.""" @overload def __init__( self, *, - call_id: str, - output: "_models.ComputerToolCallOutputItemOutput", - acknowledged_safety_checks: Optional[list["_models.ComputerToolCallSafetyCheck"]] = None, + id: str, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -3463,63 +3476,61 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.COMPUTER_CALL_OUTPUT # type: ignore -class ComputerToolCallOutputItemResource(ItemResource, discriminator="computer_call_output"): - """The output of a computer tool call. +class CosmosDBIndex(Index, discriminator="CosmosDBNoSqlVectorStore"): + """CosmosDB Vector Store Index Definition. - :ivar id: Required. + :ivar id: Asset ID, a unique identifier for the asset. :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_CALL_OUTPUT - :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 - :ivar call_id: The ID of the computer tool call that produced the output. Required. - :vartype call_id: str - :ivar acknowledged_safety_checks: The safety checks reported by the API that have been - acknowledged by the - developer. - :vartype acknowledged_safety_checks: - list[~azure.ai.projects.models.ComputerToolCallSafetyCheck] - :ivar output: Required. - :vartype output: ~azure.ai.projects.models.ComputerToolCallOutputItemOutput + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar type: Type of index. Required. CosmosDB + :vartype type: str or ~azure.ai.projects.models.COSMOS_DB + :ivar connection_name: Name of connection to CosmosDB. Required. + :vartype connection_name: str + :ivar database_name: Name of the CosmosDB Database. Required. + :vartype database_name: str + :ivar container_name: Name of CosmosDB Container. Required. + :vartype container_name: str + :ivar embedding_configuration: Embedding model configuration. Required. + :vartype embedding_configuration: ~azure.ai.projects.models.EmbeddingConfiguration + :ivar field_mapping: Field mapping configuration. Required. + :vartype field_mapping: ~azure.ai.projects.models.FieldMapping """ - type: Literal[ItemType.COMPUTER_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """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\"]""" - call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the computer tool call that produced the output. Required.""" - acknowledged_safety_checks: Optional[list["_models.ComputerToolCallSafetyCheck"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The safety checks reported by the API that have been acknowledged by the - developer.""" - output: "_models.ComputerToolCallOutputItemOutput" = rest_field( - visibility=["read", "create", "update", "delete", "query"] + type: Literal[IndexType.COSMOS_DB] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Type of index. Required. CosmosDB""" + connection_name: str = rest_field(name="connectionName", visibility=["create"]) + """Name of connection to CosmosDB. Required.""" + database_name: str = rest_field(name="databaseName", visibility=["create"]) + """Name of the CosmosDB Database. Required.""" + container_name: str = rest_field(name="containerName", visibility=["create"]) + """Name of CosmosDB Container. Required.""" + embedding_configuration: "_models.EmbeddingConfiguration" = rest_field( + name="embeddingConfiguration", visibility=["create"] ) - """Required.""" + """Embedding model configuration. Required.""" + field_mapping: "_models.FieldMapping" = rest_field(name="fieldMapping", visibility=["create"]) + """Field mapping configuration. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - status: Literal["in_progress", "completed", "incomplete"], - call_id: str, - output: "_models.ComputerToolCallOutputItemOutput", - created_by: Optional["_models.CreatedBy"] = None, - acknowledged_safety_checks: Optional[list["_models.ComputerToolCallSafetyCheck"]] = None, + connection_name: str, + database_name: str, + container_name: str, + embedding_configuration: "_models.EmbeddingConfiguration", + field_mapping: "_models.FieldMapping", + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -3531,34 +3542,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.COMPUTER_CALL_OUTPUT # type: ignore + self.type = IndexType.COSMOS_DB # type: ignore -class ComputerToolCallSafetyCheck(_Model): - """A pending safety check for the computer call. +class CreatedBy(_Model): + """CreatedBy. - :ivar id: The ID of the pending safety check. Required. - :vartype id: str - :ivar code: The type of the pending safety check. Required. - :vartype code: str - :ivar message: Details about the pending safety check. Required. - :vartype message: str + :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 """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the pending safety check. Required.""" - code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of the pending safety check. Required.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Details about the pending safety check. Required.""" + 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, *, - id: str, # pylint: disable=redefined-builtin - code: str, - message: str, + agent: Optional["_models.AgentId"] = None, + response_id: Optional[str] = None, ) -> None: ... @overload @@ -3572,42 +3578,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ComputerUsePreviewTool(Tool, discriminator="computer_use_preview"): - """A tool that controls a virtual computer. Learn more about the `computer tool - `_. +class Trigger(_Model): + """Base model for Trigger of the schedule. - :ivar type: The type of the computer use tool. Always ``computer_use_preview``. Required. - :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW - :ivar environment: The type of computer environment to control. Required. Is one of the - following types: Literal["windows"], Literal["mac"], Literal["linux"], Literal["ubuntu"], - Literal["browser"] - :vartype environment: str or str or str or str or str - :ivar display_width: The width of the computer display. Required. - :vartype display_width: int - :ivar display_height: The height of the computer display. Required. - :vartype display_height: int + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + CronTrigger, OneTimeTrigger, RecurrenceTrigger + + :ivar type: Type of the trigger. Required. Known values are: "Cron", "Recurrence", and + "OneTime". + :vartype type: str or ~azure.ai.projects.models.TriggerType """ - 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.""" - environment: Literal["windows", "mac", "linux", "ubuntu", "browser"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The type of computer environment to control. Required. Is one of the following types: - Literal[\"windows\"], Literal[\"mac\"], Literal[\"linux\"], Literal[\"ubuntu\"], - Literal[\"browser\"]""" - display_width: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The width of the computer display. Required.""" - display_height: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The height of the computer display. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Type of the trigger. Required. Known values are: \"Cron\", \"Recurrence\", and \"OneTime\".""" @overload def __init__( self, *, - environment: Literal["windows", "mac", "linux", "ubuntu", "browser"], - display_width: int, - display_height: int, + type: str, ) -> None: ... @overload @@ -3619,90 +3609,69 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.COMPUTER_USE_PREVIEW # type: ignore -class Connection(_Model): - """Response from the list and get connections operations. +class CronTrigger(Trigger, discriminator="Cron"): + """Cron based trigger. - :ivar name: The friendly name of the connection, provided by the user. Required. - :vartype name: str - :ivar id: A unique identifier for the connection, generated by the service. Required. - :vartype id: str - :ivar type: Category of the connection. Required. Known values are: "AzureOpenAI", "AzureBlob", - "AzureStorageAccount", "CognitiveSearch", "CosmosDB", "ApiKey", "AppConfig", "AppInsights", - "CustomKeys", and "RemoteTool". - :vartype type: str or ~azure.ai.projects.models.ConnectionType - :ivar target: The connection URL to be used for this service. Required. - :vartype target: str - :ivar is_default: Whether the connection is tagged as the default connection of its type. - Required. - :vartype is_default: bool - :ivar credentials: The credentials used by the connection. Required. - :vartype credentials: ~azure.ai.projects.models.BaseCredentials - :ivar metadata: Metadata of the connection. Required. - :vartype metadata: dict[str, str] + :ivar type: Required. Cron based trigger. + :vartype type: str or ~azure.ai.projects.models.CRON + :ivar expression: Cron expression that defines the schedule frequency. Required. + :vartype expression: str + :ivar time_zone: Time zone for the cron schedule. + :vartype time_zone: str + :ivar start_time: Start time for the cron schedule in ISO 8601 format. + :vartype start_time: str + :ivar end_time: End time for the cron schedule in ISO 8601 format. + :vartype end_time: str """ - name: str = rest_field(visibility=["read"]) - """The friendly name of the connection, provided by the user. Required.""" - id: str = rest_field(visibility=["read"]) - """A unique identifier for the connection, generated by the service. Required.""" - type: Union[str, "_models.ConnectionType"] = rest_field(visibility=["read"]) - """Category of the connection. Required. Known values are: \"AzureOpenAI\", \"AzureBlob\", - \"AzureStorageAccount\", \"CognitiveSearch\", \"CosmosDB\", \"ApiKey\", \"AppConfig\", - \"AppInsights\", \"CustomKeys\", and \"RemoteTool\".""" - target: str = rest_field(visibility=["read"]) - """The connection URL to be used for this service. Required.""" - is_default: bool = rest_field(name="isDefault", visibility=["read"]) - """Whether the connection is tagged as the default connection of its type. Required.""" - credentials: "_models.BaseCredentials" = rest_field(visibility=["read"]) - """The credentials used by the connection. Required.""" - metadata: dict[str, str] = rest_field(visibility=["read"]) - """Metadata of the connection. Required.""" + type: Literal[TriggerType.CRON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Cron based trigger.""" + expression: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Cron expression that defines the schedule frequency. Required.""" + time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) + """Time zone for the cron schedule.""" + start_time: Optional[str] = rest_field(name="startTime", visibility=["read", "create", "update", "delete", "query"]) + """Start time for the cron schedule in ISO 8601 format.""" + end_time: Optional[str] = rest_field(name="endTime", visibility=["read", "create", "update", "delete", "query"]) + """End time for the cron schedule in ISO 8601 format.""" + @overload + def __init__( + self, + *, + expression: str, + time_zone: Optional[str] = None, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + ) -> None: ... -class ContainerAppAgentDefinition(AgentDefinition, discriminator="container_app"): - """The container app agent definition. + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ - :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.CONTAINER_APP - :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 container_app_resource_id: The resource ID of the Azure Container App that hosts this - agent. Not mutable across versions. Required. - :vartype container_app_resource_id: str - :ivar ingress_subdomain_suffix: The suffix to apply to the app subdomain when sending ingress - to the agent. This can be a label (e.g., '---current'), a specific revision (e.g., - '--0000001'), or empty to use the default endpoint for the container app. Required. - :vartype ingress_subdomain_suffix: str + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = TriggerType.CRON # type: ignore + + +class CustomCredential(BaseCredentials, discriminator="CustomKeys"): + """Custom credential definition. + + :ivar type: The credential type. Required. Custom credential + :vartype type: str or ~azure.ai.projects.models.CUSTOM """ - kind: Literal[AgentKind.CONTAINER_APP] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - container_protocol_versions: list["_models.ProtocolVersionRecord"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The protocols that the agent supports for ingress communication of the containers. Required.""" - container_app_resource_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The resource ID of the Azure Container App that hosts this agent. Not mutable across versions. - Required.""" - ingress_subdomain_suffix: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The suffix to apply to the app subdomain when sending ingress to the agent. This can be a label - (e.g., '---current'), a specific revision (e.g., '--0000001'), or empty to use the default - endpoint for the container app. Required.""" + type: Literal[CredentialType.CUSTOM] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. Custom credential""" @overload def __init__( self, - *, - container_protocol_versions: list["_models.ProtocolVersionRecord"], - container_app_resource_id: str, - ingress_subdomain_suffix: str, - rai_config: Optional["_models.RaiConfig"] = None, ) -> None: ... @overload @@ -3714,24 +3683,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = AgentKind.CONTAINER_APP # type: ignore + self.type = CredentialType.CUSTOM # type: ignore -class EvaluationRuleAction(_Model): - """Evaluation action model. +class CustomToolParamFormat(_Model): + """The input format for the custom tool. Default is unconstrained text. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ContinuousEvaluationRuleAction, HumanEvaluationRuleAction + CustomGrammarFormatParam, CustomTextFormatParam - :ivar type: Type of the evaluation action. Required. Known values are: "continuousEvaluation" - and "humanEvaluation". - :vartype type: str or ~azure.ai.projects.models.EvaluationRuleActionType + :ivar type: Required. Known values are: "text" and "grammar". + :vartype type: str or ~azure.ai.projects.models.CustomToolParamFormatType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of the evaluation action. Required. Known values are: \"continuousEvaluation\" and - \"humanEvaluation\".""" + """Required. Known values are: \"text\" and \"grammar\".""" @overload def __init__( @@ -3751,32 +3718,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ContinuousEvaluationRuleAction(EvaluationRuleAction, discriminator="continuousEvaluation"): - """Evaluation rule action for continuous evaluation. +class CustomGrammarFormatParam(CustomToolParamFormat, discriminator="grammar"): + """Grammar format. - :ivar type: Required. Continuous evaluation. - :vartype type: str or ~azure.ai.projects.models.CONTINUOUS_EVALUATION - :ivar eval_id: Eval Id to add continuous evaluation runs to. Required. - :vartype eval_id: str - :ivar max_hourly_runs: Maximum number of evaluation runs allowed per hour. - :vartype max_hourly_runs: int + :ivar type: Grammar format. Always ``grammar``. Required. + :vartype type: str or ~azure.ai.projects.models.GRAMMAR + :ivar syntax: The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. + Known values are: "lark" and "regex". + :vartype syntax: str or ~azure.ai.projects.models.GrammarSyntax1 + :ivar definition: The grammar definition. Required. + :vartype definition: str """ - type: Literal[EvaluationRuleActionType.CONTINUOUS_EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Continuous evaluation.""" - eval_id: str = rest_field(name="evalId", visibility=["read", "create", "update", "delete", "query"]) - """Eval Id to add continuous evaluation runs to. Required.""" - max_hourly_runs: Optional[int] = rest_field( - name="maxHourlyRuns", visibility=["read", "create", "update", "delete", "query"] + type: Literal[CustomToolParamFormatType.GRAMMAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Grammar format. Always ``grammar``. Required.""" + syntax: Union[str, "_models.GrammarSyntax1"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Maximum number of evaluation runs allowed per hour.""" + """The syntax of the grammar definition. One of ``lark`` or ``regex``. Required. Known values are: + \"lark\" and \"regex\".""" + definition: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The grammar definition. Required.""" @overload def __init__( self, *, - eval_id: str, - max_hourly_runs: Optional[int] = None, + syntax: Union[str, "_models.GrammarSyntax1"], + definition: str, ) -> None: ... @overload @@ -3788,29 +3757,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluationRuleActionType.CONTINUOUS_EVALUATION # type: ignore + self.type = CustomToolParamFormatType.GRAMMAR # type: ignore -class Coordinate(_Model): - """An x/y coordinate pair, e.g. ``{ x: 100, y: 200 }``. +class CustomTextFormatParam(CustomToolParamFormat, discriminator="text"): + """Text format. - :ivar x: The x-coordinate. Required. - :vartype x: int - :ivar y: The y-coordinate. Required. - :vartype y: int + :ivar type: Unconstrained text format. Always ``text``. Required. + :vartype type: str or ~azure.ai.projects.models.TEXT """ - x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The x-coordinate. Required.""" - y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The y-coordinate. Required.""" + type: Literal[CustomToolParamFormatType.TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Unconstrained text format. Always ``text``. Required.""" @overload def __init__( self, - *, - x: int, - y: int, ) -> None: ... @overload @@ -3822,202 +3784,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CustomToolParamFormatType.TEXT # type: ignore -class CosmosDBIndex(Index, discriminator="CosmosDBNoSqlVectorStore"): - """CosmosDB Vector Store Index Definition. +class CustomToolParam(Tool, discriminator="custom"): + """Custom tool. - :ivar id: Asset ID, a unique identifier for the asset. - :vartype id: str - :ivar name: The name of the resource. Required. + :ivar type: The type of the custom tool. Always ``custom``. Required. + :vartype type: str or ~azure.ai.projects.models.CUSTOM + :ivar name: The name of the custom tool, used to identify it in tool calls. Required. :vartype name: str - :ivar version: The version of the resource. Required. - :vartype version: str - :ivar description: The asset description text. + :ivar description: Optional description of the custom tool, used to provide more context. :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar type: Type of index. Required. CosmosDB - :vartype type: str or ~azure.ai.projects.models.COSMOS_DB - :ivar connection_name: Name of connection to CosmosDB. Required. - :vartype connection_name: str - :ivar database_name: Name of the CosmosDB Database. Required. - :vartype database_name: str - :ivar container_name: Name of CosmosDB Container. Required. - :vartype container_name: str - :ivar embedding_configuration: Embedding model configuration. Required. - :vartype embedding_configuration: ~azure.ai.projects.models.EmbeddingConfiguration - :ivar field_mapping: Field mapping configuration. Required. - :vartype field_mapping: ~azure.ai.projects.models.FieldMapping + :ivar format: The input format for the custom tool. Default is unconstrained text. + :vartype format: ~azure.ai.projects.models.CustomToolParamFormat """ - type: Literal[IndexType.COSMOS_DB] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of index. Required. CosmosDB""" - connection_name: str = rest_field(name="connectionName", visibility=["create"]) - """Name of connection to CosmosDB. Required.""" - database_name: str = rest_field(name="databaseName", visibility=["create"]) - """Name of the CosmosDB Database. Required.""" - container_name: str = rest_field(name="containerName", visibility=["create"]) - """Name of CosmosDB Container. Required.""" - embedding_configuration: "_models.EmbeddingConfiguration" = rest_field( - name="embeddingConfiguration", visibility=["create"] + type: Literal[ToolType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the custom tool. Always ``custom``. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the custom tool, used to identify it in tool calls. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional description of the custom tool, used to provide more context.""" + format: Optional["_models.CustomToolParamFormat"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Embedding model configuration. Required.""" - field_mapping: "_models.FieldMapping" = rest_field(name="fieldMapping", visibility=["create"]) - """Field mapping configuration. Required.""" + """The input format for the custom tool. Default is unconstrained text.""" @overload def __init__( self, *, - connection_name: str, - database_name: str, - container_name: str, - embedding_configuration: "_models.EmbeddingConfiguration", - field_mapping: "_models.FieldMapping", + name: str, description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = IndexType.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. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CronTrigger, OneTimeTrigger, RecurrenceTrigger - - :ivar type: Type of the trigger. Required. Known values are: "Cron", "Recurrence", and - "OneTime". - :vartype type: str or ~azure.ai.projects.models.TriggerType - """ - - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of the trigger. Required. Known values are: \"Cron\", \"Recurrence\", and \"OneTime\".""" - - @overload - def __init__( - self, - *, - 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 CronTrigger(Trigger, discriminator="Cron"): - """Cron based trigger. - - :ivar type: Required. Cron based trigger. - :vartype type: str or ~azure.ai.projects.models.CRON - :ivar expression: Cron expression that defines the schedule frequency. Required. - :vartype expression: str - :ivar time_zone: Time zone for the cron schedule. - :vartype time_zone: str - :ivar start_time: Start time for the cron schedule in ISO 8601 format. - :vartype start_time: str - :ivar end_time: End time for the cron schedule in ISO 8601 format. - :vartype end_time: str - """ - - type: Literal[TriggerType.CRON] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Cron based trigger.""" - expression: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Cron expression that defines the schedule frequency. Required.""" - time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) - """Time zone for the cron schedule.""" - start_time: Optional[str] = rest_field(name="startTime", visibility=["read", "create", "update", "delete", "query"]) - """Start time for the cron schedule in ISO 8601 format.""" - end_time: Optional[str] = rest_field(name="endTime", visibility=["read", "create", "update", "delete", "query"]) - """End time for the cron schedule in ISO 8601 format.""" - - @overload - def __init__( - self, - *, - expression: str, - time_zone: Optional[str] = None, - start_time: Optional[str] = None, - end_time: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw 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.CRON # type: ignore - - -class CustomCredential(BaseCredentials, discriminator="CustomKeys"): - """Custom credential definition. - - :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""" - - @overload - def __init__( - self, + format: Optional["_models.CustomToolParamFormat"] = None, ) -> None: ... @overload @@ -4029,7 +3829,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CredentialType.CUSTOM # type: ignore + self.type = ToolType.CUSTOM # type: ignore class RecurrenceSchedule(_Model): @@ -4363,28 +4163,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EmbeddingConfiguration(_Model): - """Embedding configuration class. +class DoubleClickAction(ComputerAction, discriminator="double_click"): + """DoubleClick. - :ivar model_deployment_name: Deployment name of embedding model. It can point to a model - deployment either in the parent AIServices or a connection. Required. - :vartype model_deployment_name: str - :ivar embedding_field: Embedding field. Required. - :vartype embedding_field: str + :ivar type: Specifies the event type. For a double click action, this property is always set to + ``double_click``. Required. + :vartype type: str or ~azure.ai.projects.models.DOUBLE_CLICK + :ivar x: The x-coordinate where the double click occurred. Required. + :vartype x: int + :ivar y: The y-coordinate where the double click occurred. Required. + :vartype y: int """ - model_deployment_name: str = rest_field(name="modelDeploymentName", visibility=["create"]) - """Deployment name of embedding model. It can point to a model deployment either in the parent - AIServices or a connection. Required.""" - embedding_field: str = rest_field(name="embeddingField", visibility=["create"]) - """Embedding field. Required.""" + 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.""" + 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"]) + """The y-coordinate where the double click occurred. Required.""" @overload def __init__( self, *, - model_deployment_name: str, - embedding_field: str, + x: int, + y: int, ) -> None: ... @overload @@ -4396,19 +4200,223 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ComputerActionType.DOUBLE_CLICK # type: ignore -class EntraIDCredentials(BaseCredentials, discriminator="AAD"): - """Entra ID credential definition. +class Drag(ComputerAction, discriminator="drag"): + """Drag. - :ivar type: The credential type. Required. Entra ID credential (formerly known as AAD) - :vartype type: str or ~azure.ai.projects.models.ENTRA_ID - """ + :ivar type: Specifies the event type. For a drag action, this property is + always set to ``drag``. Required. + :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 - type: Literal[CredentialType.ENTRA_ID] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. Entra ID credential (formerly known as AAD)""" + .. code-block:: - @overload + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ]. Required. + :vartype path: list[~azure.ai.projects.models.DragPoint] + """ + + 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.""" + 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 + + .. code-block:: + + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ]. Required.""" + + @overload + def __init__( + self, + *, + path: list["_models.DragPoint"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ComputerActionType.DRAG # type: ignore + + +class DragPoint(_Model): + """Coordinate. + + :ivar x: The x-coordinate. Required. + :vartype x: int + :ivar y: The y-coordinate. Required. + :vartype y: int + """ + + x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The x-coordinate. Required.""" + y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The y-coordinate. Required.""" + + @overload + def __init__( + self, + *, + x: int, + y: 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 InputItem(_Model): + """InputItem. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ItemReferenceParam, EasyInputMessage + + :ivar type: Required. Known values are: "message" and "item_reference". + :vartype type: str or ~azure.ai.projects.models.InputItemType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"message\" and \"item_reference\".""" + + @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 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"] + :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. + :vartype content: str or list[~azure.ai.projects.models.InputContent] + :ivar type: The type of the message input. Always ``message``. Required. + :vartype type: str or ~azure.ai.projects.models.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\"]""" + 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.""" + 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.""" + + @overload + def __init__( + self, + *, + role: Literal["user", "assistant", "system", "developer"], + content: Union[str, list["_models.InputContent"]], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = InputItemType.MESSAGE # type: ignore + + +class EmbeddingConfiguration(_Model): + """Embedding configuration class. + + :ivar model_deployment_name: Deployment name of embedding model. It can point to a model + deployment either in the parent AIServices or a connection. Required. + :vartype model_deployment_name: str + :ivar embedding_field: Embedding field. Required. + :vartype embedding_field: str + """ + + model_deployment_name: str = rest_field(name="modelDeploymentName", visibility=["create"]) + """Deployment name of embedding model. It can point to a model deployment either in the parent + AIServices or a connection. Required.""" + embedding_field: str = rest_field(name="embeddingField", visibility=["create"]) + """Embedding field. Required.""" + + @overload + def __init__( + self, + *, + model_deployment_name: str, + embedding_field: 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 EntraIDCredentials(BaseCredentials, discriminator="AAD"): + """Entra ID credential definition. + + :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)""" + + @overload def __init__( self, ) -> None: ... @@ -5406,6 +5414,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class FileCitationBody(Annotation, discriminator="file_citation"): + """File citation. + + :ivar type: The type of the file citation. Always ``file_citation``. Required. + :vartype type: str or ~azure.ai.projects.models.FILE_CITATION + :ivar file_id: The ID of the file. Required. + :vartype file_id: str + :ivar index: The index of the file in the list of files. Required. + :vartype index: int + :ivar filename: The filename of the file cited. Required. + :vartype filename: str + """ + + 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.""" + 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"]) + """The index of the file in the list of files. Required.""" + filename: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The filename of the file cited. Required.""" + + @overload + def __init__( + self, + *, + file_id: str, + index: int, + filename: 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 = AnnotationType.FILE_CITATION # type: ignore + + class FileDatasetVersion(DatasetVersion, discriminator="uri_file"): """FileDatasetVersion Definition. @@ -5458,9 +5509,46 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DatasetType.URI_FILE # type: ignore +class FilePath(Annotation, discriminator="file_path"): + """File path. + + :ivar type: The type of the file path. Always ``file_path``. Required. + :vartype type: str or ~azure.ai.projects.models.FILE_PATH + :ivar file_id: The ID of the file. Required. + :vartype file_id: str + :ivar index: The index of the file in the list of files. Required. + :vartype index: int + """ + + 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.""" + 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"]) + """The index of the file in the list of files. Required.""" + + @overload + def __init__( + self, + *, + file_id: str, + index: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = AnnotationType.FILE_PATH # type: ignore + + class FileSearchTool(Tool, discriminator="file_search"): - """A tool that searches for relevant content from uploaded files. Learn more about the `file - search tool `_. + """File search. :ivar type: The type of the file search tool. Always ``file_search``. Required. :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH @@ -5471,7 +5559,7 @@ class FileSearchTool(Tool, discriminator="file_search"): :vartype max_num_results: int :ivar ranking_options: Ranking options for search. :vartype ranking_options: ~azure.ai.projects.models.RankingOptions - :ivar filters: A filter to apply. Is either a ComparisonFilter type or a CompoundFilter type. + :ivar filters: Is either a ComparisonFilter type or a CompoundFilter type. :vartype filters: ~azure.ai.projects.models.ComparisonFilter or ~azure.ai.projects.models.CompoundFilter """ @@ -5489,7 +5577,7 @@ class FileSearchTool(Tool, discriminator="file_search"): filters: Optional[Union["_models.ComparisonFilter", "_models.CompoundFilter"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """A filter to apply. Is either a ComparisonFilter type or a CompoundFilter type.""" + """Is either a ComparisonFilter type or a CompoundFilter type.""" @overload def __init__( @@ -5513,74 +5601,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.FILE_SEARCH # type: ignore -class FileSearchToolCallItemParam(ItemParam, discriminator="file_search_call"): - """The results of a file search tool call. See the - `file search guide `_ for more - information. +class FileSearchToolCallResults(_Model): + """FileSearchToolCallResults. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH_CALL - :ivar queries: The queries used to search for files. Required. - :vartype queries: list[str] - :ivar results: The results of the file search tool call. - :vartype results: list[~azure.ai.projects.models.FileSearchToolCallItemParamResult] - """ - - type: Literal[ItemType.FILE_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - queries: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The queries used to search for files. Required.""" - results: Optional[list["_models.FileSearchToolCallItemParamResult"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The results of the file search tool call.""" - - @overload - def __init__( - self, - *, - queries: list[str], - results: Optional[list["_models.FileSearchToolCallItemParamResult"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ItemType.FILE_SEARCH_CALL # type: ignore - - -class FileSearchToolCallItemParamResult(_Model): - """FileSearchToolCallItemParamResult. - - :ivar file_id: The unique ID of the file. - :vartype file_id: str - :ivar text: The text that was retrieved from the file. - :vartype text: str - :ivar filename: The name of the file. - :vartype filename: str - :ivar attributes: - :vartype attributes: ~azure.ai.projects.models.VectorStoreFileAttributes - :ivar score: The relevance score of the file - a value between 0 and 1. - :vartype score: float + :ivar file_id: + :vartype file_id: str + :ivar text: + :vartype text: str + :ivar filename: + :vartype filename: str + :ivar attributes: + :vartype attributes: ~azure.ai.projects.models.VectorStoreFileAttributes + :ivar score: + :vartype score: float """ file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the file.""" text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text that was retrieved from the file.""" filename: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the file.""" attributes: Optional["_models.VectorStoreFileAttributes"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) score: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The relevance score of the file - a value between 0 and 1.""" @overload def __init__( @@ -5604,67 +5646,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FileSearchToolCallItemResource(ItemResource, discriminator="file_search_call"): - """The results of a file search tool call. See the - `file search guide `_ for more - information. - - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :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: The results of the file search tool call. - :vartype results: list[~azure.ai.projects.models.FileSearchToolCallItemParamResult] - """ - - type: Literal[ItemType.FILE_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - 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.FileSearchToolCallItemParamResult"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The results of the file search tool call.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - status: Literal["in_progress", "searching", "completed", "incomplete", "failed"], - queries: list[str], - created_by: Optional["_models.CreatedBy"] = None, - results: Optional[list["_models.FileSearchToolCallItemParamResult"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ItemType.FILE_SEARCH_CALL # type: ignore - - class FolderDatasetVersion(DatasetVersion, discriminator="uri_folder"): """FileDatasetVersion Definition. @@ -5717,43 +5698,27 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = DatasetType.URI_FOLDER # type: ignore -class FunctionTool(Tool, discriminator="function"): - """Defines a function in your own code the model can choose to call. Learn more about `function - calling `_. +class FunctionAndCustomToolCallOutput(_Model): + """FunctionAndCustomToolCallOutput. - :ivar type: The type of the function tool. Always ``function``. Required. - :vartype type: str or ~azure.ai.projects.models.FUNCTION - :ivar name: The name of the function to call. Required. - :vartype name: str - :ivar description: A description of the function. Used by the model to determine whether or not - to call the function. - :vartype description: str - :ivar parameters: A JSON schema object describing the parameters of the function. Required. - :vartype parameters: any - :ivar strict: Whether to enforce strict parameter validation. Default ``true``. Required. - :vartype strict: bool + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + FunctionAndCustomToolCallOutputInputFileContent, + FunctionAndCustomToolCallOutputInputImageContent, + FunctionAndCustomToolCallOutputInputTextContent + + :ivar type: Required. Known values are: "input_text", "input_image", and "input_file". + :vartype type: str or ~azure.ai.projects.models.FunctionAndCustomToolCallOutputType """ - 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.""" - 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"]) - """A description of the function. Used by the model to determine whether or not to call the - function.""" - parameters: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A JSON schema object describing the parameters of the function. Required.""" - strict: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to enforce strict parameter validation. Default ``true``. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"input_text\", \"input_image\", and \"input_file\".""" @overload def __init__( self, *, - name: str, - parameters: Any, - strict: bool, - description: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -5765,40 +5730,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.FUNCTION # type: ignore -class FunctionToolCallItemParam(ItemParam, discriminator="function_call"): - """A tool call to run a function. See the - `function calling guide `_ for more - information. +class FunctionAndCustomToolCallOutputInputFileContent( + FunctionAndCustomToolCallOutput, discriminator="input_file" +): # pylint: disable=name-too-long + """Input file. - :ivar type: Required. - :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 type: The type of the input item. Always ``input_file``. Required. + :vartype type: str or ~azure.ai.projects.models.INPUT_FILE + :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[ItemType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - 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.""" + 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.""" + 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, *, - call_id: str, - name: str, - arguments: str, + file_id: Optional[str] = None, + filename: Optional[str] = None, + file_url: Optional[str] = None, + file_data: Optional[str] = None, ) -> None: ... @overload @@ -5810,57 +5778,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.FUNCTION_CALL # type: ignore + self.type = FunctionAndCustomToolCallOutputType.INPUT_FILE # type: ignore -class FunctionToolCallItemResource(ItemResource, discriminator="function_call"): - """A tool call to run a function. See the - `function calling guide `_ for more - information. +class FunctionAndCustomToolCallOutputInputImageContent( + FunctionAndCustomToolCallOutput, discriminator="input_image" +): # pylint: disable=name-too-long + """Input image. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL - :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 - :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 type: The type of the input item. Always ``input_image``. Required. + :vartype type: str or ~azure.ai.projects.models.INPUT_IMAGE + :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[ItemType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """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\"]""" - 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.""" + 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.""" + 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, *, - id: str, # pylint: disable=redefined-builtin - status: Literal["in_progress", "completed", "incomplete"], - call_id: str, - name: str, - arguments: str, - created_by: Optional["_models.CreatedBy"] = None, + detail: Union[str, "_models.ImageDetail"], + image_url: Optional[str] = None, + file_id: Optional[str] = None, ) -> None: ... @overload @@ -5872,33 +5823,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.FUNCTION_CALL # type: ignore + self.type = FunctionAndCustomToolCallOutputType.INPUT_IMAGE # type: ignore -class FunctionToolCallOutputItemParam(ItemParam, discriminator="function_call_output"): - """The output of a function tool call. +class FunctionAndCustomToolCallOutputInputTextContent( + FunctionAndCustomToolCallOutput, discriminator="input_text" +): # pylint: disable=name-too-long + """Input text. - :ivar type: Required. - :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: A JSON string of the output of the function tool call. Required. - :vartype output: str + :ivar type: The type of the input item. Always ``input_text``. Required. + :vartype type: str or ~azure.ai.projects.models.INPUT_TEXT + :ivar text: The text input to the model. Required. + :vartype text: str """ - type: Literal[ItemType.FUNCTION_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - 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: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A JSON string of the output of the function tool call. Required.""" + 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.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text input to the model. Required.""" @overload def __init__( self, *, - call_id: str, - output: str, + text: str, ) -> None: ... @overload @@ -5910,50 +5858,69 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.FUNCTION_CALL_OUTPUT # type: ignore + self.type = FunctionAndCustomToolCallOutputType.INPUT_TEXT # type: ignore -class FunctionToolCallOutputItemResource(ItemResource, discriminator="function_call_output"): - """The output of a function tool call. +class FunctionCallOutputItemParam(Item, discriminator="function_call_output"): + """Function tool call output. - :ivar id: Required. + :ivar id: :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.FUNCTION_CALL_OUTPUT - :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 :ivar call_id: The unique ID of the function tool call generated by the model. Required. :vartype call_id: str - :ivar output: A JSON string of the output of the function tool call. Required. - :vartype output: str + :ivar type: The type of the function tool call output. Always ``function_call_output``. + Required. + :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", + "_models.InputFileContentParam"]] type. + :vartype output: str or list[~azure.ai.projects.models.InputTextContentParam or + ~azure.ai.projects.models.InputImageContentParamAutoParam or + ~azure.ai.projects.models.InputFileContentParam] + :ivar status: Known values are: "in_progress", "completed", and "incomplete". + :vartype status: str or ~azure.ai.projects.models.FunctionCallItemStatus """ + 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 function tool call generated by the model. Required.""" type: Literal[ItemType.FUNCTION_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - status: Literal["in_progress", "completed", "incomplete"] = rest_field( + """The type of the function tool call output. Always ``function_call_output``. Required.""" + output: Union[ + str, + list[ + Union[ + "_models.InputTextContentParam", + "_models.InputImageContentParamAutoParam", + "_models.InputFileContentParam", + ] + ], + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Text, image, or file output of the function tool call. Required. Is either a str type or a + [Union[\"_models.InputTextContentParam\", \"_models.InputImageContentParamAutoParam\", + \"_models.InputFileContentParam\"]] type.""" + status: Optional[Union[str, "_models.FunctionCallItemStatus"]] = 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\"]""" - 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: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A JSON string of the output of the function tool call. Required.""" + """Known values are: \"in_progress\", \"completed\", and \"incomplete\".""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - status: Literal["in_progress", "completed", "incomplete"], call_id: str, - output: str, - created_by: Optional["_models.CreatedBy"] = None, + output: Union[ + str, + list[ + Union[ + "_models.InputTextContentParam", + "_models.InputImageContentParamAutoParam", + "_models.InputFileContentParam", + ] + ], + ], + id: Optional[str] = None, # pylint: disable=redefined-builtin + status: Optional[Union[str, "_models.FunctionCallItemStatus"]] = None, ) -> None: ... @overload @@ -5968,60 +5935,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ItemType.FUNCTION_CALL_OUTPUT # type: ignore -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 +class FunctionShellAction(_Model): + """Shell exec 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. - :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. - :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 commands: Required. + :vartype commands: list[str] + :ivar timeout_ms: Required. + :vartype timeout_ms: int + :ivar max_output_length: Required. + :vartype max_output_length: int """ - __mapping__: dict[str, _Model] = {} - kind: Literal[AgentKind.HOSTED] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + commands: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + timeout_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + max_output_length: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" - 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.""" - container_protocol_versions: list["_models.ProtocolVersionRecord"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The protocols that the agent supports for ingress communication of the containers. Required.""" - cpu: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The CPU configuration for the hosted agent. Required.""" - memory: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The memory configuration for the hosted agent. Required.""" - environment_variables: Optional[dict[str, str]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Environment variables to set in the hosted agent container.""" @overload def __init__( self, *, - container_protocol_versions: list["_models.ProtocolVersionRecord"], - cpu: str, - memory: str, - rai_config: Optional["_models.RaiConfig"] = None, - tools: Optional[list["_models.Tool"]] = None, - environment_variables: Optional[dict[str, str]] = None, + commands: list[str], + timeout_ms: int, + max_output_length: int, ) -> None: ... @overload @@ -6033,22 +5971,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = AgentKind.HOSTED # type: ignore -class HourlyRecurrenceSchedule(RecurrenceSchedule, discriminator="Hourly"): - """Hourly recurrence schedule. +class FunctionShellActionParam(_Model): + """Shell action. - :ivar type: Required. Hourly recurrence pattern. - :vartype type: str or ~azure.ai.projects.models.HOURLY + :ivar commands: Ordered shell commands for the execution environment to run. Required. + :vartype commands: list[str] + :ivar timeout_ms: + :vartype timeout_ms: int + :ivar max_output_length: + :vartype max_output_length: int """ - type: Literal[RecurrenceType.HOURLY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Hourly recurrence pattern.""" + commands: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Ordered shell commands for the execution environment to run. Required.""" + timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + max_output_length: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, + *, + commands: list[str], + timeout_ms: Optional[int] = None, + max_output_length: Optional[int] = None, ) -> None: ... @overload @@ -6060,28 +6007,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RecurrenceType.HOURLY # type: ignore -class HumanEvaluationRuleAction(EvaluationRuleAction, discriminator="humanEvaluation"): - """Evaluation rule action for human evaluation. +class FunctionShellCallItemParam(Item, discriminator="shell_call"): + """Shell tool call. - :ivar type: Required. Human evaluation. - :vartype type: str or ~azure.ai.projects.models.HUMAN_EVALUATION - :ivar template_id: Human evaluation template Id. Required. - :vartype template_id: str + :ivar id: + :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. + :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 + :ivar status: Known values are: "in_progress", "completed", and "incomplete". + :vartype status: str or ~azure.ai.projects.models.FunctionShellCallItemStatus """ - type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Human evaluation.""" - template_id: str = rest_field(name="templateId", visibility=["read", "create", "update", "delete", "query"]) - """Human evaluation template Id. Required.""" + 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 shell tool call generated by the model. Required.""" + type: Literal[ItemType.SHELL_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``shell_call``. Required.""" + 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( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"in_progress\", \"completed\", and \"incomplete\".""" @overload def __init__( self, *, - template_id: str, + call_id: str, + action: "_models.FunctionShellActionParam", + id: Optional[str] = None, # pylint: disable=redefined-builtin + status: Optional[Union[str, "_models.FunctionShellCallItemStatus"]] = None, ) -> None: ... @overload @@ -6093,47 +6055,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = EvaluationRuleActionType.HUMAN_EVALUATION # type: ignore + self.type = ItemType.SHELL_CALL # type: ignore -class ImageBasedHostedAgentDefinition(HostedAgentDefinition, discriminator="hosted"): - """The image-based deployment definition for a hosted agent. +class FunctionShellCallOutputContent(_Model): + """Shell call output content. - :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 + :ivar stdout: Required. + :vartype stdout: str + :ivar stderr: Required. + :vartype stderr: str + :ivar outcome: Represents either an exit outcome (with an exit code) or a timeout outcome for a + shell call output chunk. Required. + :vartype outcome: ~azure.ai.projects.models.FunctionShellCallOutputOutcome + :ivar created_by: + :vartype created_by: str """ - image: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The image for the hosted agent. Required.""" + stdout: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + stderr: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + outcome: "_models.FunctionShellCallOutputOutcome" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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(visibility=["read", "create", "update", "delete", "query"]) @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, + stdout: str, + stderr: str, + outcome: "_models.FunctionShellCallOutputOutcome", + created_by: Optional[str] = None, ) -> None: ... @overload @@ -6147,99 +6104,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ImageGenTool(Tool, discriminator="image_generation"): - """A tool that generates images using a model like ``gpt-image-1``. +class FunctionShellCallOutputContentParam(_Model): + """Shell output content. - :ivar type: The type of the image generation tool. Always ``image_generation``. Required. - :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION - :ivar model: The image generation model to use. Default: ``gpt-image-1``. Default value is - "gpt-image-1". - :vartype model: str - :ivar quality: The quality of the generated image. One of ``low``, ``medium``, ``high``, - or ``auto``. Default: ``auto``. Is one of the following types: Literal["low"], - Literal["medium"], Literal["high"], Literal["auto"] - :vartype quality: str or str or str or str - :ivar size: The size of the generated image. One of ``1024x1024``, ``1024x1536``, - ``1536x1024``, or ``auto``. Default: ``auto``. Is one of the following types: - Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"] - :vartype size: str or str or str or str - :ivar output_format: The output format of the generated image. One of ``png``, ``webp``, or - ``jpeg``. Default: ``png``. Is one of the following types: Literal["png"], Literal["webp"], - Literal["jpeg"] - :vartype output_format: str or str or str - :ivar output_compression: Compression level for the output image. Default: 100. - :vartype output_compression: int - :ivar moderation: Moderation level for the generated image. Default: ``auto``. Is either a - Literal["auto"] type or a Literal["low"] type. - :vartype moderation: str or str - :ivar background: Background type for the generated image. One of ``transparent``, - ``opaque``, or ``auto``. Default: ``auto``. Is one of the following types: - Literal["transparent"], Literal["opaque"], Literal["auto"] - :vartype background: str or str or str - :ivar input_image_mask: Optional mask for inpainting. Contains ``image_url`` - (string, optional) and ``file_id`` (string, optional). - :vartype input_image_mask: ~azure.ai.projects.models.ImageGenToolInputImageMask - :ivar partial_images: Number of partial images to generate in streaming mode, from 0 (default - value) to 3. - :vartype partial_images: int + :ivar stdout: Captured stdout output for the shell call. Required. + :vartype stdout: str + :ivar stderr: Captured stderr output for the shell call. Required. + :vartype stderr: str + :ivar outcome: The exit or timeout outcome associated with this shell call. Required. + :vartype outcome: ~azure.ai.projects.models.FunctionShellCallOutputOutcomeParam """ - 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.""" - model: Optional[Literal["gpt-image-1"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The image generation model to use. Default: ``gpt-image-1``. Default value is \"gpt-image-1\".""" - quality: Optional[Literal["low", "medium", "high", "auto"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The quality of the generated image. One of ``low``, ``medium``, ``high``, - or ``auto``. Default: ``auto``. Is one of the following types: Literal[\"low\"], - Literal[\"medium\"], Literal[\"high\"], Literal[\"auto\"]""" - size: Optional[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\"]""" - output_format: Optional[Literal["png", "webp", "jpeg"]] = rest_field( + stdout: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Captured stdout output for the shell call. Required.""" + stderr: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Captured stderr output for the shell call. Required.""" + outcome: "_models.FunctionShellCallOutputOutcomeParam" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The output format of the generated image. One of ``png``, ``webp``, or - ``jpeg``. Default: ``png``. Is one of the following types: Literal[\"png\"], Literal[\"webp\"], - Literal[\"jpeg\"]""" - output_compression: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Compression level for the output image. Default: 100.""" - moderation: Optional[Literal["auto", "low"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Moderation level for the generated image. Default: ``auto``. Is either a Literal[\"auto\"] type - or a Literal[\"low\"] type.""" - background: Optional[Literal["transparent", "opaque", "auto"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Background type for the generated image. One of ``transparent``, - ``opaque``, or ``auto``. Default: ``auto``. Is one of the following types: - Literal[\"transparent\"], Literal[\"opaque\"], Literal[\"auto\"]""" - input_image_mask: Optional["_models.ImageGenToolInputImageMask"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional mask for inpainting. Contains ``image_url`` - (string, optional) and ``file_id`` (string, optional).""" - partial_images: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of partial images to generate in streaming mode, from 0 (default value) to 3.""" + """The exit or timeout outcome associated with this shell call. Required.""" @overload def __init__( self, *, - model: Optional[Literal["gpt-image-1"]] = None, - quality: Optional[Literal["low", "medium", "high", "auto"]] = None, - size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] = None, - output_format: Optional[Literal["png", "webp", "jpeg"]] = None, - output_compression: Optional[int] = None, - moderation: Optional[Literal["auto", "low"]] = None, - background: Optional[Literal["transparent", "opaque", "auto"]] = None, - input_image_mask: Optional["_models.ImageGenToolInputImageMask"] = None, - partial_images: Optional[int] = None, + stdout: str, + stderr: str, + outcome: "_models.FunctionShellCallOutputOutcomeParam", ) -> None: ... @overload @@ -6251,28 +6142,27 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.IMAGE_GENERATION # type: ignore -class ImageGenToolCallItemParam(ItemParam, discriminator="image_generation_call"): - """An image generation request made by the model. +class FunctionShellCallOutputOutcome(_Model): + """Shell call outcome. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION_CALL - :ivar result: The generated image encoded in base64. Required. - :vartype result: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + FunctionShellCallOutputExitOutcome, FunctionShellCallOutputTimeoutOutcome + + :ivar type: Required. Known values are: "timeout" and "exit". + :vartype type: str or ~azure.ai.projects.models.FunctionShellCallOutputOutcomeType """ - type: Literal[ItemType.IMAGE_GENERATION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - result: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The generated image encoded in base64. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"timeout\" and \"exit\".""" @overload def __init__( self, *, - result: str, + type: str, ) -> None: ... @overload @@ -6284,43 +6174,27 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.IMAGE_GENERATION_CALL # type: ignore -class ImageGenToolCallItemResource(ItemResource, discriminator="image_generation_call"): - """An image generation request made by the model. +class FunctionShellCallOutputExitOutcome(FunctionShellCallOutputOutcome, discriminator="exit"): + """Shell call exit outcome. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION_CALL - :ivar status: 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: The generated image encoded in base64. Required. - :vartype result: str + :ivar type: The outcome type. Always ``exit``. Required. + :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[ItemType.IMAGE_GENERATION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - status: Literal["in_progress", "completed", "generating", "failed"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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"]) - """The generated image encoded in base64. Required.""" + type: Literal[FunctionShellCallOutputOutcomeType.EXIT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The outcome type. Always ``exit``. Required.""" + exit_code: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Exit code from the shell process. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - status: Literal["in_progress", "completed", "generating", "failed"], - result: str, - created_by: Optional["_models.CreatedBy"] = None, + exit_code: int, ) -> None: ... @overload @@ -6332,29 +6206,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.IMAGE_GENERATION_CALL # type: ignore + self.type = FunctionShellCallOutputOutcomeType.EXIT # type: ignore -class ImageGenToolInputImageMask(_Model): - """ImageGenToolInputImageMask. +class FunctionShellCallOutputOutcomeParam(_Model): + """Shell call outcome. - :ivar image_url: Base64-encoded mask image. - :vartype image_url: str - :ivar file_id: File ID for the mask image. - :vartype file_id: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + FunctionShellCallOutputExitOutcomeParam, FunctionShellCallOutputTimeoutOutcomeParam + + :ivar type: Required. Known values are: "timeout" and "exit". + :vartype type: str or ~azure.ai.projects.models.FunctionShellCallOutputOutcomeParamType """ - image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Base64-encoded mask image.""" - file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """File ID for the mask image.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"timeout\" and \"exit\".""" @overload def __init__( self, *, - image_url: Optional[str] = None, - file_id: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -6368,44 +6241,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Insight(_Model): - """The response body for cluster insights. +class FunctionShellCallOutputExitOutcomeParam(FunctionShellCallOutputOutcomeParam, discriminator="exit"): + """Shell call exit outcome. - :ivar id: The unique identifier for the insights report. Required. - :vartype id: str - :ivar metadata: Metadata about the insights report. Required. - :vartype metadata: ~azure.ai.projects.models.InsightsMetadata - :ivar state: The current state of the insights. Required. Known values are: "NotStarted", - "Running", "Succeeded", "Failed", and "Canceled". - :vartype state: str or ~azure.ai.projects.models.OperationState - :ivar display_name: User friendly display name for the insight. Required. - :vartype display_name: str - :ivar request: Request for the insights analysis. Required. - :vartype request: ~azure.ai.projects.models.InsightRequest - :ivar result: The result of the insights report. - :vartype result: ~azure.ai.projects.models.InsightResult + :ivar type: The outcome type. Always ``exit``. Required. + :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 """ - id: str = rest_field(visibility=["read"]) - """The unique identifier for the insights report. Required.""" - metadata: "_models.InsightsMetadata" = rest_field(visibility=["read"]) - """Metadata about the insights report. Required.""" - state: Union[str, "_models.OperationState"] = rest_field(visibility=["read"]) - """The current state of the insights. Required. Known values are: \"NotStarted\", \"Running\", - \"Succeeded\", \"Failed\", and \"Canceled\".""" - display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"]) - """User friendly display name for the insight. Required.""" - request: "_models.InsightRequest" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Request for the insights analysis. Required.""" - result: Optional["_models.InsightResult"] = rest_field(visibility=["read"]) - """The result of the insights report.""" + type: Literal[FunctionShellCallOutputOutcomeParamType.EXIT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The outcome type. Always ``exit``. Required.""" + exit_code: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The exit code returned by the shell process. Required.""" @overload def __init__( self, *, - display_name: str, - request: "_models.InsightRequest", + exit_code: int, ) -> None: ... @overload @@ -6417,66 +6271,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = FunctionShellCallOutputOutcomeParamType.EXIT # type: ignore -class InsightCluster(_Model): - """A cluster of analysis samples. +class FunctionShellCallOutputItemParam(Item, discriminator="shell_call_output"): + """Shell tool call output. - :ivar id: The id of the analysis cluster. Required. + :ivar id: :vartype id: str - :ivar label: Label for the cluster. Required. - :vartype label: str - :ivar suggestion: Suggestion for the cluster. Required. - :vartype suggestion: str - :ivar suggestion_title: The title of the suggestion for the cluster. Required. - :vartype suggestion_title: str - :ivar description: Description of the analysis cluster. Required. - :vartype description: str - :ivar weight: The weight of the analysis cluster. This indicate number of samples in the - cluster. Required. - :vartype weight: int - :ivar sub_clusters: List of subclusters within this cluster. Empty if no subclusters exist. - :vartype sub_clusters: list[~azure.ai.projects.models.InsightCluster] - :ivar samples: List of samples that belong to this cluster. Empty if samples are part of - subclusters. - :vartype samples: list[~azure.ai.projects.models.InsightSample] + :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. + :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. + :vartype output: list[~azure.ai.projects.models.FunctionShellCallOutputContentParam] + :ivar max_output_length: + :vartype max_output_length: int """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The id of the analysis cluster. Required.""" - label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Label for the cluster. Required.""" - suggestion: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Suggestion for the cluster. Required.""" - suggestion_title: str = rest_field( - name="suggestionTitle", visibility=["read", "create", "update", "delete", "query"] - ) - """The title of the suggestion for the cluster. Required.""" - description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the analysis cluster. Required.""" - weight: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The weight of the analysis cluster. This indicate number of samples in the cluster. Required.""" - sub_clusters: Optional[list["_models.InsightCluster"]] = rest_field( - name="subClusters", visibility=["read", "create", "update", "delete", "query"] - ) - """List of subclusters within this cluster. Empty if no subclusters exist.""" - samples: Optional[list["_models.InsightSample"]] = rest_field( + 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 shell tool call generated by the model. Required.""" + type: Literal[ItemType.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.""" + output: list["_models.FunctionShellCallOutputContentParam"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """List of samples that belong to this cluster. Empty if samples are part of subclusters.""" + """Captured chunks of stdout and stderr output, along with their associated outcomes. Required.""" + max_output_length: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - label: str, - suggestion: str, - suggestion_title: str, - description: str, - weight: int, - sub_clusters: Optional[list["_models.InsightCluster"]] = None, - samples: Optional[list["_models.InsightSample"]] = None, + call_id: str, + output: list["_models.FunctionShellCallOutputContentParam"], + id: Optional[str] = None, # pylint: disable=redefined-builtin + max_output_length: Optional[int] = None, ) -> None: ... @overload @@ -6488,28 +6320,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ItemType.SHELL_CALL_OUTPUT # type: ignore -class InsightModelConfiguration(_Model): - """Configuration of the model used in the insight generation. +class FunctionShellCallOutputTimeoutOutcome(FunctionShellCallOutputOutcome, discriminator="timeout"): + """Shell call timeout outcome. - :ivar model_deployment_name: The model deployment to be evaluated. Accepts either the - deployment name alone or with the connection name as '{connectionName}/'. - Required. - :vartype model_deployment_name: str + :ivar type: The outcome type. Always ``timeout``. Required. + :vartype type: str or ~azure.ai.projects.models.TIMEOUT """ - model_deployment_name: str = rest_field( - name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"] - ) - """The model deployment to be evaluated. Accepts either the deployment name alone or with the - connection name as '{connectionName}/'. Required.""" + type: Literal[FunctionShellCallOutputOutcomeType.TIMEOUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The outcome type. Always ``timeout``. Required.""" @overload def __init__( self, - *, - model_deployment_name: str, ) -> None: ... @overload @@ -6521,30 +6347,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = FunctionShellCallOutputOutcomeType.TIMEOUT # type: ignore -class InsightScheduleTask(ScheduleTask, discriminator="Insight"): - """Insight task for the schedule. +class FunctionShellCallOutputTimeoutOutcomeParam( + FunctionShellCallOutputOutcomeParam, discriminator="timeout" +): # pylint: disable=name-too-long + """Shell call timeout outcome. - :ivar configuration: Configuration for the task. - :vartype configuration: dict[str, str] - :ivar type: Required. Insight task. - :vartype type: str or ~azure.ai.projects.models.INSIGHT - :ivar insight: The insight payload. Required. - :vartype insight: ~azure.ai.projects.models.Insight + :ivar type: The outcome type. Always ``timeout``. Required. + :vartype type: str or ~azure.ai.projects.models.TIMEOUT """ - type: Literal[ScheduleTaskType.INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Insight task.""" - insight: "_models.Insight" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The insight payload. Required.""" + type: Literal[FunctionShellCallOutputOutcomeParamType.TIMEOUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The outcome type. Always ``timeout``. Required.""" @overload def __init__( self, - *, - insight: "_models.Insight", - configuration: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -6556,33 +6376,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ScheduleTaskType.INSIGHT # type: ignore + self.type = FunctionShellCallOutputOutcomeParamType.TIMEOUT # type: ignore -class InsightsMetadata(_Model): - """Metadata about the insights. +class FunctionShellToolParam(Tool, discriminator="shell"): + """Shell tool. - :ivar created_at: The timestamp when the insights were created. Required. - :vartype created_at: ~datetime.datetime - :ivar completed_at: The timestamp when the insights were completed. - :vartype completed_at: ~datetime.datetime + :ivar type: The type of the shell tool. Always ``shell``. Required. + :vartype type: str or ~azure.ai.projects.models.SHELL """ - created_at: datetime.datetime = rest_field( - name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The timestamp when the insights were created. Required.""" - completed_at: Optional[datetime.datetime] = rest_field( - name="completedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The timestamp when the insights were completed.""" + 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.""" @overload def __init__( self, - *, - created_at: datetime.datetime, - completed_at: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -6594,47 +6403,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.SHELL # type: ignore -class InsightSummary(_Model): - """Summary of the error cluster analysis. +class FunctionTool(Tool, discriminator="function"): + """Function. - :ivar sample_count: Total number of samples analyzed. Required. - :vartype sample_count: int - :ivar unique_subcluster_count: Total number of unique subcluster labels. Required. - :vartype unique_subcluster_count: int - :ivar unique_cluster_count: Total number of unique clusters. Required. - :vartype unique_cluster_count: int - :ivar method: Method used for clustering. Required. - :vartype method: str - :ivar usage: Token usage while performing clustering analysis. Required. - :vartype usage: ~azure.ai.projects.models.ClusterTokenUsage + :ivar type: The type of the function tool. Always ``function``. Required. + :vartype type: str or ~azure.ai.projects.models.FUNCTION + :ivar name: The name of the function to call. Required. + :vartype name: str + :ivar description: + :vartype description: str + :ivar parameters: Required. + :vartype parameters: dict[str, any] + :ivar strict: Required. + :vartype strict: bool """ - sample_count: int = rest_field(name="sampleCount", visibility=["read", "create", "update", "delete", "query"]) - """Total number of samples analyzed. Required.""" - unique_subcluster_count: int = rest_field( - name="uniqueSubclusterCount", visibility=["read", "create", "update", "delete", "query"] - ) - """Total number of unique subcluster labels. Required.""" - unique_cluster_count: int = rest_field( - name="uniqueClusterCount", visibility=["read", "create", "update", "delete", "query"] - ) - """Total number of unique clusters. Required.""" - method: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Method used for clustering. Required.""" - usage: "_models.ClusterTokenUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Token usage while performing clustering analysis. Required.""" + 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.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function to call. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + parameters: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + strict: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - sample_count: int, - unique_subcluster_count: int, - unique_cluster_count: int, - method: str, - usage: "_models.ClusterTokenUsage", + name: str, + parameters: dict[str, Any], + strict: bool, + description: Optional[str] = None, ) -> None: ... @overload @@ -6646,30 +6450,63 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.FUNCTION # type: ignore -class ItemContent(_Model): - """ItemContent. +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: - ItemContentInputAudio, ItemContentInputFile, ItemContentInputImage, ItemContentInputText, - ItemContentOutputAudio, ItemContentOutputText, ItemContentRefusal + ImageBasedHostedAgentDefinition - :ivar type: Required. Known values are: "input_text", "input_audio", "input_image", - "input_file", "output_text", "output_audio", and "refusal". - :vartype type: str or ~azure.ai.projects.models.ItemContentType + :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.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. + :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] """ __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"input_text\", \"input_audio\", \"input_image\", \"input_file\", - \"output_text\", \"output_audio\", and \"refusal\".""" + kind: Literal[AgentKind.HOSTED] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required.""" + 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.""" + container_protocol_versions: list["_models.ProtocolVersionRecord"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The protocols that the agent supports for ingress communication of the containers. Required.""" + cpu: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The CPU configuration for the hosted agent. Required.""" + memory: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The memory configuration for the hosted agent. Required.""" + environment_variables: Optional[dict[str, str]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Environment variables to set in the hosted agent container.""" @overload def __init__( self, *, - type: str, + container_protocol_versions: list["_models.ProtocolVersionRecord"], + cpu: str, + memory: str, + rai_config: Optional["_models.RaiConfig"] = None, + tools: Optional[list["_models.Tool"]] = None, + environment_variables: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -6681,34 +6518,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.kind = AgentKind.HOSTED # type: ignore -class ItemContentInputAudio(ItemContent, discriminator="input_audio"): - """An audio input to the model. +class HourlyRecurrenceSchedule(RecurrenceSchedule, discriminator="Hourly"): + """Hourly recurrence schedule. - :ivar type: The type of the input item. Always ``input_audio``. Required. - :vartype type: str or ~azure.ai.projects.models.INPUT_AUDIO - :ivar data: Base64-encoded audio data. Required. - :vartype data: str - :ivar format: The format of the audio data. Currently supported formats are ``mp3`` and - ``wav``. Required. Is either a Literal["mp3"] type or a Literal["wav"] type. - :vartype format: str or str + :ivar type: Required. Hourly recurrence pattern. + :vartype type: str or ~azure.ai.projects.models.HOURLY """ - type: Literal[ItemContentType.INPUT_AUDIO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the input item. Always ``input_audio``. Required.""" - data: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Base64-encoded audio data. Required.""" - format: Literal["mp3", "wav"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The format of the audio data. Currently supported formats are ``mp3`` and - ``wav``. Required. Is either a Literal[\"mp3\"] type or a Literal[\"wav\"] type.""" + type: Literal[RecurrenceType.HOURLY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Hourly recurrence pattern.""" @overload def __init__( self, - *, - data: str, - format: Literal["mp3", "wav"], ) -> None: ... @overload @@ -6720,38 +6545,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemContentType.INPUT_AUDIO # type: ignore + self.type = RecurrenceType.HOURLY # type: ignore -class ItemContentInputFile(ItemContent, discriminator="input_file"): - """A file input to the model. +class HumanEvaluationRuleAction(EvaluationRuleAction, discriminator="humanEvaluation"): + """Evaluation rule action for human evaluation. - :ivar type: The type of the input item. Always ``input_file``. Required. - :vartype type: str or ~azure.ai.projects.models.INPUT_FILE - :ivar file_id: The ID of the file to be sent to the model. - :vartype file_id: str - :ivar filename: The name of the file to be sent to the model. - :vartype filename: str - :ivar file_data: The content of the file to be sent to the model. - :vartype file_data: str + :ivar type: Required. Human evaluation. + :vartype type: str or ~azure.ai.projects.models.HUMAN_EVALUATION + :ivar template_id: Human evaluation template Id. Required. + :vartype template_id: str """ - type: Literal[ItemContentType.INPUT_FILE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the input item. Always ``input_file``. Required.""" - file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the file to be sent to the model.""" - filename: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name 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.""" + type: Literal[EvaluationRuleActionType.HUMAN_EVALUATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Human evaluation.""" + template_id: str = rest_field(name="templateId", visibility=["read", "create", "update", "delete", "query"]) + """Human evaluation template Id. Required.""" @overload def __init__( self, *, - file_id: Optional[str] = None, - filename: Optional[str] = None, - file_data: Optional[str] = None, + template_id: str, ) -> None: ... @overload @@ -6763,47 +6578,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemContentType.INPUT_FILE # type: ignore + self.type = EvaluationRuleActionType.HUMAN_EVALUATION # type: ignore -class ItemContentInputImage(ItemContent, discriminator="input_image"): - """An image input to the model. Learn about `image inputs - `_. +class HybridSearchOptions(_Model): + """HybridSearchOptions. - :ivar type: The type of the input item. Always ``input_image``. Required. - :vartype type: str or ~azure.ai.projects.models.INPUT_IMAGE - :ivar image_url: The URL of the image to be sent to the model. A fully qualified URL or base64 - encoded image in a data URL. - :vartype image_url: str - :ivar file_id: The ID of the file to be sent to the model. - :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``. Is one of the following types: Literal["low"], - Literal["high"], Literal["auto"] - :vartype detail: str or str or str + :ivar embedding_weight: The weight of the embedding in the reciprocal ranking fusion. Required. + :vartype embedding_weight: float + :ivar text_weight: The weight of the text in the reciprocal ranking fusion. Required. + :vartype text_weight: float """ - type: Literal[ItemContentType.INPUT_IMAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the input item. Always ``input_image``. Required.""" - image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in - a data URL.""" - file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the file to be sent to the model.""" - detail: Optional[Literal["low", "high", "auto"]] = 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``. Is one of the following types: Literal[\"low\"], Literal[\"high\"], - Literal[\"auto\"]""" + embedding_weight: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The weight of the embedding in the reciprocal ranking fusion. Required.""" + text_weight: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The weight of the text in the reciprocal ranking fusion. Required.""" @overload def __init__( self, *, - image_url: Optional[str] = None, - file_id: Optional[str] = None, - detail: Optional[Literal["low", "high", "auto"]] = None, + embedding_weight: float, + text_weight: float, ) -> None: ... @overload @@ -6815,28 +6612,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemContentType.INPUT_IMAGE # type: ignore -class ItemContentInputText(ItemContent, discriminator="input_text"): - """A text input to the model. +class ImageBasedHostedAgentDefinition(HostedAgentDefinition, discriminator="hosted"): + """The image-based deployment definition for a hosted agent. - :ivar type: The type of the input item. Always ``input_text``. Required. - :vartype type: str or ~azure.ai.projects.models.INPUT_TEXT - :ivar text: The text input to the model. Required. - :vartype text: str + :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 """ - type: Literal[ItemContentType.INPUT_TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the input item. Always ``input_text``. Required.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text input to the model. Required.""" + image: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The image for the hosted agent. Required.""" @overload def __init__( self, *, - text: str, + 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 @@ -6848,33 +6663,110 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemContentType.INPUT_TEXT # type: ignore -class ItemContentOutputAudio(ItemContent, discriminator="output_audio"): - """An audio output from the model. - - :ivar type: The type of the output audio. Always ``output_audio``. Required. - :vartype type: str or ~azure.ai.projects.models.OUTPUT_AUDIO - :ivar data: Base64-encoded audio data from the model. Required. - :vartype data: str - :ivar transcript: The transcript of the audio data from the model. Required. - :vartype transcript: str - """ - - type: Literal[ItemContentType.OUTPUT_AUDIO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the output audio. Always ``output_audio``. Required.""" - data: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Base64-encoded audio data from the model. Required.""" - transcript: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The transcript of the audio data from the model. Required.""" +class ImageGenTool(Tool, discriminator="image_generation"): + """Image generation tool. + + :ivar type: The type of the image generation tool. Always ``image_generation``. Required. + :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"] + :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: + Literal["1024x1024"], Literal["1024x1536"], Literal["1536x1024"], Literal["auto"] + :vartype size: str or str or str or str + :ivar output_format: The output format of the generated image. One of ``png``, ``webp``, or + ``jpeg``. Default: ``png``. Is one of the following types: Literal["png"], Literal["webp"], + Literal["jpeg"] + :vartype output_format: str or str or str + :ivar output_compression: Compression level for the output image. Default: 100. + :vartype output_compression: int + :ivar moderation: Moderation level for the generated image. Default: ``auto``. Is either a + Literal["auto"] type or a Literal["low"] type. + :vartype moderation: str or str + :ivar background: Background type for the generated image. One of ``transparent``, + ``opaque``, or ``auto``. Default: ``auto``. Is one of the following types: + Literal["transparent"], Literal["opaque"], Literal["auto"] + :vartype background: str or str or str + :ivar input_fidelity: Known values are: "high" and "low". + :vartype input_fidelity: str or ~azure.ai.projects.models.InputFidelity + :ivar input_image_mask: Optional mask for inpainting. Contains ``image_url`` + (string, optional) and ``file_id`` (string, optional). + :vartype input_image_mask: ~azure.ai.projects.models.ImageGenToolInputImageMask + :ivar partial_images: Number of partial images to generate in streaming mode, from 0 (default + value) to 3. + :vartype partial_images: int + """ + + 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.""" + model: Optional[Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], str]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"gpt-image-1\"], Literal[\"gpt-image-1-mini\"], str""" + quality: Optional[Literal["low", "medium", "high", "auto"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The quality of the generated image. One of ``low``, ``medium``, ``high``, + or ``auto``. Default: ``auto``. Is one of the following types: Literal[\"low\"], + Literal[\"medium\"], Literal[\"high\"], Literal[\"auto\"]""" + size: Optional[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\"]""" + output_format: Optional[Literal["png", "webp", "jpeg"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output format of the generated image. One of ``png``, ``webp``, or + ``jpeg``. Default: ``png``. Is one of the following types: Literal[\"png\"], + Literal[\"webp\"], Literal[\"jpeg\"]""" + output_compression: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Compression level for the output image. Default: 100.""" + moderation: Optional[Literal["auto", "low"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Moderation level for the generated image. Default: ``auto``. Is either a Literal[\"auto\"] type + or a Literal[\"low\"] type.""" + background: Optional[Literal["transparent", "opaque", "auto"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Background type for the generated image. One of ``transparent``, + ``opaque``, or ``auto``. Default: ``auto``. Is one of the following types: + Literal[\"transparent\"], Literal[\"opaque\"], Literal[\"auto\"]""" + input_fidelity: Optional[Union[str, "_models.InputFidelity"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"high\" and \"low\".""" + input_image_mask: Optional["_models.ImageGenToolInputImageMask"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional mask for inpainting. Contains ``image_url`` + (string, optional) and ``file_id`` (string, optional).""" + partial_images: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of partial images to generate in streaming mode, from 0 (default value) to 3.""" @overload def __init__( self, *, - data: str, - transcript: str, + model: Optional[Union[Literal["gpt-image-1"], Literal["gpt-image-1-mini"], str]] = None, + quality: Optional[Literal["low", "medium", "high", "auto"]] = None, + size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] = None, + output_format: Optional[Literal["png", "webp", "jpeg"]] = None, + output_compression: Optional[int] = None, + moderation: Optional[Literal["auto", "low"]] = None, + background: Optional[Literal["transparent", "opaque", "auto"]] = None, + input_fidelity: Optional[Union[str, "_models.InputFidelity"]] = None, + input_image_mask: Optional["_models.ImageGenToolInputImageMask"] = None, + partial_images: Optional[int] = None, ) -> None: ... @overload @@ -6886,37 +6778,27 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemContentType.OUTPUT_AUDIO # type: ignore + self.type = ToolType.IMAGE_GENERATION # type: ignore -class ItemContentOutputText(ItemContent, discriminator="output_text"): - """A text output from the model. +class ImageGenToolInputImageMask(_Model): + """ImageGenToolInputImageMask. - :ivar type: The type of the output text. Always ``output_text``. Required. - :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] + :ivar image_url: + :vartype image_url: str + :ivar file_id: + :vartype file_id: str """ - type: Literal[ItemContentType.OUTPUT_TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the output text. Always ``output_text``. Required.""" - 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"]) + image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - text: str, - annotations: list["_models.Annotation"], - logprobs: Optional[list["_models.LogProb"]] = None, + image_url: Optional[str] = None, + file_id: Optional[str] = None, ) -> None: ... @overload @@ -6928,28 +6810,27 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemContentType.OUTPUT_TEXT # type: ignore -class ItemContentRefusal(ItemContent, discriminator="refusal"): - """A refusal from the model. +class InputContent(_Model): + """InputContent. - :ivar type: The type of the refusal. Always ``refusal``. Required. - :vartype type: str or ~azure.ai.projects.models.REFUSAL - :ivar refusal: The refusal explanationfrom the model. Required. - :vartype refusal: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + InputContentInputFileContent, InputContentInputImageContent, InputContentInputTextContent + + :ivar type: Required. Known values are: "input_text", "input_image", and "input_file". + :vartype type: str or ~azure.ai.projects.models.InputContentType """ - type: Literal[ItemContentType.REFUSAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the refusal. Always ``refusal``. Required.""" - refusal: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The refusal explanationfrom the model. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"input_text\", \"input_image\", and \"input_file\".""" @overload def __init__( self, *, - refusal: str, + type: str, ) -> None: ... @overload @@ -6961,29 +6842,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemContentType.REFUSAL # type: ignore -class ItemReferenceItemParam(ItemParam, discriminator="item_reference"): - """An internal identifier for an item to reference. +class InputContentInputFileContent(InputContent, discriminator="input_file"): + """Input file. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.ITEM_REFERENCE - :ivar id: The service-originated ID of the previously generated response item being referenced. - Required. - :vartype id: str + :ivar type: The type of the input item. Always ``input_file``. Required. + :vartype type: str or ~azure.ai.projects.models.INPUT_FILE + :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[ItemType.ITEM_REFERENCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The service-originated ID of the previously generated response item being referenced. Required.""" + 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.""" + 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, *, - id: str, # pylint: disable=redefined-builtin + file_id: Optional[str] = None, + filename: Optional[str] = None, + file_url: Optional[str] = None, + file_data: Optional[str] = None, ) -> None: ... @overload @@ -6995,49 +6888,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.ITEM_REFERENCE # type: ignore + self.type = InputContentType.INPUT_FILE # type: ignore -class LocalShellExecAction(_Model): - """Execute a shell command on the server. +class InputContentInputImageContent(InputContent, discriminator="input_image"): + """Input image. - :ivar type: The type of the local shell action. Always ``exec``. Required. Default value is - "exec". - :vartype type: str - :ivar command: The command to run. Required. - :vartype command: list[str] - :ivar timeout_ms: Optional timeout in milliseconds for the command. - :vartype timeout_ms: int - :ivar working_directory: Optional working directory to run the command in. - :vartype working_directory: str - :ivar env: Environment variables to set for the command. Required. - :vartype env: dict[str, str] - :ivar user: Optional user to run the command as. - :vartype user: str + :ivar type: The type of the input item. Always ``input_image``. Required. + :vartype type: str or ~azure.ai.projects.models.INPUT_IMAGE + :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["exec"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of the local shell action. Always ``exec``. Required. Default value is \"exec\".""" - command: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The command to run. Required.""" - timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional timeout in milliseconds for the command.""" - working_directory: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional working directory to run the command in.""" - env: dict[str, str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Environment variables to set for the command. Required.""" - user: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional user to run the command as.""" + 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.""" + 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, *, - command: list[str], - env: dict[str, str], - timeout_ms: Optional[int] = None, - working_directory: Optional[str] = None, - user: Optional[str] = None, + detail: Union[str, "_models.ImageDetail"], + image_url: Optional[str] = None, + file_id: Optional[str] = None, ) -> None: ... @overload @@ -7049,22 +6931,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["exec"] = "exec" + self.type = InputContentType.INPUT_IMAGE # type: ignore -class LocalShellTool(Tool, discriminator="local_shell"): - """A tool that allows the model to execute shell commands in a local environment. +class InputContentInputTextContent(InputContent, discriminator="input_text"): + """Input text. - :ivar type: The type of the local shell tool. Always ``local_shell``. Required. - :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL + :ivar type: The type of the input item. Always ``input_text``. Required. + :vartype type: str or ~azure.ai.projects.models.INPUT_TEXT + :ivar text: The text input to the model. Required. + :vartype text: str """ - type: Literal[ToolType.LOCAL_SHELL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the local shell tool. Always ``local_shell``. Required.""" + 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.""" + 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 @@ -7076,33 +6964,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.LOCAL_SHELL # type: ignore + self.type = InputContentType.INPUT_TEXT # type: ignore -class LocalShellToolCallItemParam(ItemParam, discriminator="local_shell_call"): - """A tool call to run a command on the local shell. +class InputFileContent(_Model): + """Input file. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL_CALL - :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 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[ItemType.LOCAL_SHELL_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """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.""" + 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, *, - call_id: str, - action: "_models.LocalShellExecAction", + file_id: Optional[str] = None, + filename: Optional[str] = None, + file_url: Optional[str] = None, + file_data: Optional[str] = None, ) -> None: ... @overload @@ -7114,48 +7012,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.LOCAL_SHELL_CALL # type: ignore + self.type: Literal["input_file"] = "input_file" -class LocalShellToolCallItemResource(ItemResource, discriminator="local_shell_call"): - """A tool call to run a command on the local shell. +class InputFileContentParam(_Model): + """Input file. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL_CALL - :ivar status: Required. Is one of the following types: Literal["in_progress"], - Literal["completed"], Literal["incomplete"] - :vartype status: str or str or 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 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: + :vartype filename: str + :ivar file_data: + :vartype file_data: str + :ivar file_url: + :vartype file_url: str """ - type: Literal[ItemType.LOCAL_SHELL_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - status: Literal["in_progress", "completed", "incomplete"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Is one of the following types: Literal[\"in_progress\"], Literal[\"completed\"], - Literal[\"incomplete\"]""" - 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.""" + 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"]) + file_data: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + file_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - status: Literal["in_progress", "completed", "incomplete"], - call_id: str, - action: "_models.LocalShellExecAction", - created_by: Optional["_models.CreatedBy"] = None, + file_id: Optional[str] = None, + filename: Optional[str] = None, + file_data: Optional[str] = None, + file_url: Optional[str] = None, ) -> None: ... @overload @@ -7167,28 +7057,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.LOCAL_SHELL_CALL # type: ignore + self.type: Literal["input_file"] = "input_file" -class LocalShellToolCallOutputItemParam(ItemParam, discriminator="local_shell_call_output"): - """The output of a local shell tool call. +class InputImageContent(_Model): + """Input image. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL_CALL_OUTPUT - :ivar output: A JSON string of the output of the local shell tool call. Required. - :vartype output: str + :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[ItemType.LOCAL_SHELL_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - output: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A JSON string of the output of the local shell tool call. Required.""" + 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, *, - output: str, + detail: Union[str, "_models.ImageDetail"], + image_url: Optional[str] = None, + file_id: Optional[str] = None, ) -> None: ... @overload @@ -7200,43 +7101,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.LOCAL_SHELL_CALL_OUTPUT # type: ignore + self.type: Literal["input_image"] = "input_image" -class LocalShellToolCallOutputItemResource(ItemResource, discriminator="local_shell_call_output"): - """The output of a local shell tool call. +class InputImageContentParamAutoParam(_Model): + """Input image. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.LOCAL_SHELL_CALL_OUTPUT - :ivar status: Required. Is one of the following types: Literal["in_progress"], - Literal["completed"], Literal["incomplete"] - :vartype status: str or str or str - :ivar output: A JSON string of the output of the local shell tool call. Required. - :vartype output: str + :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: Known values are: "low", "high", and "auto". + :vartype detail: str or ~azure.ai.projects.models.DetailEnum """ - type: Literal[ItemType.LOCAL_SHELL_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - status: Literal["in_progress", "completed", "incomplete"] = rest_field( + type: Literal["input_image"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the input item. Always ``input_image``. Required. Default value is \"input_image\".""" + image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + detail: Optional[Union[str, "_models.DetailEnum"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Required. Is one of the following types: Literal[\"in_progress\"], Literal[\"completed\"], - Literal[\"incomplete\"]""" - output: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A JSON string of the output of the local shell tool call. Required.""" + """Known values are: \"low\", \"high\", and \"auto\".""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - status: Literal["in_progress", "completed", "incomplete"], - output: str, - created_by: Optional["_models.CreatedBy"] = None, + image_url: Optional[str] = None, + file_id: Optional[str] = None, + detail: Optional[Union[str, "_models.DetailEnum"]] = None, ) -> None: ... @overload @@ -7248,39 +7145,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.LOCAL_SHELL_CALL_OUTPUT # type: ignore + self.type: Literal["input_image"] = "input_image" -class LogProb(_Model): - """The log probability of a token. +class InputMessage(Item, discriminator="message"): + """Input message. - :ivar token: Required. - :vartype token: str - :ivar logprob: Required. - :vartype logprob: float - :ivar bytes: Required. - :vartype bytes: list[int] - :ivar top_logprobs: Required. - :vartype top_logprobs: list[~azure.ai.projects.models.TopLogProb] + :ivar type: The type of the message input. Always set to ``message``. Required. + :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: + Literal["in_progress"], Literal["completed"], Literal["incomplete"] + :vartype status: str or str or str + :ivar content: Required. + :vartype content: list[~azure.ai.projects.models.InputContent] """ - token: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - logprob: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - bytes: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - top_logprobs: list["_models.TopLogProb"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[ItemType.MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the message input. Always set to ``message``. Required.""" + role: Literal["user", "system", "developer"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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\"]""" + 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\"]""" + content: list["_models.InputContent"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" @overload def __init__( self, *, - token: str, - logprob: float, - bytes: list[int], - top_logprobs: list["_models.TopLogProb"], + role: Literal["user", "system", "developer"], + content: list["_models.InputContent"], + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, ) -> None: ... @overload @@ -7292,39 +7199,55 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ItemType.MESSAGE # type: ignore -class ManagedAzureAISearchIndex(Index, discriminator="ManagedAzureSearch"): - """Managed Azure AI Search Index Definition. +class ItemResource(_Model): + """Content item used to generate a response. - :ivar id: Asset ID, a unique identifier for the asset. - :vartype id: str - :ivar name: The name of the resource. Required. - :vartype name: str - :ivar version: The version of the resource. Required. - :vartype version: str - :ivar description: The asset description text. - :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar type: Type of index. Required. Managed Azure Search - :vartype type: str or ~azure.ai.projects.models.MANAGED_AZURE_SEARCH - :ivar vector_store_id: Vector store id of managed index. Required. - :vartype vector_store_id: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ItemResourceApplyPatchToolCall, ItemResourceApplyPatchToolCallOutput, + ItemResourceCodeInterpreterToolCall, ItemResourceComputerToolCall, + ItemResourceComputerToolCallOutputResource, ItemResourceFileSearchToolCall, + ItemResourceFunctionToolCallResource, ItemResourceFunctionToolCallOutputResource, + ItemResourceImageGenToolCall, ItemResourceLocalShellToolCall, + ItemResourceLocalShellToolCallOutput, ItemResourceMcpApprovalRequest, + ItemResourceMcpApprovalResponseResource, ItemResourceMcpToolCall, ItemResourceMcpListTools, + MemorySearchToolCallItemResource, InputMessageResource, OAuthConsentRequestItemResource, + ItemResourceOutputMessage, ItemResourceFunctionShellCall, ItemResourceFunctionShellCallOutput, + StructuredOutputsItemResource, ItemResourceWebSearchToolCall, WorkflowActionOutputItemResource + + :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", + and "mcp_call". + :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 """ - type: Literal[IndexType.MANAGED_AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of index. Required. Managed Azure Search""" - vector_store_id: str = rest_field(name="vectorStoreId", visibility=["create"]) - """Vector store id of managed index. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """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\", and \"mcp_call\".""" + created_by: Optional[Union["_models.CreatedBy", str]] = 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.""" @overload def __init__( self, *, - vector_store_id: str, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, + type: str, + created_by: Optional[Union["_models.CreatedBy", str]] = None, ) -> None: ... @overload @@ -7336,38 +7259,57 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = IndexType.MANAGED_AZURE_SEARCH # type: ignore -class MCPApprovalRequestItemParam(ItemParam, discriminator="mcp_approval_request"): - """A request for human approval of a tool invocation. +class InputMessageResource(ItemResource, discriminator="message"): + """InputMessageResource. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_REQUEST - :ivar server_label: The label of the MCP server making the request. Required. - :vartype server_label: str - :ivar name: The name of the tool to run. Required. - :vartype name: str - :ivar arguments: A JSON string of arguments for the tool. Required. - :vartype arguments: str + :ivar created_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. + :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: + Literal["in_progress"], Literal["completed"], Literal["incomplete"] + :vartype status: str or str or str + :ivar content: Required. + :vartype content: list[~azure.ai.projects.models.InputContent] + :ivar id: The unique ID of the message input. Required. + :vartype id: str """ - type: Literal[ItemType.MCP_APPROVAL_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + 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.""" + role: Literal["user", "system", "developer"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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\"]""" + 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\"]""" + content: list["_models.InputContent"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """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.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the message input. Required.""" @overload def __init__( self, *, - server_label: str, - name: str, - arguments: str, + role: Literal["user", "system", "developer"], + content: list["_models.InputContent"], + id: str, # pylint: disable=redefined-builtin + created_by: Optional[Union["_models.CreatedBy", str]] = None, + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, ) -> None: ... @overload @@ -7379,44 +7321,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.MCP_APPROVAL_REQUEST # type: ignore + self.type = ItemResourceType.MESSAGE # type: ignore -class MCPApprovalRequestItemResource(ItemResource, discriminator="mcp_approval_request"): - """A request for human approval of a tool invocation. +class InputTextContent(_Model): + """Input text. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_REQUEST - :ivar server_label: The label of the MCP server making the request. Required. - :vartype server_label: str - :ivar name: The name of the tool to run. Required. - :vartype name: str - :ivar arguments: A JSON string of arguments for the tool. Required. - :vartype arguments: str + :ivar type: 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[ItemType.MCP_APPROVAL_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The label of the MCP server making the request. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the tool to run. Required.""" - arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A JSON string of arguments for the tool. Required.""" + type: Literal["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, *, - id: str, # pylint: disable=redefined-builtin - server_label: str, - name: str, - arguments: str, - created_by: Optional["_models.CreatedBy"] = None, + text: str, ) -> None: ... @overload @@ -7428,38 +7355,3397 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.MCP_APPROVAL_REQUEST # type: ignore + self.type: Literal["input_text"] = "input_text" -class MCPApprovalResponseItemParam(ItemParam, discriminator="mcp_approval_response"): - """A response to an MCP approval request. +class InputTextContentParam(_Model): + """Input text. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_RESPONSE - :ivar approval_request_id: The ID of the approval request being answered. Required. - :vartype approval_request_id: str - :ivar approve: Whether the request was approved. Required. - :vartype approve: bool - :ivar reason: Optional reason for the decision. - :vartype reason: str + :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[ItemType.MCP_APPROVAL_RESPONSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - approval_request_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the approval request being answered. Required.""" - approve: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the request was approved. Required.""" - reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional reason for the decision.""" + 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, *, - approval_request_id: str, - approve: bool, - reason: Optional[str] = None, + 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 Insight(_Model): + """The response body for cluster insights. + + :ivar id: The unique identifier for the insights report. Required. + :vartype id: str + :ivar metadata: Metadata about the insights report. Required. + :vartype metadata: ~azure.ai.projects.models.InsightsMetadata + :ivar state: The current state of the insights. Required. Known values are: "NotStarted", + "Running", "Succeeded", "Failed", and "Canceled". + :vartype state: str or ~azure.ai.projects.models.OperationState + :ivar display_name: User friendly display name for the insight. Required. + :vartype display_name: str + :ivar request: Request for the insights analysis. Required. + :vartype request: ~azure.ai.projects.models.InsightRequest + :ivar result: The result of the insights report. + :vartype result: ~azure.ai.projects.models.InsightResult + """ + + id: str = rest_field(visibility=["read"]) + """The unique identifier for the insights report. Required.""" + metadata: "_models.InsightsMetadata" = rest_field(visibility=["read"]) + """Metadata about the insights report. Required.""" + state: Union[str, "_models.OperationState"] = rest_field(visibility=["read"]) + """The current state of the insights. Required. Known values are: \"NotStarted\", \"Running\", + \"Succeeded\", \"Failed\", and \"Canceled\".""" + display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"]) + """User friendly display name for the insight. Required.""" + request: "_models.InsightRequest" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Request for the insights analysis. Required.""" + result: Optional["_models.InsightResult"] = rest_field(visibility=["read"]) + """The result of the insights report.""" + + @overload + def __init__( + self, + *, + display_name: str, + request: "_models.InsightRequest", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InsightCluster(_Model): + """A cluster of analysis samples. + + :ivar id: The id of the analysis cluster. Required. + :vartype id: str + :ivar label: Label for the cluster. Required. + :vartype label: str + :ivar suggestion: Suggestion for the cluster. Required. + :vartype suggestion: str + :ivar suggestion_title: The title of the suggestion for the cluster. Required. + :vartype suggestion_title: str + :ivar description: Description of the analysis cluster. Required. + :vartype description: str + :ivar weight: The weight of the analysis cluster. This indicate number of samples in the + cluster. Required. + :vartype weight: int + :ivar sub_clusters: List of subclusters within this cluster. Empty if no subclusters exist. + :vartype sub_clusters: list[~azure.ai.projects.models.InsightCluster] + :ivar samples: List of samples that belong to this cluster. Empty if samples are part of + subclusters. + :vartype samples: list[~azure.ai.projects.models.InsightSample] + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The id of the analysis cluster. Required.""" + label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Label for the cluster. Required.""" + suggestion: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Suggestion for the cluster. Required.""" + suggestion_title: str = rest_field( + name="suggestionTitle", visibility=["read", "create", "update", "delete", "query"] + ) + """The title of the suggestion for the cluster. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of the analysis cluster. Required.""" + weight: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The weight of the analysis cluster. This indicate number of samples in the cluster. Required.""" + sub_clusters: Optional[list["_models.InsightCluster"]] = rest_field( + name="subClusters", visibility=["read", "create", "update", "delete", "query"] + ) + """List of subclusters within this cluster. Empty if no subclusters exist.""" + samples: Optional[list["_models.InsightSample"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of samples that belong to this cluster. Empty if samples are part of subclusters.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + label: str, + suggestion: str, + suggestion_title: str, + description: str, + weight: int, + sub_clusters: Optional[list["_models.InsightCluster"]] = None, + samples: Optional[list["_models.InsightSample"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InsightModelConfiguration(_Model): + """Configuration of the model used in the insight generation. + + :ivar model_deployment_name: The model deployment to be evaluated. Accepts either the + deployment name alone or with the connection name as '{connectionName}/'. + Required. + :vartype model_deployment_name: str + """ + + model_deployment_name: str = rest_field( + name="modelDeploymentName", visibility=["read", "create", "update", "delete", "query"] + ) + """The model deployment to be evaluated. Accepts either the deployment name alone or with the + connection name as '{connectionName}/'. Required.""" + + @overload + def __init__( + self, + *, + model_deployment_name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InsightScheduleTask(ScheduleTask, discriminator="Insight"): + """Insight task for the schedule. + + :ivar configuration: Configuration for the task. + :vartype configuration: dict[str, str] + :ivar type: Required. Insight task. + :vartype type: str or ~azure.ai.projects.models.INSIGHT + :ivar insight: The insight payload. Required. + :vartype insight: ~azure.ai.projects.models.Insight + """ + + type: Literal[ScheduleTaskType.INSIGHT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Insight task.""" + insight: "_models.Insight" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The insight payload. Required.""" + + @overload + def __init__( + self, + *, + insight: "_models.Insight", + configuration: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ScheduleTaskType.INSIGHT # type: ignore + + +class InsightsMetadata(_Model): + """Metadata about the insights. + + :ivar created_at: The timestamp when the insights were created. Required. + :vartype created_at: ~datetime.datetime + :ivar completed_at: The timestamp when the insights were completed. + :vartype completed_at: ~datetime.datetime + """ + + created_at: datetime.datetime = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp when the insights were created. Required.""" + completed_at: Optional[datetime.datetime] = rest_field( + name="completedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp when the insights were completed.""" + + @overload + def __init__( + self, + *, + created_at: datetime.datetime, + completed_at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InsightSummary(_Model): + """Summary of the error cluster analysis. + + :ivar sample_count: Total number of samples analyzed. Required. + :vartype sample_count: int + :ivar unique_subcluster_count: Total number of unique subcluster labels. Required. + :vartype unique_subcluster_count: int + :ivar unique_cluster_count: Total number of unique clusters. Required. + :vartype unique_cluster_count: int + :ivar method: Method used for clustering. Required. + :vartype method: str + :ivar usage: Token usage while performing clustering analysis. Required. + :vartype usage: ~azure.ai.projects.models.ClusterTokenUsage + """ + + sample_count: int = rest_field(name="sampleCount", visibility=["read", "create", "update", "delete", "query"]) + """Total number of samples analyzed. Required.""" + unique_subcluster_count: int = rest_field( + name="uniqueSubclusterCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Total number of unique subcluster labels. Required.""" + unique_cluster_count: int = rest_field( + name="uniqueClusterCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Total number of unique clusters. Required.""" + method: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Method used for clustering. Required.""" + usage: "_models.ClusterTokenUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Token usage while performing clustering analysis. Required.""" + + @overload + def __init__( + self, + *, + sample_count: int, + unique_subcluster_count: int, + unique_cluster_count: int, + method: str, + usage: "_models.ClusterTokenUsage", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ItemCodeInterpreterToolCall(Item, discriminator="code_interpreter_call"): + """Code interpreter tool call. + + :ivar type: The type of the code interpreter tool call. Always ``code_interpreter_call``. + Required. + :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[ItemType.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.""" + 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"]], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemType.CODE_INTERPRETER_CALL # type: ignore + + +class ItemComputerToolCall(Item, discriminator="computer_call"): + """Computer tool call. + + :ivar type: The type of the computer call. Always ``computer_call``. Required. + :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[ItemType.COMPUTER_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the computer call. Always ``computer_call``. Required.""" + 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"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemType.COMPUTER_CALL # type: ignore + + +class ItemCustomToolCall(Item, discriminator="custom_tool_call"): + """Custom tool call. + + :ivar type: The type of the custom tool call. Always ``custom_tool_call``. Required. + :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[ItemType.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.""" + 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, + 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 = ItemType.CUSTOM_TOOL_CALL # type: ignore + + +class ItemCustomToolCallOutput(Item, discriminator="custom_tool_call_output"): + """Custom tool call output. + + :ivar type: The type of the custom tool call output. Always ``custom_tool_call_output``. + Required. + :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 + [FunctionAndCustomToolCallOutput] type. + :vartype output: str or list[~azure.ai.projects.models.FunctionAndCustomToolCallOutput] + """ + + type: Literal[ItemType.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.""" + 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"]) + """The call ID, used to map this custom tool call output to a custom tool call. Required.""" + 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.""" + + @overload + def __init__( + self, + *, + call_id: str, + output: Union[str, list["_models.FunctionAndCustomToolCallOutput"]], + 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 = ItemType.CUSTOM_TOOL_CALL_OUTPUT # type: ignore + + +class ItemFileSearchToolCall(Item, discriminator="file_search_call"): + """File search tool 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. + :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[ItemType.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.""" + 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], + 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 = ItemType.FILE_SEARCH_CALL # type: ignore + + +class ItemFunctionToolCall(Item, discriminator="function_call"): + """Function tool 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. + :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[ItemType.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.""" + 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, + 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 = ItemType.FUNCTION_CALL # type: ignore + + +class ItemImageGenToolCall(Item, discriminator="image_generation_call"): + """Image generation call. + + :ivar type: The type of the image generation call. Always ``image_generation_call``. Required. + :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[ItemType.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.""" + 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, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemType.IMAGE_GENERATION_CALL # type: ignore + + +class ItemLocalShellToolCall(Item, discriminator="local_shell_call"): + """Local shell call. + + :ivar type: The type of the local shell call. Always ``local_shell_call``. Required. + :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[ItemType.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.""" + 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"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemType.LOCAL_SHELL_CALL # type: ignore + + +class ItemLocalShellToolCallOutput(Item, discriminator="local_shell_call_output"): + """Local shell call output. + + :ivar type: The type of the local shell tool call output. Always ``local_shell_call_output``. + Required. + :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 + :ivar output: A JSON string of the output of the local shell tool call. Required. + :vartype output: str + :ivar status: Is one of the following types: Literal["in_progress"], Literal["completed"], + Literal["incomplete"] + :vartype status: str or str or str + """ + + type: Literal[ItemType.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.""" + 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"]) + """A JSON string of the output of the local shell tool call. Required.""" + status: Optional[Literal["in_progress", "completed", "incomplete"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"in_progress\"], Literal[\"completed\"], + Literal[\"incomplete\"]""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + output: str, + 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 = ItemType.LOCAL_SHELL_CALL_OUTPUT # type: ignore + + +class ItemMcpApprovalRequest(Item, discriminator="mcp_approval_request"): + """MCP approval request. + + :ivar type: The type of the item. Always ``mcp_approval_request``. Required. + :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[ItemType.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.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the approval request. Required.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the MCP server making the request. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the tool to run. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A JSON string of arguments for the tool. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + server_label: str, + name: str, + arguments: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemType.MCP_APPROVAL_REQUEST # type: ignore + + +class ItemMcpListTools(Item, discriminator="mcp_list_tools"): + """MCP list tools. + + :ivar type: The type of the item. Always ``mcp_list_tools``. Required. + :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[ItemType.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.""" + 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"], + 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 = ItemType.MCP_LIST_TOOLS # type: ignore + + +class ItemMcpToolCall(Item, discriminator="mcp_call"): + """MCP tool call. + + :ivar type: The type of the item. Always ``mcp_call``. Required. + :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[ItemType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``mcp_call``. Required.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the tool call. Required.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the MCP server running the tool. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the tool that was run. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A JSON string of the arguments passed to the tool. Required.""" + 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, + 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 = ItemType.MCP_CALL # type: ignore + + +class ItemOutputMessage(Item, discriminator="output_message"): + """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. + :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[ItemType.OUTPUT_MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the output message. Always ``message``. Required.""" + 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"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemType.OUTPUT_MESSAGE # type: ignore + self.role: Literal["assistant"] = "assistant" + + +class ItemReasoningItem(Item, discriminator="reasoning"): + """Reasoning. + + :ivar type: The type of the object. Always ``reasoning``. Required. + :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[ItemType.REASONING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``reasoning``. Required.""" + 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"], + 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 = ItemType.REASONING # type: ignore + + +class ItemReferenceParam(InputItem, discriminator="item_reference"): + """Item reference. + + :ivar type: The type of item to reference. Always ``item_reference``. Required. + :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.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item to reference. 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) + self.type = InputItemType.ITEM_REFERENCE # type: ignore + + +class ItemResourceApplyPatchToolCall(ItemResource, discriminator="apply_patch_call"): + """Apply patch tool call. + + :ivar type: The type of the item. Always ``apply_patch_call``. Required. + :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 + """ + + 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.""" + 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"] + ) + """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"] + ) + """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, + *, + id: str, # pylint: disable=redefined-builtin + call_id: str, + status: Union[str, "_models.ApplyPatchCallStatus"], + operation: "_models.ApplyPatchFileOperation", + 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 = ItemResourceType.APPLY_PATCH_CALL # type: ignore + + +class ItemResourceApplyPatchToolCallOutput(ItemResource, discriminator="apply_patch_call_output"): + """Apply patch tool call output. + + :ivar type: The type of the item. Always ``apply_patch_call_output``. Required. + :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[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.""" + 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"], + 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 = ItemResourceType.APPLY_PATCH_CALL_OUTPUT # type: ignore + + +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 type: The type of the code interpreter tool call. Always ``code_interpreter_call``. + Required. + :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[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.""" + 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"]], + created_by: Optional[Union["_models.CreatedBy", str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemResourceType.CODE_INTERPRETER_CALL # type: ignore + + +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. + :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[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.""" + 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"], + created_by: Optional[Union["_models.CreatedBy", str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemResourceType.COMPUTER_CALL # type: ignore + + +class ItemResourceComputerToolCallOutputResource( + ItemResource, discriminator="computer_call_output" +): # 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 type: The type of the computer tool call output. Always ``computer_call_output``. + Required. + :vartype type: str or ~azure.ai.projects.models.COMPUTER_CALL_OUTPUT + :ivar id: The ID of the computer tool call output. + :vartype id: str + :ivar call_id: The ID of the computer tool call that produced the output. Required. + :vartype call_id: str + :ivar acknowledged_safety_checks: The safety checks reported by the API that have been + acknowledged by the + developer. + :vartype acknowledged_safety_checks: + list[~azure.ai.projects.models.ComputerCallSafetyCheckParam] + :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"] + :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.""" + 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"]) + """The ID of the computer tool call that produced the output. Required.""" + 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.""" + 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\"]""" + + @overload + def __init__( + self, + *, + call_id: str, + output: "_models.ComputerScreenshotImage", + created_by: Optional[Union["_models.CreatedBy", 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, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemResourceType.COMPUTER_CALL_OUTPUT # type: ignore + + +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 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. + :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[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.""" + 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], + created_by: Optional[Union["_models.CreatedBy", 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 = ItemResourceType.FILE_SEARCH_CALL # type: ignore + + +class ItemResourceFunctionShellCall(ItemResource, discriminator="shell_call"): + """Shell tool call. + + :ivar type: The type of the item. Always ``shell_call``. Required. + :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[ItemResourceType.SHELL_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``shell_call``. Required.""" + 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"], + 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 = ItemResourceType.SHELL_CALL # type: ignore + + +class ItemResourceFunctionShellCallOutput(ItemResource, discriminator="shell_call_output"): + """Shell call output. + + :ivar type: The type of the shell call output. Always ``shell_call_output``. Required. + :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: + :vartype created_by: str + """ + + 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.""" + 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"]) + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + call_id: str, + output: list["_models.FunctionShellCallOutputContent"], + max_output_length: int, + 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 = ItemResourceType.SHELL_CALL_OUTPUT # type: ignore + + +class ItemResourceFunctionToolCallOutputResource( + ItemResource, discriminator="function_call_output" +): # 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. + :vartype id: str + :ivar type: The type of the function tool call output. Always ``function_call_output``. + Required. + :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. + :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: + 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.""" + 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.""" + 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.""" + 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, + output: Union[str, list["_models.FunctionAndCustomToolCallOutput"]], + created_by: Optional[Union["_models.CreatedBy", 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 = ItemResourceType.FUNCTION_CALL_OUTPUT # type: ignore + + +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 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. + :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[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.""" + 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, + created_by: Optional[Union["_models.CreatedBy", 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 = ItemResourceType.FUNCTION_CALL # type: ignore + + +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 type: The type of the image generation call. Always ``image_generation_call``. Required. + :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[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.""" + 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, + created_by: Optional[Union["_models.CreatedBy", str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemResourceType.IMAGE_GENERATION_CALL # type: ignore + + +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 type: The type of the local shell call. Always ``local_shell_call``. Required. + :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[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.""" + 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"], + created_by: Optional[Union["_models.CreatedBy", str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemResourceType.LOCAL_SHELL_CALL # type: ignore + + +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 type: The type of the local shell tool call output. Always ``local_shell_call_output``. + Required. + :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 + :ivar output: A JSON string of the output of the local shell tool call. Required. + :vartype output: str + :ivar status: Is one of the following types: Literal["in_progress"], Literal["completed"], + Literal["incomplete"] + :vartype status: str or str or str + """ + + 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.""" + 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"]) + """A JSON string of the output of the local shell tool call. Required.""" + status: Optional[Literal["in_progress", "completed", "incomplete"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"in_progress\"], Literal[\"completed\"], + Literal[\"incomplete\"]""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + output: str, + created_by: Optional[Union["_models.CreatedBy", str]] = 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 = ItemResourceType.LOCAL_SHELL_CALL_OUTPUT # type: ignore + + +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 type: The type of the item. Always ``mcp_approval_request``. Required. + :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[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.""" + 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, + created_by: Optional[Union["_models.CreatedBy", str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemResourceType.MCP_APPROVAL_REQUEST # type: ignore + + +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 type: The type of the item. Always ``mcp_approval_response``. Required. + :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_RESPONSE + :ivar id: The unique ID of the approval response. Required. + :vartype id: str + :ivar approval_request_id: The ID of the approval request being answered. Required. + :vartype approval_request_id: str + :ivar approve: Whether the request was approved. Required. + :vartype approve: bool + :ivar reason: + :vartype reason: str + """ + + type: Literal[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.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the approval response. Required.""" + approval_request_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the approval request being answered. Required.""" + approve: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the request was approved. Required.""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + approval_request_id: str, + approve: bool, + created_by: Optional[Union["_models.CreatedBy", str]] = None, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemResourceType.MCP_APPROVAL_RESPONSE # type: ignore + + +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. + :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[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.""" + 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"], + created_by: Optional[Union["_models.CreatedBy", 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 = ItemResourceType.MCP_LIST_TOOLS # type: ignore + + +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. + :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[ItemResourceType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``mcp_call``. Required.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the tool call. Required.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the MCP server running the tool. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the tool that was run. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A JSON string of the arguments passed to the tool. Required.""" + 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, + created_by: Optional[Union["_models.CreatedBy", 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 = ItemResourceType.MCP_CALL # type: ignore + + +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 id: The unique ID of the output message. Required. + :vartype id: str + :ivar type: The type of the output message. Always ``message``. Required. + :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[ItemResourceType.OUTPUT_MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the output message. Always ``message``. Required.""" + 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"], + created_by: Optional[Union["_models.CreatedBy", str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemResourceType.OUTPUT_MESSAGE # type: ignore + self.role: Literal["assistant"] = "assistant" + + +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 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. + :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[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.""" + 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" + ], + created_by: Optional[Union["_models.CreatedBy", str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemResourceType.WEB_SEARCH_CALL # type: ignore + + +class ItemWebSearchToolCall(Item, discriminator="web_search_call"): + """Web search tool 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. + :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[ItemType.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.""" + 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" + ], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemType.WEB_SEARCH_CALL # type: ignore + + +class KeyPressAction(ComputerAction, discriminator="keypress"): + """KeyPress. + + :ivar type: Specifies the event type. For a keypress action, this property is always set to + ``keypress``. Required. + :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. + :vartype keys_property: list[str] + """ + + 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.""" + keys_property: list[str] = rest_field( + name="keys", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="keys" + ) + """The combination of keys the model is requesting to be pressed. This is an array of strings, + each representing a key. Required.""" + + @overload + def __init__( + self, + *, + keys_property: list[str], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ComputerActionType.KEYPRESS # type: ignore + + +class LocalShellExecAction(_Model): + """Local shell exec action. + + :ivar type: The type of the local shell action. Always ``exec``. Required. Default value is + "exec". + :vartype type: str + :ivar command: The command to run. Required. + :vartype command: list[str] + :ivar timeout_ms: + :vartype timeout_ms: int + :ivar working_directory: + :vartype working_directory: str + :ivar env: Environment variables to set for the command. Required. + :vartype env: dict[str, str] + :ivar user: + :vartype user: str + """ + + type: Literal["exec"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the local shell action. Always ``exec``. Required. Default value is \"exec\".""" + command: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The command to run. Required.""" + timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + working_directory: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + env: dict[str, str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Environment variables to set for the command. Required.""" + user: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + command: list[str], + env: dict[str, str], + timeout_ms: Optional[int] = None, + working_directory: Optional[str] = None, + user: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw 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["exec"] = "exec" + + +class LocalShellToolParam(Tool, discriminator="local_shell"): + """Local shell tool. + + :ivar type: The type of the local shell tool. Always ``local_shell``. Required. + :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.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolType.LOCAL_SHELL # type: ignore + + +class LogProb(_Model): + """Log probability. + + :ivar token: Required. + :vartype token: str + :ivar logprob: Required. + :vartype logprob: float + :ivar bytes: Required. + :vartype bytes: list[int] + :ivar top_logprobs: Required. + :vartype top_logprobs: list[~azure.ai.projects.models.TopLogProb] + """ + + token: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + logprob: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + bytes: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + top_logprobs: list["_models.TopLogProb"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + + @overload + def __init__( + self, + *, + token: str, + logprob: float, + bytes: list[int], + top_logprobs: list["_models.TopLogProb"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedAzureAISearchIndex(Index, discriminator="ManagedAzureSearch"): + """Managed Azure AI Search Index Definition. + + :ivar id: Asset ID, a unique identifier for the asset. + :vartype id: str + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar version: The version of the resource. Required. + :vartype version: str + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar type: Type of index. Required. Managed Azure Search + :vartype type: str or ~azure.ai.projects.models.MANAGED_AZURE_SEARCH + :ivar vector_store_id: Vector store id of managed index. Required. + :vartype vector_store_id: str + """ + + type: Literal[IndexType.MANAGED_AZURE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Type of index. Required. Managed Azure Search""" + vector_store_id: str = rest_field(name="vectorStoreId", visibility=["create"]) + """Vector store id of managed index. Required.""" + + @overload + def __init__( + self, + *, + vector_store_id: str, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = IndexType.MANAGED_AZURE_SEARCH # type: ignore + + +class MCPApprovalResponse(Item, discriminator="mcp_approval_response"): + """MCP approval response. + + :ivar type: The type of the item. Always ``mcp_approval_response``. Required. + :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_RESPONSE + :ivar id: + :vartype id: str + :ivar approval_request_id: The ID of the approval request being answered. Required. + :vartype approval_request_id: str + :ivar approve: Whether the request was approved. Required. + :vartype approve: bool + :ivar reason: + :vartype reason: str + """ + + type: Literal[ItemType.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.""" + 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.""" + approve: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the request was approved. Required.""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + approval_request_id: str, + approve: bool, + id: Optional[str] = None, # pylint: disable=redefined-builtin + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemType.MCP_APPROVAL_RESPONSE # type: ignore + + +class MCPListToolsTool(_Model): + """MCP list tools tool. + + :ivar name: The name of the tool. Required. + :vartype name: str + :ivar description: + :vartype description: str + :ivar input_schema: The JSON schema describing the tool's input. Required. + :vartype input_schema: ~azure.ai.projects.models.MCPListToolsToolInputSchema + :ivar annotations: + :vartype annotations: ~azure.ai.projects.models.MCPListToolsToolAnnotations + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the tool. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input_schema: "_models.MCPListToolsToolInputSchema" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The JSON schema describing the tool's input. Required.""" + annotations: Optional["_models.MCPListToolsToolAnnotations"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + name: str, + input_schema: "_models.MCPListToolsToolInputSchema", + description: Optional[str] = None, + annotations: Optional["_models.MCPListToolsToolAnnotations"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MCPListToolsToolAnnotations(_Model): + """MCPListToolsToolAnnotations.""" + + +class MCPListToolsToolInputSchema(_Model): + """MCPListToolsToolInputSchema.""" + + +class MCPTool(Tool, discriminator="mcp"): + """MCP tool. + + :ivar type: The type of the MCP tool. Always ``mcp``. Required. + :vartype type: str or ~azure.ai.projects.models.MCP + :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. + :vartype server_label: str + :ivar server_url: The URL for the MCP server. One of ``server_url`` or ``connector_id`` must be + provided. + :vartype server_url: str + :ivar connector_id: Identifier for service connectors, like those available in ChatGPT. One of + ``server_url`` or ``connector_id`` must be provided. Learn more about service + connectors `here + `_. + Currently supported ``connector_id`` values are: + + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal["connector_dropbox"], Literal["connector_gmail"], Literal["connector_googlecalendar"], + Literal["connector_googledrive"], Literal["connector_microsoftteams"], + Literal["connector_outlookcalendar"], Literal["connector_outlookemail"], + Literal["connector_sharepoint"] + :vartype connector_id: str or str or str or str or str or str or str or str + :ivar authorization: An OAuth access token that can be used with a remote MCP server, either + with a custom MCP server URL or a service connector. Your application + must handle the OAuth authorization flow and provide the token here. + :vartype authorization: str + :ivar server_description: Optional description of the MCP server, used to provide more context. + :vartype server_description: str + :ivar headers: + :vartype headers: dict[str, str] + :ivar allowed_tools: Is either a [str] type or a MCPToolFilter type. + :vartype allowed_tools: list[str] or ~azure.ai.projects.models.MCPToolFilter + :ivar require_approval: Is one of the following types: MCPToolRequireApproval, + Literal["always"], Literal["never"] + :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval or str or str + :ivar project_connection_id: The connection ID in the project for the MCP server. The + connection stores authentication and other connection details needed to connect to the MCP + server. + :vartype project_connection_id: str + """ + + type: Literal[ToolType.MCP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the MCP tool. Always ``mcp``. Required.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A label for this MCP server, used to identify it in tool calls. Required.""" + server_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The URL for the MCP server. One of ``server_url`` or ``connector_id`` must be + provided.""" + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for service connectors, like those available in ChatGPT. One of + ``server_url`` or ``connector_id`` must be provided. Learn more about service + connectors `here + `_. + Currently supported ``connector_id`` values are: + + * Dropbox: `connector_dropbox` + * Gmail: `connector_gmail` + * Google Calendar: `connector_googlecalendar` + * Google Drive: `connector_googledrive` + * Microsoft Teams: `connector_microsoftteams` + * Outlook Calendar: `connector_outlookcalendar` + * Outlook Email: `connector_outlookemail` + * SharePoint: `connector_sharepoint`. Is one of the following types: + Literal[\"connector_dropbox\"], Literal[\"connector_gmail\"], + Literal[\"connector_googlecalendar\"], Literal[\"connector_googledrive\"], + Literal[\"connector_microsoftteams\"], Literal[\"connector_outlookcalendar\"], + Literal[\"connector_outlookemail\"], Literal[\"connector_sharepoint\"]""" + authorization: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An OAuth access token that can be used with a remote MCP server, either + with a custom MCP server URL or a service connector. Your application + must handle the OAuth authorization flow and provide the token here.""" + server_description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional description of the MCP server, used to provide more context.""" + headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a [str] type or a MCPToolFilter type.""" + require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """Is one of the following types: MCPToolRequireApproval, Literal[\"always\"], Literal[\"never\"]""" + project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The connection ID in the project for the MCP server. The connection stores authentication and + other connection details needed to connect to the MCP server.""" + + @overload + def __init__( + self, + *, + server_label: str, + server_url: Optional[str] = None, + connector_id: Optional[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ] + ] = None, + authorization: Optional[str] = None, + server_description: Optional[str] = None, + headers: Optional[dict[str, str]] = None, + allowed_tools: Optional[Union[list[str], "_models.MCPToolFilter"]] = None, + require_approval: Optional[Union["_models.MCPToolRequireApproval", Literal["always"], Literal["never"]]] = None, + project_connection_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolType.MCP # type: ignore + + +class MCPToolFilter(_Model): + """MCP tool filter. + + :ivar tool_names: MCP allowed tools. + :vartype tool_names: list[str] + :ivar read_only: Indicates whether or not a tool modifies data or is read-only. If an + MCP server is `annotated with `readOnlyHint` + `_, + it will match this filter. + :vartype read_only: bool + """ + + tool_names: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """MCP allowed tools.""" + read_only: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates whether or not a tool modifies data or is read-only. If an + MCP server is `annotated with `readOnlyHint` + `_, + it will match this filter.""" + + @overload + def __init__( + self, + *, + tool_names: Optional[list[str]] = None, + read_only: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MCPToolRequireApproval(_Model): + """MCPToolRequireApproval. + + :ivar always: + :vartype always: ~azure.ai.projects.models.MCPToolFilter + :ivar never: + :vartype never: ~azure.ai.projects.models.MCPToolFilter + """ + + always: Optional["_models.MCPToolFilter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + never: Optional["_models.MCPToolFilter"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + always: Optional["_models.MCPToolFilter"] = None, + never: Optional["_models.MCPToolFilter"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MemoryOperation(_Model): + """Represents a single memory operation (create, update, or delete) performed on a memory item. + + :ivar kind: The type of memory operation being performed. Required. Known values are: "create", + "update", and "delete". + :vartype kind: str or ~azure.ai.projects.models.MemoryOperationKind + :ivar memory_item: The memory item to create, update, or delete. Required. + :vartype memory_item: ~azure.ai.projects.models.MemoryItem + """ + + kind: Union[str, "_models.MemoryOperationKind"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of memory operation being performed. Required. Known values are: \"create\", + \"update\", and \"delete\".""" + memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The memory item to create, update, or delete. Required.""" + + @overload + def __init__( + self, + *, + kind: Union[str, "_models.MemoryOperationKind"], + memory_item: "_models.MemoryItem", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MemorySearchItem(_Model): + """A retrieved memory item from memory search. + + :ivar memory_item: Retrieved memory item. Required. + :vartype memory_item: ~azure.ai.projects.models.MemoryItem + """ + + memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Retrieved memory item. Required.""" + + @overload + def __init__( + self, + *, + memory_item: "_models.MemoryItem", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MemorySearchOptions(_Model): + """Memory search options. + + :ivar max_memories: Maximum number of memory items to return. + :vartype max_memories: int + """ + + max_memories: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of memory items to return.""" + + @overload + def __init__( + self, + *, + max_memories: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MemorySearchTool(Tool, discriminator="memory_search"): + """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 memory_store_name: The name of the memory store to use. Required. + :vartype memory_store_name: str + :ivar scope: The namespace used to group and isolate memories, such as a user ID. + Limits which memories can be retrieved or updated. + Use special variable ``{{$userId}}`` to scope memories to the current signed-in user. Required. + :vartype scope: str + :ivar search_options: Options for searching the memory store. + :vartype search_options: ~azure.ai.projects.models.MemorySearchOptions + :ivar update_delay: Time to wait before updating memories after inactivity (seconds). Default + 300. + :vartype update_delay: int + """ + + type: Literal[ToolType.MEMORY_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the tool. Always ``memory_search``. Required.""" + memory_store_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the memory store to use. Required.""" + scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The namespace used to group and isolate memories, such as a user ID. + Limits which memories can be retrieved or updated. + Use special variable ``{{$userId}}`` to scope memories to the current signed-in user. Required.""" + search_options: Optional["_models.MemorySearchOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Options for searching the memory store.""" + update_delay: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Time to wait before updating memories after inactivity (seconds). Default 300.""" + + @overload + def __init__( + self, + *, + memory_store_name: str, + scope: str, + search_options: Optional["_models.MemorySearchOptions"] = None, + update_delay: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ToolType.MEMORY_SEARCH # type: ignore + + +class MemorySearchToolCallItemParam(Item, discriminator="memory_search_call"): + """MemorySearchToolCallItemParam. + + :ivar type: Required. + :vartype type: str or ~azure.ai.projects.models.MEMORY_SEARCH_CALL + :ivar results: The results returned from the memory search. + :vartype results: list[~azure.ai.projects.models.MemorySearchItem] + """ + + type: Literal[ItemType.MEMORY_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required.""" + results: Optional[list["_models.MemorySearchItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The results returned from the memory search.""" + + @overload + def __init__( + self, + *, + results: Optional[list["_models.MemorySearchItem"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = ItemType.MEMORY_SEARCH_CALL # 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. 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["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\"], + Literal[\"incomplete\"], Literal[\"failed\"]""" + results: Optional[list["_models.MemorySearchItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The results returned from the memory search.""" + + @overload + def __init__( + self, + *, + status: Literal["in_progress", "searching", "completed", "incomplete", "failed"], + created_by: Optional[Union["_models.CreatedBy", str]] = None, + results: Optional[list["_models.MemorySearchItem"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = "memory_search_call" # type: ignore + + +class MemoryStoreDefinition(_Model): + """Base definition for memory store configurations. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + MemoryStoreDefaultDefinition + + :ivar kind: The kind of the memory store. Required. "default" + :vartype kind: str or ~azure.ai.projects.models.MemoryStoreKind + """ + + __mapping__: dict[str, _Model] = {} + kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) + """The kind of the memory store. Required. \"default\"""" + + @overload + def __init__( + self, + *, + kind: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MemoryStoreDefaultDefinition(MemoryStoreDefinition, discriminator="default"): + """Default memory store implementation. + + :ivar kind: The kind of the memory store. Required. The default memory store implementation. + :vartype kind: str or ~azure.ai.projects.models.DEFAULT + :ivar chat_model: The name or identifier of the chat completion model deployment used for + memory processing. Required. + :vartype chat_model: str + :ivar embedding_model: The name or identifier of the embedding model deployment used for memory + processing. Required. + :vartype embedding_model: str + :ivar options: Default memory store options. + :vartype options: ~azure.ai.projects.models.MemoryStoreDefaultOptions + """ + + kind: Literal[MemoryStoreKind.DEFAULT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The kind of the memory store. Required. The default memory store implementation.""" + chat_model: str = rest_field(visibility=["read", "create"]) + """The name or identifier of the chat completion model deployment used for memory processing. + Required.""" + embedding_model: str = rest_field(visibility=["read", "create"]) + """The name or identifier of the embedding model deployment used for memory processing. Required.""" + options: Optional["_models.MemoryStoreDefaultOptions"] = rest_field(visibility=["read", "create"]) + """Default memory store options.""" + + @overload + def __init__( + self, + *, + chat_model: str, + embedding_model: str, + options: Optional["_models.MemoryStoreDefaultOptions"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.kind = MemoryStoreKind.DEFAULT # type: ignore + + +class MemoryStoreDefaultOptions(_Model): + """Default memory store configurations. + + :ivar user_profile_enabled: Whether to enable user profile extraction and storage. Default is + true. Required. + :vartype user_profile_enabled: bool + :ivar user_profile_details: Specific categories or types of user profile information to extract + and store. + :vartype user_profile_details: str + :ivar chat_summary_enabled: Whether to enable chat summary extraction and storage. Default is + true. Required. + :vartype chat_summary_enabled: bool + """ + + user_profile_enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable user profile extraction and storage. Default is true. Required.""" + user_profile_details: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specific categories or types of user profile information to extract and store.""" + chat_summary_enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable chat summary extraction and storage. Default is true. Required.""" + + @overload + def __init__( + self, + *, + user_profile_enabled: bool, + chat_summary_enabled: bool, + user_profile_details: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MemoryStoreDeleteScopeResult(_Model): + """Response for deleting memories from a scope. + + :ivar object: The object type. Always 'memory_store.scope.deleted'. Required. Default value is + "memory_store.scope.deleted". + :vartype object: str + :ivar name: The name of the memory store. Required. + :vartype name: str + :ivar scope: The scope from which memories were deleted. Required. + :vartype scope: str + :ivar deleted: Whether the deletion operation was successful. Required. + :vartype deleted: bool + """ + + object: Literal["memory_store.scope.deleted"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The object type. Always 'memory_store.scope.deleted'. Required. Default value is + \"memory_store.scope.deleted\".""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the memory store. Required.""" + scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The scope from which memories were deleted. Required.""" + deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the deletion operation was successful. Required.""" + + @overload + def __init__( + self, + *, + name: str, + scope: str, + deleted: bool, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.object: Literal["memory_store.scope.deleted"] = "memory_store.scope.deleted" + + +class MemoryStoreDetails(_Model): + """A memory store that can store and retrieve user memories. + + :ivar object: The object type, which is always 'memory_store'. Required. Default value is + "memory_store". + :vartype object: str + :ivar id: The unique identifier of the memory store. Required. + :vartype id: str + :ivar created_at: The Unix timestamp (seconds) when the memory store was created. Required. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The Unix timestamp (seconds) when the memory store was last updated. + Required. + :vartype updated_at: ~datetime.datetime + :ivar name: The name of the memory store. Required. + :vartype name: str + :ivar description: A human-readable description of the memory store. + :vartype description: str + :ivar metadata: Arbitrary key-value metadata to associate with the memory store. + :vartype metadata: dict[str, str] + :ivar definition: The definition of the memory store. Required. + :vartype definition: ~azure.ai.projects.models.MemoryStoreDefinition + """ + + object: Literal["memory_store"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The object type, which is always 'memory_store'. Required. Default value is \"memory_store\".""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the memory store. Required.""" + created_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (seconds) when the memory store was created. Required.""" + updated_at: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """The Unix timestamp (seconds) when the memory store was last updated. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the memory store. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A human-readable description of the memory store.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Arbitrary key-value metadata to associate with the memory store.""" + definition: "_models.MemoryStoreDefinition" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The definition of the memory store. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + created_at: datetime.datetime, + updated_at: datetime.datetime, + name: str, + definition: "_models.MemoryStoreDefinition", + description: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.object: Literal["memory_store"] = "memory_store" + + +class MemoryStoreOperationUsage(_Model): + """Usage statistics of a memory store operation. + + :ivar embedding_tokens: The number of embedding tokens. Required. + :vartype embedding_tokens: int + :ivar input_tokens: The number of input tokens. Required. + :vartype input_tokens: int + :ivar input_tokens_details: A detailed breakdown of the input tokens. Required. + :vartype input_tokens_details: ~azure.ai.projects.models.ResponseUsageInputTokensDetails + :ivar output_tokens: The number of output tokens. Required. + :vartype output_tokens: int + :ivar output_tokens_details: A detailed breakdown of the output tokens. Required. + :vartype output_tokens_details: ~azure.ai.projects.models.ResponseUsageOutputTokensDetails + :ivar total_tokens: The total number of tokens used. Required. + :vartype total_tokens: int + """ + + embedding_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of embedding tokens. Required.""" + input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of input tokens. Required.""" + input_tokens_details: "_models.ResponseUsageInputTokensDetails" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A detailed breakdown of the input tokens. Required.""" + output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of output tokens. Required.""" + output_tokens_details: "_models.ResponseUsageOutputTokensDetails" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A detailed breakdown of the output tokens. Required.""" + total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The total number of tokens used. Required.""" + + @overload + def __init__( + self, + *, + embedding_tokens: int, + input_tokens: int, + input_tokens_details: "_models.ResponseUsageInputTokensDetails", + output_tokens: int, + output_tokens_details: "_models.ResponseUsageOutputTokensDetails", + total_tokens: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MemoryStoreSearchResult(_Model): + """Memory search response. + + :ivar search_id: The unique ID of this search request. Use this value as previous_search_id in + subsequent requests to perform incremental searches. Required. + :vartype search_id: str + :ivar memories: Related memory items found during the search operation. Required. + :vartype memories: list[~azure.ai.projects.models.MemorySearchItem] + :ivar usage: Usage statistics associated with the memory search operation. Required. + :vartype usage: ~azure.ai.projects.models.MemoryStoreOperationUsage + """ + + search_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of this search request. Use this value as previous_search_id in subsequent + requests to perform incremental searches. Required.""" + memories: list["_models.MemorySearchItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Related memory items found during the search operation. Required.""" + usage: "_models.MemoryStoreOperationUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Usage statistics associated with the memory search operation. Required.""" + + @overload + def __init__( + self, + *, + search_id: str, + memories: list["_models.MemorySearchItem"], + usage: "_models.MemoryStoreOperationUsage", ) -> None: ... @overload @@ -7471,44 +10757,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.MCP_APPROVAL_RESPONSE # type: ignore -class MCPApprovalResponseItemResource(ItemResource, discriminator="mcp_approval_response"): - """A response to an MCP approval request. +class MemoryStoreUpdateCompletedResult(_Model): + """Memory update result. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.MCP_APPROVAL_RESPONSE - :ivar approval_request_id: The ID of the approval request being answered. Required. - :vartype approval_request_id: str - :ivar approve: Whether the request was approved. Required. - :vartype approve: bool - :ivar reason: Optional reason for the decision. - :vartype reason: str + :ivar memory_operations: A list of individual memory operations that were performed during the + update. Required. + :vartype memory_operations: list[~azure.ai.projects.models.MemoryOperation] + :ivar usage: Usage statistics associated with the memory update operation. Required. + :vartype usage: ~azure.ai.projects.models.MemoryStoreOperationUsage """ - type: Literal[ItemType.MCP_APPROVAL_RESPONSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - approval_request_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the approval request being answered. Required.""" - approve: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the request was approved. Required.""" - reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional reason for the decision.""" + memory_operations: list["_models.MemoryOperation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A list of individual memory operations that were performed during the update. Required.""" + usage: "_models.MemoryStoreOperationUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Usage statistics associated with the memory update operation. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - approval_request_id: str, - approve: bool, - created_by: Optional["_models.CreatedBy"] = None, - reason: Optional[str] = None, + memory_operations: list["_models.MemoryOperation"], + usage: "_models.MemoryStoreOperationUsage", ) -> None: ... @overload @@ -7520,48 +10793,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.MCP_APPROVAL_RESPONSE # type: ignore -class MCPCallItemParam(ItemParam, discriminator="mcp_call"): - """An invocation of a tool on an MCP server. +class MemoryStoreUpdateResult(_Model): + """Provides the status of a memory store update operation. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.MCP_CALL - :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: The output from the tool call. - :vartype output: str - :ivar error: The error from the tool call, if any. - :vartype error: str + :ivar update_id: The unique ID of this update request. Use this value as previous_update_id in + subsequent requests to perform incremental updates. Required. + :vartype update_id: str + :ivar status: The status of the memory update operation. One of "queued", "in_progress", + "completed", "failed", or "superseded". Required. Known values are: "queued", "in_progress", + "completed", "failed", and "superseded". + :vartype status: str or ~azure.ai.projects.models.MemoryStoreUpdateStatus + :ivar superseded_by: The update_id the operation was superseded by when status is "superseded". + :vartype superseded_by: str + :ivar result: The result of memory store update operation when status is "completed". + :vartype result: ~azure.ai.projects.models.MemoryStoreUpdateCompletedResult + :ivar error: Error object that describes the error when status is "failed". + :vartype error: ~azure.ai.projects.models.Error """ - type: Literal[ItemType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """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"]) - """The output from the tool call.""" - error: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The error from the tool call, if any.""" + update_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of this update request. Use this value as previous_update_id in subsequent + requests to perform incremental updates. Required.""" + status: Union[str, "_models.MemoryStoreUpdateStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the memory update operation. One of \"queued\", \"in_progress\", \"completed\", + \"failed\", or \"superseded\". Required. Known values are: \"queued\", \"in_progress\", + \"completed\", \"failed\", and \"superseded\".""" + superseded_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The update_id the operation was superseded by when status is \"superseded\".""" + result: Optional["_models.MemoryStoreUpdateCompletedResult"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The result of memory store update operation when status is \"completed\".""" + error: Optional["_models.Error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Error object that describes the error when status is \"failed\".""" @overload def __init__( self, *, - server_label: str, - name: str, - arguments: str, - output: Optional[str] = None, - error: Optional[str] = None, + update_id: str, + status: Union[str, "_models.MemoryStoreUpdateStatus"], + superseded_by: Optional[str] = None, + result: Optional["_models.MemoryStoreUpdateCompletedResult"] = None, + error: Optional["_models.Error"] = None, ) -> None: ... @overload @@ -7573,54 +10851,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.MCP_CALL # type: ignore -class MCPCallItemResource(ItemResource, discriminator="mcp_call"): - """An invocation of a tool on an MCP server. +class Metadata(_Model): + """Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.MCP_CALL - :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: The output from the tool call. - :vartype output: str - :ivar error: The error from the tool call, if any. - :vartype error: str """ - type: Literal[ItemType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """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"]) - """The output from the tool call.""" - error: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The error from the tool call, if any.""" + +class MicrosoftFabricAgentTool(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'. Required. + :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'. Required.""" + fabric_dataagent_preview: "_models.FabricDataAgentToolParameters" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The fabric data agent tool parameters. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - server_label: str, - name: str, - arguments: str, - created_by: Optional["_models.CreatedBy"] = None, - output: Optional[str] = None, - error: Optional[str] = None, + fabric_dataagent_preview: "_models.FabricDataAgentToolParameters", ) -> None: ... @overload @@ -7632,38 +10895,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.MCP_CALL # type: ignore + self.type = ToolType.FABRIC_DATAAGENT_PREVIEW # type: ignore -class MCPListToolsItemParam(ItemParam, discriminator="mcp_list_tools"): - """A list of tools available on an MCP server. +class ModelDeployment(Deployment, discriminator="ModelDeployment"): + """Model Deployment Definition. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS - :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: Error message if the server could not list tools. - :vartype error: str + :ivar name: Name of the deployment. Required. + :vartype name: str + :ivar type: The type of the deployment. Required. Model deployment + :vartype type: str or ~azure.ai.projects.models.MODEL_DEPLOYMENT + :ivar model_name: Publisher-specific name of the deployed model. Required. + :vartype model_name: str + :ivar model_version: Publisher-specific version of the deployed model. Required. + :vartype model_version: str + :ivar model_publisher: Name of the deployed model's publisher. Required. + :vartype model_publisher: str + :ivar capabilities: Capabilities of deployed model. Required. + :vartype capabilities: dict[str, str] + :ivar sku: Sku of the model deployment. Required. + :vartype sku: ~azure.ai.projects.models.ModelDeploymentSku + :ivar connection_name: Name of the connection the deployment comes from. + :vartype connection_name: str """ - type: Literal[ItemType.MCP_LIST_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """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"]) - """Error message if the server could not list tools.""" + type: Literal[DeploymentType.MODEL_DEPLOYMENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the deployment. Required. Model deployment""" + model_name: str = rest_field(name="modelName", visibility=["read"]) + """Publisher-specific name of the deployed model. Required.""" + model_version: str = rest_field(name="modelVersion", visibility=["read"]) + """Publisher-specific version of the deployed model. Required.""" + model_publisher: str = rest_field(name="modelPublisher", visibility=["read"]) + """Name of the deployed model's publisher. Required.""" + capabilities: dict[str, str] = rest_field(visibility=["read"]) + """Capabilities of deployed model. Required.""" + sku: "_models.ModelDeploymentSku" = rest_field(visibility=["read"]) + """Sku of the model deployment. Required.""" + connection_name: Optional[str] = rest_field(name="connectionName", visibility=["read"]) + """Name of the connection the deployment comes from.""" @overload def __init__( self, - *, - server_label: str, - tools: list["_models.MCPListToolsTool"], - error: Optional[str] = None, ) -> None: ... @overload @@ -7675,44 +10948,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.MCP_LIST_TOOLS # type: ignore + self.type = DeploymentType.MODEL_DEPLOYMENT # type: ignore -class MCPListToolsItemResource(ItemResource, discriminator="mcp_list_tools"): - """A list of tools available on an MCP server. +class ModelDeploymentSku(_Model): + """Sku information. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.MCP_LIST_TOOLS - :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: Error message if the server could not list tools. - :vartype error: str + :ivar capacity: Sku capacity. Required. + :vartype capacity: int + :ivar family: Sku family. Required. + :vartype family: str + :ivar name: Sku name. Required. + :vartype name: str + :ivar size: Sku size. Required. + :vartype size: str + :ivar tier: Sku tier. Required. + :vartype tier: str """ - type: Literal[ItemType.MCP_LIST_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """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"]) - """Error message if the server could not list tools.""" + capacity: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sku capacity. Required.""" + family: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sku family. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sku name. Required.""" + size: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sku size. Required.""" + tier: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sku tier. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - server_label: str, - tools: list["_models.MCPListToolsTool"], - created_by: Optional["_models.CreatedBy"] = None, - error: Optional[str] = None, + capacity: int, + family: str, + name: str, + size: str, + tier: str, ) -> None: ... @overload @@ -7724,39 +10997,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.MCP_LIST_TOOLS # type: ignore -class MCPListToolsTool(_Model): - """A tool available on an MCP server. +class MonthlyRecurrenceSchedule(RecurrenceSchedule, discriminator="Monthly"): + """Monthly recurrence schedule. - :ivar name: The name of the tool. Required. - :vartype name: str - :ivar description: The description of the tool. - :vartype description: str - :ivar input_schema: The JSON schema describing the tool's input. Required. - :vartype input_schema: any - :ivar annotations: Additional annotations about the tool. - :vartype annotations: any + :ivar type: Monthly recurrence type. Required. Monthly recurrence pattern. + :vartype type: str or ~azure.ai.projects.models.MONTHLY + :ivar days_of_month: Days of the month for the recurrence schedule. Required. + :vartype days_of_month: list[int] """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the tool. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description of the tool.""" - input_schema: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The JSON schema describing the tool's input. Required.""" - annotations: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Additional annotations about the tool.""" + type: Literal[RecurrenceType.MONTHLY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Monthly recurrence type. Required. Monthly recurrence pattern.""" + days_of_month: list[int] = rest_field( + name="daysOfMonth", visibility=["read", "create", "update", "delete", "query"] + ) + """Days of the month for the recurrence schedule. Required.""" @overload def __init__( self, *, - name: str, - input_schema: Any, - description: Optional[str] = None, - annotations: Optional[Any] = None, + days_of_month: list[int], ) -> None: ... @overload @@ -7768,69 +11031,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RecurrenceType.MONTHLY # type: ignore -class MCPTool(Tool, discriminator="mcp"): - """Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. `Learn more about MCP - `_. +class Move(ComputerAction, discriminator="move"): + """Move. - :ivar type: The type of the MCP tool. Always ``mcp``. Required. - :vartype type: str or ~azure.ai.projects.models.MCP - :ivar server_label: A label for this MCP server, used to identify it in tool calls. Required. - :vartype server_label: str - :ivar server_url: The URL for the MCP server. Required. - :vartype server_url: str - :ivar headers: Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. - :vartype headers: dict[str, str] - :ivar allowed_tools: List of allowed tool names or a filter object. Is either a [str] type or a - MCPToolAllowedTools1 type. - :vartype allowed_tools: list[str] or ~azure.ai.projects.models.MCPToolAllowedTools1 - :ivar require_approval: Specify which of the MCP server's tools require approval. Is one of the - following types: MCPToolRequireApproval1, Literal["always"], Literal["never"] - :vartype require_approval: ~azure.ai.projects.models.MCPToolRequireApproval1 or str or str - :ivar project_connection_id: The connection ID in the project for the MCP server. The - connection stores authentication and other connection details needed to connect to the MCP - server. - :vartype project_connection_id: str + :ivar type: Specifies the event type. For a move action, this property is + always set to ``move``. Required. + :vartype type: str or ~azure.ai.projects.models.MOVE + :ivar x: The x-coordinate to move to. Required. + :vartype x: int + :ivar y: The y-coordinate to move to. Required. + :vartype y: int """ - 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.""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A label for this MCP server, used to identify it in tool calls. Required.""" - server_url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The URL for the MCP server. Required.""" - headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes.""" - allowed_tools: Optional[Union[list[str], "_models.MCPToolAllowedTools1"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """List of allowed tool names or a filter object. Is either a [str] type or a MCPToolAllowedTools1 - type.""" - require_approval: Optional[Union["_models.MCPToolRequireApproval1", Literal["always"], Literal["never"]]] = ( - rest_field(visibility=["read", "create", "update", "delete", "query"]) - ) - """Specify which of the MCP server's tools require approval. Is one of the following types: - MCPToolRequireApproval1, Literal[\"always\"], Literal[\"never\"]""" - project_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The connection ID in the project for the MCP server. The connection stores authentication and - other connection details needed to connect to the MCP server.""" + type: Literal[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.""" + 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"]) + """The y-coordinate to move to. Required.""" @overload def __init__( self, *, - server_label: str, - server_url: str, - headers: Optional[dict[str, str]] = None, - allowed_tools: Optional[Union[list[str], "_models.MCPToolAllowedTools1"]] = None, - require_approval: Optional[ - Union["_models.MCPToolRequireApproval1", Literal["always"], Literal["never"]] - ] = None, - project_connection_id: Optional[str] = None, + x: int, + y: int, ) -> None: ... @overload @@ -7842,24 +11071,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.MCP # type: ignore + self.type = ComputerActionType.MOVE # type: ignore -class MCPToolAllowedTools1(_Model): - """MCPToolAllowedTools1. +class NoAuthenticationCredentials(BaseCredentials, discriminator="None"): + """Credentials that do not require authentication. - :ivar tool_names: List of allowed tool names. - :vartype tool_names: list[str] + :ivar type: The credential type. Required. No credential + :vartype type: str or ~azure.ai.projects.models.NONE """ - tool_names: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of allowed tool names.""" + type: Literal[CredentialType.NONE] = rest_discriminator(name="type", visibility=["read"]) # type: ignore + """The credential type. Required. No credential""" @overload def __init__( self, - *, - tool_names: Optional[list[str]] = None, ) -> None: ... @overload @@ -7871,32 +11098,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = CredentialType.NONE # type: ignore -class MCPToolRequireApproval1(_Model): - """MCPToolRequireApproval1. +class OAuthConsentRequestItemResource(ItemResource, discriminator="oauth_consent_request"): + """Request from the service for the user to perform OAuth consent. - :ivar always: A list of tools that always require approval. - :vartype always: ~azure.ai.projects.models.MCPToolRequireApprovalAlways - :ivar never: A list of tools that never require approval. - :vartype never: ~azure.ai.projects.models.MCPToolRequireApprovalNever + :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: Required. + :vartype id: str + :ivar type: Required. Default value is "oauth_consent_request". + :vartype type: str + :ivar consent_link: The link the user can use to perform OAuth consent. Required. + :vartype consent_link: str + :ivar server_label: The server label for the OAuth consent request. Required. + :vartype server_label: str """ - always: Optional["_models.MCPToolRequireApprovalAlways"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A list of tools that always require approval.""" - never: Optional["_models.MCPToolRequireApprovalNever"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A list of tools that never require approval.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + type: Literal["oauth_consent_request"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"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"]) + """The server label for the OAuth consent request. Required.""" @overload def __init__( self, *, - always: Optional["_models.MCPToolRequireApprovalAlways"] = None, - never: Optional["_models.MCPToolRequireApprovalNever"] = None, + id: str, # pylint: disable=redefined-builtin + consent_link: str, + server_label: str, + created_by: Optional[Union["_models.CreatedBy", str]] = None, ) -> None: ... @overload @@ -7908,23 +11145,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "oauth_consent_request" # type: ignore -class MCPToolRequireApprovalAlways(_Model): - """MCPToolRequireApprovalAlways. +class OneTimeTrigger(Trigger, discriminator="OneTime"): + """One-time trigger. - :ivar tool_names: List of tools that require approval. - :vartype tool_names: list[str] + :ivar type: Required. One-time trigger. + :vartype type: str or ~azure.ai.projects.models.ONE_TIME + :ivar trigger_at: Date and time for the one-time trigger in ISO 8601 format. Required. + :vartype trigger_at: str + :ivar time_zone: Time zone for the one-time trigger. + :vartype time_zone: str """ - tool_names: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of tools that require approval.""" + type: Literal[TriggerType.ONE_TIME] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. One-time trigger.""" + trigger_at: str = rest_field(name="triggerAt", visibility=["read", "create", "update", "delete", "query"]) + """Date and time for the one-time trigger in ISO 8601 format. Required.""" + time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) + """Time zone for the one-time trigger.""" @overload def __init__( self, *, - tool_names: Optional[list[str]] = None, + trigger_at: str, + time_zone: Optional[str] = None, ) -> None: ... @overload @@ -7936,23 +11183,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = TriggerType.ONE_TIME # type: ignore -class MCPToolRequireApprovalNever(_Model): - """MCPToolRequireApprovalNever. +class OpenApiAgentTool(Tool, discriminator="openapi"): + """The input definition information for an OpenAPI tool as used to configure an agent. - :ivar tool_names: List of tools that do not require approval. - :vartype tool_names: list[str] + :ivar type: The object type, which is always 'openapi'. Required. + :vartype type: str or ~azure.ai.projects.models.OPENAPI + :ivar openapi: The openapi function definition. Required. + :vartype openapi: ~azure.ai.projects.models.OpenApiFunctionDefinition """ - tool_names: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of tools that do not require approval.""" + type: Literal[ToolType.OPENAPI] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'openapi'. Required.""" + openapi: "_models.OpenApiFunctionDefinition" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The openapi function definition. Required.""" @overload def __init__( self, *, - tool_names: Optional[list[str]] = None, + openapi: "_models.OpenApiFunctionDefinition", ) -> None: ... @overload @@ -7964,32 +11218,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolType.OPENAPI # type: ignore -class MemoryOperation(_Model): - """Represents a single memory operation (create, update, or delete) performed on a memory item. +class OpenApiAuthDetails(_Model): + """authentication details for OpenApiFunctionDefinition. - :ivar kind: The type of memory operation being performed. Required. Known values are: "create", - "update", and "delete". - :vartype kind: str or ~azure.ai.projects.models.MemoryOperationKind - :ivar memory_item: The memory item to create, update, or delete. Required. - :vartype memory_item: ~azure.ai.projects.models.MemoryItem + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + OpenApiAnonymousAuthDetails, OpenApiManagedAuthDetails, OpenApiProjectConnectionAuthDetails + + :ivar type: The type of authentication, must be anonymous/project_connection/managed_identity. + Required. Known values are: "anonymous", "project_connection", and "managed_identity". + :vartype type: str or ~azure.ai.projects.models.OpenApiAuthType """ - kind: Union[str, "_models.MemoryOperationKind"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The type of memory operation being performed. Required. Known values are: \"create\", - \"update\", and \"delete\".""" - memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The memory item to create, update, or delete. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of authentication, must be anonymous/project_connection/managed_identity. Required. + Known values are: \"anonymous\", \"project_connection\", and \"managed_identity\".""" @overload def __init__( self, *, - kind: Union[str, "_models.MemoryOperationKind"], - memory_item: "_models.MemoryItem", + type: str, ) -> None: ... @overload @@ -8003,21 +11255,19 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemorySearchItem(_Model): - """A retrieved memory item from memory search. +class OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator="anonymous"): + """Security details for OpenApi anonymous authentication. - :ivar memory_item: Retrieved memory item. Required. - :vartype memory_item: ~azure.ai.projects.models.MemoryItem + :ivar type: The object type, which is always 'anonymous'. Required. + :vartype type: str or ~azure.ai.projects.models.ANONYMOUS """ - memory_item: "_models.MemoryItem" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Retrieved memory item. Required.""" + type: Literal[OpenApiAuthType.ANONYMOUS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'anonymous'. Required.""" @overload def __init__( self, - *, - memory_item: "_models.MemoryItem", ) -> None: ... @overload @@ -8029,23 +11279,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = OpenApiAuthType.ANONYMOUS # type: ignore -class MemorySearchOptions(_Model): - """Memory search options. +class OpenApiFunctionDefinition(_Model): + """The input definition information for an openapi function. - :ivar max_memories: Maximum number of memory items to return. - :vartype max_memories: int + :ivar name: The name of the function to be called. Required. + :vartype name: str + :ivar description: A description of what the function does, used by the model to choose when + and how to call the function. + :vartype description: str + :ivar spec: The openapi function shape, described as a JSON Schema object. Required. + :vartype spec: any + :ivar auth: Open API authentication details. Required. + :vartype auth: ~azure.ai.projects.models.OpenApiAuthDetails + :ivar default_params: List of OpenAPI spec parameters that will use user-provided defaults. + :vartype default_params: list[str] + :ivar functions: List of function definitions used by OpenApi tool. + :vartype functions: list[~azure.ai.projects.models.OpenApiFunctionDefinitionFunction] """ - max_memories: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of memory items to return.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function to be called. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of what the function does, used by the model to choose when and how to call the + function.""" + spec: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The openapi function shape, described as a JSON Schema object. Required.""" + auth: "_models.OpenApiAuthDetails" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Open API authentication details. Required.""" + default_params: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of OpenAPI spec parameters that will use user-provided defaults.""" + functions: Optional[list["_models.OpenApiFunctionDefinitionFunction"]] = rest_field(visibility=["read"]) + """List of function definitions used by OpenApi tool.""" @overload def __init__( self, *, - max_memories: Optional[int] = None, + name: str, + spec: Any, + auth: "_models.OpenApiAuthDetails", + description: Optional[str] = None, + default_params: Optional[list[str]] = None, ) -> None: ... @overload @@ -8059,47 +11336,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemorySearchTool(Tool, discriminator="memory_search"): - """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 memory_store_name: The name of the memory store to use. Required. - :vartype memory_store_name: str - :ivar scope: The namespace used to group and isolate memories, such as a user ID. - Limits which memories can be retrieved or updated. - Use special variable ``{{$userId}}`` to scope memories to the current signed-in user. Required. - :vartype scope: str - :ivar search_options: Options for searching the memory store. - :vartype search_options: ~azure.ai.projects.models.MemorySearchOptions - :ivar update_delay: Time to wait before updating memories after inactivity (seconds). Default - 300. - :vartype update_delay: int - """ +class OpenApiFunctionDefinitionFunction(_Model): + """OpenApiFunctionDefinitionFunction. - 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.""" - memory_store_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the memory store to use. Required.""" - scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The namespace used to group and isolate memories, such as a user ID. - Limits which memories can be retrieved or updated. - Use special variable ``{{$userId}}`` to scope memories to the current signed-in user. Required.""" - search_options: Optional["_models.MemorySearchOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Options for searching the memory store.""" - update_delay: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Time to wait before updating memories after inactivity (seconds). Default 300.""" + :ivar name: The name of the function to be called. Required. + :vartype name: str + :ivar description: A description of what the function does, used by the model to choose when + and how to call the function. + :vartype description: str + :ivar parameters: The parameters the functions accepts, described as a JSON Schema object. + Required. + :vartype parameters: any + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function to be called. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of what the function does, used by the model to choose when and how to call the + function.""" + parameters: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The parameters the functions accepts, described as a JSON Schema object. Required.""" @overload def __init__( self, *, - memory_store_name: str, - scope: str, - search_options: Optional["_models.MemorySearchOptions"] = None, - update_delay: Optional[int] = None, + name: str, + parameters: Any, + description: Optional[str] = None, ) -> None: ... @overload @@ -8111,30 +11375,29 @@ 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 -class MemorySearchToolCallItemParam(ItemParam, discriminator="memory_search_call"): - """MemorySearchToolCallItemParam. +class OpenApiManagedAuthDetails(OpenApiAuthDetails, discriminator="managed_identity"): + """Security details for OpenApi managed_identity authentication. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.MEMORY_SEARCH_CALL - :ivar results: The results returned from the memory search. - :vartype results: list[~azure.ai.projects.models.MemorySearchItem] + :ivar type: The object type, which is always 'managed_identity'. Required. + :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[ItemType.MEMORY_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - results: Optional[list["_models.MemorySearchItem"]] = rest_field( + 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.""" + security_scheme: "_models.OpenApiManagedSecurityScheme" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The results returned from the memory search.""" + """Connection auth security details. Required.""" @overload def __init__( self, *, - results: Optional[list["_models.MemorySearchItem"]] = None, + security_scheme: "_models.OpenApiManagedSecurityScheme", ) -> None: ... @overload @@ -8146,49 +11409,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.MEMORY_SEARCH_CALL # type: ignore + self.type = OpenApiAuthType.MANAGED_IDENTITY # type: ignore -class MemorySearchToolCallItemResource(ItemResource, discriminator="memory_search_call"): - """MemorySearchToolCallItemResource. +class OpenApiManagedSecurityScheme(_Model): + """Security scheme for OpenApi managed_identity authentication. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :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"] - :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] + :ivar audience: Authentication scope for managed_identity auth type. Required. + :vartype audience: str """ - type: Literal[ItemType.MEMORY_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - 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\"], - Literal[\"incomplete\"], Literal[\"failed\"]""" - results: Optional[list["_models.MemorySearchItem"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The results returned from the memory search.""" + audience: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Authentication scope for managed_identity auth type. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - status: Literal["in_progress", "searching", "completed", "incomplete", "failed"], - created_by: Optional["_models.CreatedBy"] = None, - results: Optional[list["_models.MemorySearchItem"]] = None, + audience: str, ) -> None: ... @overload @@ -8200,28 +11438,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.MEMORY_SEARCH_CALL # type: ignore - -class MemoryStoreDefinition(_Model): - """Base definition for memory store configurations. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - MemoryStoreDefaultDefinition +class OpenApiProjectConnectionAuthDetails(OpenApiAuthDetails, discriminator="project_connection"): + """Security details for OpenApi project connection authentication. - :ivar kind: The kind of the memory store. Required. "default" - :vartype kind: str or ~azure.ai.projects.models.MemoryStoreKind + :ivar type: The object type, which is always 'project_connection'. Required. + :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 """ - __mapping__: dict[str, _Model] = {} - kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) - """The kind of the memory store. Required. \"default\"""" + type: Literal[OpenApiAuthType.PROJECT_CONNECTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The object type, which is always 'project_connection'. Required.""" + security_scheme: "_models.OpenApiProjectConnectionSecurityScheme" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Project connection auth security details. Required.""" @overload def __init__( self, *, - kind: str, + security_scheme: "_models.OpenApiProjectConnectionSecurityScheme", ) -> None: ... @overload @@ -8233,40 +11472,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = OpenApiAuthType.PROJECT_CONNECTION # type: ignore -class MemoryStoreDefaultDefinition(MemoryStoreDefinition, discriminator="default"): - """Default memory store implementation. +class OpenApiProjectConnectionSecurityScheme(_Model): + """Security scheme for OpenApi managed_identity authentication. - :ivar kind: The kind of the memory store. Required. The default memory store implementation. - :vartype kind: str or ~azure.ai.projects.models.DEFAULT - :ivar chat_model: The name or identifier of the chat completion model deployment used for - memory processing. Required. - :vartype chat_model: str - :ivar embedding_model: The name or identifier of the embedding model deployment used for memory - processing. Required. - :vartype embedding_model: str - :ivar options: Default memory store options. - :vartype options: ~azure.ai.projects.models.MemoryStoreDefaultOptions + :ivar project_connection_id: Project connection id for Project Connection auth type. Required. + :vartype project_connection_id: str """ - kind: Literal[MemoryStoreKind.DEFAULT] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The kind of the memory store. Required. The default memory store implementation.""" - chat_model: str = rest_field(visibility=["read", "create"]) - """The name or identifier of the chat completion model deployment used for memory processing. - Required.""" - embedding_model: str = rest_field(visibility=["read", "create"]) - """The name or identifier of the embedding model deployment used for memory processing. Required.""" - options: Optional["_models.MemoryStoreDefaultOptions"] = rest_field(visibility=["read", "create"]) - """Default memory store options.""" + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Project connection id for Project Connection auth type. Required.""" @overload def __init__( self, *, - chat_model: str, - embedding_model: str, - options: Optional["_models.MemoryStoreDefaultOptions"] = None, + project_connection_id: str, ) -> None: ... @overload @@ -8278,37 +11501,27 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.kind = MemoryStoreKind.DEFAULT # type: ignore -class MemoryStoreDefaultOptions(_Model): - """Default memory store configurations. +class OutputContent(_Model): + """OutputContent. - :ivar user_profile_enabled: Whether to enable user profile extraction and storage. Default is - true. Required. - :vartype user_profile_enabled: bool - :ivar user_profile_details: Specific categories or types of user profile information to extract - and store. - :vartype user_profile_details: str - :ivar chat_summary_enabled: Whether to enable chat summary extraction and storage. Default is - true. Required. - :vartype chat_summary_enabled: bool + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + OutputContentOutputTextContent, ReasoningTextContent, OutputContentRefusalContent + + :ivar type: Required. Known values are: "output_text", "refusal", and "reasoning_text". + :vartype type: str or ~azure.ai.projects.models.OutputContentType """ - user_profile_enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to enable user profile extraction and storage. Default is true. Required.""" - user_profile_details: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Specific categories or types of user profile information to extract and store.""" - chat_summary_enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to enable chat summary extraction and storage. Default is true. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"output_text\", \"refusal\", and \"reasoning_text\".""" @overload def __init__( self, *, - user_profile_enabled: bool, - chat_summary_enabled: bool, - user_profile_details: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -8322,39 +11535,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreDeleteScopeResult(_Model): - """Response for deleting memories from a scope. +class OutputContentOutputTextContent(OutputContent, discriminator="output_text"): + """Output text. - :ivar object: The object type. Always 'memory_store.scope.deleted'. Required. Default value is - "memory_store.scope.deleted". - :vartype object: str - :ivar name: The name of the memory store. Required. - :vartype name: str - :ivar scope: The scope from which memories were deleted. Required. - :vartype scope: str - :ivar deleted: Whether the deletion operation was successful. Required. - :vartype deleted: bool + :ivar type: The type of the output text. Always ``output_text``. Required. + :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] """ - object: Literal["memory_store.scope.deleted"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type. Always 'memory_store.scope.deleted'. Required. Default value is - \"memory_store.scope.deleted\".""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the memory store. Required.""" - scope: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The scope from which memories were deleted. Required.""" - deleted: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the deletion operation was successful. Required.""" + type: Literal[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.""" + 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, *, - name: str, - scope: str, - deleted: bool, + text: str, + annotations: list["_models.Annotation"], + logprobs: Optional[list["_models.LogProb"]] = None, ) -> None: ... @overload @@ -8366,64 +11574,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.object: Literal["memory_store.scope.deleted"] = "memory_store.scope.deleted" + self.type = OutputContentType.OUTPUT_TEXT # type: ignore -class MemoryStoreDetails(_Model): - """A memory store that can store and retrieve user memories. +class OutputContentRefusalContent(OutputContent, discriminator="refusal"): + """Refusal. - :ivar object: The object type, which is always 'memory_store'. Required. Default value is - "memory_store". - :vartype object: str - :ivar id: The unique identifier of the memory store. Required. - :vartype id: str - :ivar created_at: The Unix timestamp (seconds) when the memory store was created. Required. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The Unix timestamp (seconds) when the memory store was last updated. - Required. - :vartype updated_at: ~datetime.datetime - :ivar name: The name of the memory store. Required. - :vartype name: str - :ivar description: A human-readable description of the memory store. - :vartype description: str - :ivar metadata: Arbitrary key-value metadata to associate with the memory store. - :vartype metadata: dict[str, str] - :ivar definition: The definition of the memory store. Required. - :vartype definition: ~azure.ai.projects.models.MemoryStoreDefinition + :ivar type: The type of the refusal. Always ``refusal``. Required. + :vartype type: str or ~azure.ai.projects.models.REFUSAL + :ivar refusal: The refusal explanation from the model. Required. + :vartype refusal: str """ - object: Literal["memory_store"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The object type, which is always 'memory_store'. Required. Default value is \"memory_store\".""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the memory store. Required.""" - created_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the memory store was created. Required.""" - updated_at: datetime.datetime = rest_field( - visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" - ) - """The Unix timestamp (seconds) when the memory store was last updated. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the memory store. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable description of the memory store.""" - metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Arbitrary key-value metadata to associate with the memory store.""" - definition: "_models.MemoryStoreDefinition" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The definition of the memory store. Required.""" + 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: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The refusal explanation from the model. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - created_at: datetime.datetime, - updated_at: datetime.datetime, - name: str, - definition: "_models.MemoryStoreDefinition", - description: Optional[str] = None, - metadata: Optional[dict[str, str]] = None, + refusal: str, ) -> None: ... @overload @@ -8435,55 +11607,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.object: Literal["memory_store"] = "memory_store" + self.type = OutputContentType.REFUSAL # type: ignore -class MemoryStoreOperationUsage(_Model): - """Usage statistics of a memory store operation. +class OutputItem(_Model): + """OutputItem. - :ivar embedding_tokens: The number of embedding tokens. Required. - :vartype embedding_tokens: int - :ivar input_tokens: The number of input tokens. Required. - :vartype input_tokens: int - :ivar input_tokens_details: A detailed breakdown of the input tokens. Required. - :vartype input_tokens_details: - ~azure.ai.projects.models.MemoryStoreOperationUsageInputTokensDetails - :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.MemoryStoreOperationUsageOutputTokensDetails - :ivar total_tokens: The total number of tokens used. Required. - :vartype total_tokens: int + 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, OutputItemOutputMessage, + OutputItemReasoningItem, OutputItemFunctionShellCall, OutputItemFunctionShellCallOutput, + OutputItemWebSearchToolCall + + :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", and "custom_tool_call". + :vartype type: str or ~azure.ai.projects.models.OutputItemType """ - embedding_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of embedding tokens. Required.""" - input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of input tokens. Required.""" - input_tokens_details: "_models.MemoryStoreOperationUsageInputTokensDetails" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A detailed breakdown of the input tokens. Required.""" - output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of output tokens. Required.""" - output_tokens_details: "_models.MemoryStoreOperationUsageOutputTokensDetails" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A detailed breakdown of the output tokens. Required.""" - total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The total number of tokens used. Required.""" + __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\", and \"custom_tool_call\".""" @overload def __init__( self, *, - embedding_tokens: int, - input_tokens: int, - input_tokens_details: "_models.MemoryStoreOperationUsageInputTokensDetails", - output_tokens: int, - output_tokens_details: "_models.MemoryStoreOperationUsageOutputTokensDetails", - total_tokens: int, + type: str, ) -> None: ... @overload @@ -8497,23 +11656,55 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MemoryStoreOperationUsageInputTokensDetails(_Model): # pylint: disable=name-too-long - """MemoryStoreOperationUsageInputTokensDetails. +class OutputItemApplyPatchToolCall(OutputItem, discriminator="apply_patch_call"): + """Apply patch tool call. - :ivar cached_tokens: The number of tokens that were retrieved from the cache. - `More on prompt caching `_. Required. - :vartype cached_tokens: int + :ivar type: The type of the item. Always ``apply_patch_call``. Required. + :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 """ - cached_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of tokens that were retrieved from the cache. - `More on prompt caching `_. Required.""" + 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.""" + 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"] + ) + """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"] + ) + """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, *, - cached_tokens: int, + id: str, # pylint: disable=redefined-builtin + call_id: str, + status: Union[str, "_models.ApplyPatchCallStatus"], + operation: "_models.ApplyPatchFileOperation", + created_by: Optional[str] = None, ) -> None: ... @overload @@ -8525,23 +11716,53 @@ 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 MemoryStoreOperationUsageOutputTokensDetails(_Model): # pylint: disable=name-too-long - """MemoryStoreOperationUsageOutputTokensDetails. +class OutputItemApplyPatchToolCallOutput(OutputItem, discriminator="apply_patch_call_output"): + """Apply patch tool call output. - :ivar reasoning_tokens: The number of reasoning tokens. Required. - :vartype reasoning_tokens: int + :ivar type: The type of the item. Always ``apply_patch_call_output``. Required. + :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 """ - reasoning_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of reasoning tokens. Required.""" + 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.""" + 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, *, - reasoning_tokens: int, + id: str, # pylint: disable=redefined-builtin + call_id: str, + status: Union[str, "_models.ApplyPatchCallOutputStatus"], + output: Optional[str] = None, + created_by: Optional[str] = None, ) -> None: ... @overload @@ -8553,35 +11774,60 @@ 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_OUTPUT # type: ignore -class MemoryStoreSearchResult(_Model): - """Memory search response. +class OutputItemCodeInterpreterToolCall(OutputItem, discriminator="code_interpreter_call"): + """Code interpreter tool call. - :ivar search_id: The unique ID of this search request. Use this value as previous_search_id in - subsequent requests to perform incremental searches. Required. - :vartype search_id: str - :ivar memories: Related memory items found during the search operation. Required. - :vartype memories: list[~azure.ai.projects.models.MemorySearchItem] - :ivar usage: Usage statistics associated with the memory search operation. Required. - :vartype usage: ~azure.ai.projects.models.MemoryStoreOperationUsage + :ivar type: The type of the code interpreter tool call. Always ``code_interpreter_call``. + Required. + :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] """ - search_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of this search request. Use this value as previous_search_id in subsequent - requests to perform incremental searches. Required.""" - memories: list["_models.MemorySearchItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Related memory items found during the search operation. Required.""" - usage: "_models.MemoryStoreOperationUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Usage statistics associated with the memory search operation. Required.""" + type: Literal[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.""" + 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, *, - search_id: str, - memories: list["_models.MemorySearchItem"], - usage: "_models.MemoryStoreOperationUsage", + 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"]], ) -> None: ... @overload @@ -8593,31 +11839,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = OutputItemType.CODE_INTERPRETER_CALL # type: ignore -class MemoryStoreUpdateCompletedResult(_Model): - """Memory update result. +class OutputItemCompactionBody(OutputItem, discriminator="compaction"): + """Compaction item. - :ivar memory_operations: A list of individual memory operations that were performed during the - update. Required. - :vartype memory_operations: list[~azure.ai.projects.models.MemoryOperation] - :ivar usage: Usage statistics associated with the memory update operation. Required. - :vartype usage: ~azure.ai.projects.models.MemoryStoreOperationUsage + :ivar type: The type of the item. Always ``compaction``. Required. + :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: Required. + :vartype encrypted_content: str + :ivar created_by: + :vartype created_by: str """ - memory_operations: list["_models.MemoryOperation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A list of individual memory operations that were performed during the update. Required.""" - usage: "_models.MemoryStoreOperationUsage" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Usage statistics associated with the memory update operation. Required.""" + type: Literal[OutputItemType.COMPACTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``compaction``. Required.""" + 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"]) + """Required.""" + created_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - memory_operations: list["_models.MemoryOperation"], - usage: "_models.MemoryStoreOperationUsage", + id: str, # pylint: disable=redefined-builtin + encrypted_content: str, + created_by: Optional[str] = None, ) -> None: ... @overload @@ -8629,53 +11881,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = OutputItemType.COMPACTION # type: ignore -class MemoryStoreUpdateResult(_Model): - """Provides the status of a memory store update operation. +class OutputItemComputerToolCall(OutputItem, discriminator="computer_call"): + """Computer tool call. - :ivar update_id: The unique ID of this update request. Use this value as previous_update_id in - subsequent requests to perform incremental updates. Required. - :vartype update_id: str - :ivar status: The status of the memory update operation. One of "queued", "in_progress", - "completed", "failed", or "superseded". Required. Known values are: "queued", "in_progress", - "completed", "failed", and "superseded". - :vartype status: str or ~azure.ai.projects.models.MemoryStoreUpdateStatus - :ivar superseded_by: The update_id the operation was superseded by when status is "superseded". - :vartype superseded_by: str - :ivar result: The result of memory store update operation when status is "completed". - :vartype result: ~azure.ai.projects.models.MemoryStoreUpdateCompletedResult - :ivar error: Error object that describes the error when status is "failed". - :vartype error: ~azure.ai.projects.models.Error + :ivar type: The type of the computer call. Always ``computer_call``. Required. + :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 """ - update_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of this update request. Use this value as previous_update_id in subsequent - requests to perform incremental updates. Required.""" - status: Union[str, "_models.MemoryStoreUpdateStatus"] = rest_field( + 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.""" + 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 status of the memory update operation. One of \"queued\", \"in_progress\", \"completed\", - \"failed\", or \"superseded\". Required. Known values are: \"queued\", \"in_progress\", - \"completed\", \"failed\", and \"superseded\".""" - superseded_by: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The update_id the operation was superseded by when status is \"superseded\".""" - result: Optional["_models.MemoryStoreUpdateCompletedResult"] = rest_field( + """The pending safety checks for the computer call. Required.""" + status: Literal["in_progress", "completed", "incomplete"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The result of memory store update operation when status is \"completed\".""" - error: Optional["_models.Error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Error object that describes the error when status is \"failed\".""" + """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, *, - update_id: str, - status: Union[str, "_models.MemoryStoreUpdateStatus"], - superseded_by: Optional[str] = None, - result: Optional["_models.MemoryStoreUpdateCompletedResult"] = None, - error: Optional["_models.Error"] = None, + id: str, # pylint: disable=redefined-builtin + call_id: str, + action: "_models.ComputerAction", + pending_safety_checks: list["_models.ComputerCallSafetyCheckParam"], + status: Literal["in_progress", "completed", "incomplete"], ) -> None: ... @overload @@ -8687,29 +11942,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = OutputItemType.COMPUTER_CALL # type: ignore -class MicrosoftFabricAgentTool(Tool, discriminator="fabric_dataagent_preview"): - """The input definition information for a Microsoft Fabric tool as used to configure an agent. +class OutputItemCustomToolCall(OutputItem, discriminator="custom_tool_call"): + """Custom tool call. - :ivar type: The object type, which is always 'fabric_dataagent'. Required. - :vartype type: str or ~azure.ai.projects.models.FABRIC_DATAAGENT_PREVIEW - :ivar fabric_dataagent_preview: The fabric data agent tool parameters. Required. - :vartype fabric_dataagent_preview: ~azure.ai.projects.models.FabricDataAgentToolParameters + :ivar type: The type of the custom tool call. Always ``custom_tool_call``. Required. + :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[ToolType.FABRIC_DATAAGENT_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'fabric_dataagent'. Required.""" - fabric_dataagent_preview: "_models.FabricDataAgentToolParameters" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The fabric data agent tool parameters. Required.""" + 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.""" + 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, *, - fabric_dataagent_preview: "_models.FabricDataAgentToolParameters", + call_id: str, + name: str, + input: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -8721,48 +11990,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.FABRIC_DATAAGENT_PREVIEW # type: ignore + self.type = OutputItemType.CUSTOM_TOOL_CALL # type: ignore -class ModelDeployment(Deployment, discriminator="ModelDeployment"): - """Model Deployment Definition. +class OutputItemFileSearchToolCall(OutputItem, discriminator="file_search_call"): + """File search tool call. - :ivar name: Name of the deployment. Required. - :vartype name: str - :ivar type: The type of the deployment. Required. Model deployment - :vartype type: str or ~azure.ai.projects.models.MODEL_DEPLOYMENT - :ivar model_name: Publisher-specific name of the deployed model. Required. - :vartype model_name: str - :ivar model_version: Publisher-specific version of the deployed model. Required. - :vartype model_version: str - :ivar model_publisher: Name of the deployed model's publisher. Required. - :vartype model_publisher: str - :ivar capabilities: Capabilities of deployed model. Required. - :vartype capabilities: dict[str, str] - :ivar sku: Sku of the model deployment. Required. - :vartype sku: ~azure.ai.projects.models.ModelDeploymentSku - :ivar connection_name: Name of the connection the deployment comes from. - :vartype connection_name: str + :ivar 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. + :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] """ - type: Literal[DeploymentType.MODEL_DEPLOYMENT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the deployment. Required. Model deployment""" - model_name: str = rest_field(name="modelName", visibility=["read"]) - """Publisher-specific name of the deployed model. Required.""" - model_version: str = rest_field(name="modelVersion", visibility=["read"]) - """Publisher-specific version of the deployed model. Required.""" - model_publisher: str = rest_field(name="modelPublisher", visibility=["read"]) - """Name of the deployed model's publisher. Required.""" - capabilities: dict[str, str] = rest_field(visibility=["read"]) - """Capabilities of deployed model. Required.""" - sku: "_models.ModelDeploymentSku" = rest_field(visibility=["read"]) - """Sku of the model deployment. Required.""" - connection_name: Optional[str] = rest_field(name="connectionName", visibility=["read"]) - """Name of the connection the deployment comes from.""" + 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.""" + 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], + results: Optional[list["_models.FileSearchToolCallResults"]] = None, ) -> None: ... @overload @@ -8774,44 +12047,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = DeploymentType.MODEL_DEPLOYMENT # type: ignore + self.type = OutputItemType.FILE_SEARCH_CALL # type: ignore -class ModelDeploymentSku(_Model): - """Sku information. +class OutputItemFunctionShellCall(OutputItem, discriminator="shell_call"): + """Shell tool call. - :ivar capacity: Sku capacity. Required. - :vartype capacity: int - :ivar family: Sku family. Required. - :vartype family: str - :ivar name: Sku name. Required. - :vartype name: str - :ivar size: Sku size. Required. - :vartype size: str - :ivar tier: Sku tier. Required. - :vartype tier: str + :ivar type: The type of the item. Always ``shell_call``. Required. + :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 """ - capacity: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku capacity. Required.""" - family: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku family. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku name. Required.""" - size: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku size. Required.""" - tier: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sku tier. Required.""" + 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.""" + 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, *, - capacity: int, - family: str, - name: str, - size: str, - tier: str, + id: str, # pylint: disable=redefined-builtin + call_id: str, + action: "_models.FunctionShellAction", + status: Union[str, "_models.LocalShellCallStatus"], + created_by: Optional[str] = None, ) -> None: ... @overload @@ -8823,29 +12105,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = OutputItemType.SHELL_CALL # type: ignore -class MonthlyRecurrenceSchedule(RecurrenceSchedule, discriminator="Monthly"): - """Monthly recurrence schedule. +class OutputItemFunctionShellCallOutput(OutputItem, discriminator="shell_call_output"): + """Shell call output. - :ivar type: Monthly recurrence type. Required. Monthly recurrence pattern. - :vartype type: str or ~azure.ai.projects.models.MONTHLY - :ivar days_of_month: Days of the month for the recurrence schedule. Required. - :vartype days_of_month: list[int] + :ivar type: The type of the shell call output. Always ``shell_call_output``. Required. + :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: + :vartype created_by: str """ - type: Literal[RecurrenceType.MONTHLY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Monthly recurrence type. Required. Monthly recurrence pattern.""" - days_of_month: list[int] = rest_field( - name="daysOfMonth", visibility=["read", "create", "update", "delete", "query"] + 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.""" + 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"] ) - """Days of the month for the recurrence schedule. Required.""" + """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"]) @overload def __init__( self, *, - days_of_month: list[int], + id: str, # pylint: disable=redefined-builtin + call_id: str, + output: list["_models.FunctionShellCallOutputContent"], + max_output_length: int, + created_by: Optional[str] = None, ) -> None: ... @overload @@ -8857,22 +12160,54 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RecurrenceType.MONTHLY # type: ignore + self.type = OutputItemType.SHELL_CALL_OUTPUT # type: ignore -class NoAuthenticationCredentials(BaseCredentials, discriminator="None"): - """Credentials that do not require authentication. +class OutputItemFunctionToolCall(OutputItem, discriminator="function_call"): + """Function tool call. - :ivar type: The credential type. Required. No credential - :vartype type: str or ~azure.ai.projects.models.NONE + :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. + :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 """ - type: Literal[CredentialType.NONE] = rest_discriminator(name="type", visibility=["read"]) # type: ignore - """The credential type. Required. No credential""" + 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.""" + 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, + id: Optional[str] = None, # pylint: disable=redefined-builtin + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, ) -> None: ... @overload @@ -8884,39 +12219,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = CredentialType.NONE # type: ignore + self.type = OutputItemType.FUNCTION_CALL # type: ignore -class OAuthConsentRequestItemResource(ItemResource, discriminator="oauth_consent_request"): - """Request from the service for the user to perform OAuth consent. +class OutputItemImageGenToolCall(OutputItem, discriminator="image_generation_call"): + """Image generation call. - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar id: Required. + :ivar type: The type of the image generation call. Always ``image_generation_call``. Required. + :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 type: Required. - :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 - :ivar server_label: The server label for the OAuth consent request. Required. - :vartype server_label: 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[ItemType.OAUTH_CONSENT_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + 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.""" + 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.""" - 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"]) - """The server label for the OAuth consent request. Required.""" @overload def __init__( self, *, id: str, # pylint: disable=redefined-builtin - consent_link: str, - server_label: str, - created_by: Optional["_models.CreatedBy"] = None, + status: Literal["in_progress", "completed", "generating", "failed"], + result: str, ) -> None: ... @overload @@ -8928,33 +12266,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.OAUTH_CONSENT_REQUEST # type: ignore + self.type = OutputItemType.IMAGE_GENERATION_CALL # type: ignore -class OneTimeTrigger(Trigger, discriminator="OneTime"): - """One-time trigger. +class OutputItemLocalShellToolCall(OutputItem, discriminator="local_shell_call"): + """Local shell call. - :ivar type: Required. One-time trigger. - :vartype type: str or ~azure.ai.projects.models.ONE_TIME - :ivar trigger_at: Date and time for the one-time trigger in ISO 8601 format. Required. - :vartype trigger_at: str - :ivar time_zone: Time zone for the one-time trigger. - :vartype time_zone: str + :ivar type: The type of the local shell call. Always ``local_shell_call``. Required. + :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[TriggerType.ONE_TIME] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. One-time trigger.""" - trigger_at: str = rest_field(name="triggerAt", visibility=["read", "create", "update", "delete", "query"]) - """Date and time for the one-time trigger in ISO 8601 format. Required.""" - time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) - """Time zone for the one-time trigger.""" + 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.""" + 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, *, - trigger_at: str, - time_zone: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + call_id: str, + action: "_models.LocalShellExecAction", + status: Literal["in_progress", "completed", "incomplete"], ) -> None: ... @overload @@ -8966,30 +12318,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TriggerType.ONE_TIME # type: ignore + self.type = OutputItemType.LOCAL_SHELL_CALL # type: ignore -class OpenApiAgentTool(Tool, discriminator="openapi"): - """The input definition information for an OpenAPI tool as used to configure an agent. +class OutputItemMcpApprovalRequest(OutputItem, discriminator="mcp_approval_request"): + """MCP approval request. - :ivar type: The object type, which is always 'openapi'. Required. - :vartype type: str or ~azure.ai.projects.models.OPENAPI - :ivar openapi: The openapi function definition. Required. - :vartype openapi: ~azure.ai.projects.models.OpenApiFunctionDefinition + :ivar type: The type of the item. Always ``mcp_approval_request``. Required. + :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[ToolType.OPENAPI] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'openapi'. Required.""" - openapi: "_models.OpenApiFunctionDefinition" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The openapi function definition. Required.""" + 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.""" + 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, *, - openapi: "_models.OpenApiFunctionDefinition", + id: str, # pylint: disable=redefined-builtin + server_label: str, + name: str, + arguments: str, ) -> None: ... @overload @@ -9001,30 +12366,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.OPENAPI # type: ignore + self.type = OutputItemType.MCP_APPROVAL_REQUEST # type: ignore -class OpenApiAuthDetails(_Model): - """authentication details for OpenApiFunctionDefinition. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - OpenApiAnonymousAuthDetails, OpenApiManagedAuthDetails, OpenApiProjectConnectionAuthDetails +class OutputItemMcpListTools(OutputItem, discriminator="mcp_list_tools"): + """MCP list tools. - :ivar type: The type of authentication, must be anonymous/project_connection/managed_identity. - Required. Known values are: "anonymous", "project_connection", and "managed_identity". - :vartype type: str or ~azure.ai.projects.models.OpenApiAuthType + :ivar type: The type of the item. Always ``mcp_list_tools``. Required. + :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 """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of authentication, must be anonymous/project_connection/managed_identity. Required. - Known values are: \"anonymous\", \"project_connection\", and \"managed_identity\".""" + 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.""" + 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, *, - type: str, + id: str, # pylint: disable=redefined-builtin + server_label: str, + tools: list["_models.MCPListToolsTool"], + error: Optional[str] = None, ) -> None: ... @overload @@ -9036,21 +12413,66 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = OutputItemType.MCP_LIST_TOOLS # type: ignore -class OpenApiAnonymousAuthDetails(OpenApiAuthDetails, discriminator="anonymous"): - """Security details for OpenApi anonymous authentication. +class OutputItemMcpToolCall(OutputItem, discriminator="mcp_call"): + """MCP tool call. - :ivar type: The object type, which is always 'anonymous'. Required. - :vartype type: str or ~azure.ai.projects.models.ANONYMOUS + :ivar type: The type of the item. Always ``mcp_call``. Required. + :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[OpenApiAuthType.ANONYMOUS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'anonymous'. Required.""" + 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.""" + 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, + output: Optional[str] = None, + error: Optional[str] = None, + status: Optional[Union[str, "_models.MCPToolCallStatus"]] = None, + approval_request_id: Optional[str] = None, ) -> None: ... @overload @@ -9062,50 +12484,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OpenApiAuthType.ANONYMOUS # type: ignore + self.type = OutputItemType.MCP_CALL # type: ignore -class OpenApiFunctionDefinition(_Model): - """The input definition information for an openapi function. +class OutputItemOutputMessage(OutputItem, discriminator="output_message"): + """Output message. - :ivar name: The name of the function to be called. Required. - :vartype name: str - :ivar description: A description of what the function does, used by the model to choose when - and how to call the function. - :vartype description: str - :ivar spec: The openapi function shape, described as a JSON Schema object. Required. - :vartype spec: any - :ivar auth: Open API authentication details. Required. - :vartype auth: ~azure.ai.projects.models.OpenApiAuthDetails - :ivar default_params: List of OpenAPI spec parameters that will use user-provided defaults. - :vartype default_params: list[str] - :ivar functions: List of function definitions used by OpenApi tool. - :vartype functions: list[~azure.ai.projects.models.OpenApiFunctionDefinitionFunction] + :ivar id: The unique ID of the output message. Required. + :vartype id: str + :ivar type: The type of the output message. Always ``message``. Required. + :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 """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function to be called. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description of what the function does, used by the model to choose when and how to call the - function.""" - spec: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The openapi function shape, described as a JSON Schema object. Required.""" - auth: "_models.OpenApiAuthDetails" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Open API authentication details. Required.""" - default_params: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of OpenAPI spec parameters that will use user-provided defaults.""" - functions: Optional[list["_models.OpenApiFunctionDefinitionFunction"]] = rest_field(visibility=["read"]) - """List of function definitions used by OpenApi tool.""" + 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.""" + 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, *, - name: str, - spec: Any, - auth: "_models.OpenApiAuthDetails", - description: Optional[str] = None, - default_params: Optional[list[str]] = None, + id: str, # pylint: disable=redefined-builtin + content: list["_models.OutputMessageContent"], + status: Literal["in_progress", "completed", "incomplete"], ) -> None: ... @overload @@ -9117,36 +12540,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: 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 OpenApiFunctionDefinitionFunction(_Model): - """OpenApiFunctionDefinitionFunction. +class OutputItemReasoningItem(OutputItem, discriminator="reasoning"): + """Reasoning. - :ivar name: The name of the function to be called. Required. - :vartype name: str - :ivar description: A description of what the function does, used by the model to choose when - and how to call the function. - :vartype description: str - :ivar parameters: The parameters the functions accepts, described as a JSON Schema object. - Required. - :vartype parameters: any + :ivar type: The type of the object. Always ``reasoning``. Required. + :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 """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function to be called. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description of what the function does, used by the model to choose when and how to call the - function.""" - parameters: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The parameters the functions accepts, described as a JSON Schema object. Required.""" + type: Literal[OutputItemType.REASONING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the object. Always ``reasoning``. Required.""" + 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, *, - name: str, - parameters: Any, - description: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + summary: list["_models.Summary"], + encrypted_content: Optional[str] = None, + content: Optional[list["_models.ReasoningTextContent"]] = None, + status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, ) -> None: ... @overload @@ -9158,29 +12601,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = OutputItemType.REASONING # type: ignore -class OpenApiManagedAuthDetails(OpenApiAuthDetails, discriminator="managed_identity"): - """Security details for OpenApi managed_identity authentication. +class OutputItemWebSearchToolCall(OutputItem, discriminator="web_search_call"): + """Web search tool call. - :ivar type: The object type, which is always 'managed_identity'. Required. - :vartype type: str or ~azure.ai.projects.models.MANAGED_IDENTITY - :ivar security_scheme: Connection auth security details. Required. - :vartype security_scheme: ~azure.ai.projects.models.OpenApiManagedSecurityScheme + :ivar 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. + :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 """ - 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.""" - security_scheme: "_models.OpenApiManagedSecurityScheme" = rest_field( + 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.""" + status: Literal["in_progress", "searching", "completed", "failed"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Connection auth security details. Required.""" + """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, *, - security_scheme: "_models.OpenApiManagedSecurityScheme", + id: str, # pylint: disable=redefined-builtin + status: Literal["in_progress", "searching", "completed", "failed"], + action: Union[ + "_models.WebSearchActionSearch", "_models.WebSearchActionOpenPage", "_models.WebSearchActionFind" + ], ) -> None: ... @overload @@ -9192,24 +12658,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OpenApiAuthType.MANAGED_IDENTITY # type: ignore + self.type = OutputItemType.WEB_SEARCH_CALL # type: ignore -class OpenApiManagedSecurityScheme(_Model): - """Security scheme for OpenApi managed_identity authentication. +class OutputMessageContent(_Model): + """OutputMessageContent. - :ivar audience: Authentication scope for managed_identity auth type. Required. - :vartype audience: str + 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 """ - audience: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Authentication scope for managed_identity auth type. Required.""" + __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, *, - audience: str, + type: str, ) -> None: ... @overload @@ -9223,27 +12693,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OpenApiProjectConnectionAuthDetails(OpenApiAuthDetails, discriminator="project_connection"): - """Security details for OpenApi project connection authentication. +class OutputMessageContentOutputTextContent(OutputMessageContent, discriminator="output_text"): + """Output text. - :ivar type: The object type, which is always 'project_connection'. Required. - :vartype type: str or ~azure.ai.projects.models.PROJECT_CONNECTION - :ivar security_scheme: Project connection auth security details. Required. - :vartype security_scheme: ~azure.ai.projects.models.OpenApiProjectConnectionSecurityScheme + :ivar type: The type of the output text. Always ``output_text``. Required. + :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[OpenApiAuthType.PROJECT_CONNECTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The object type, which is always 'project_connection'. Required.""" - security_scheme: "_models.OpenApiProjectConnectionSecurityScheme" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Project connection auth security details. Required.""" + 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.""" + 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, *, - security_scheme: "_models.OpenApiProjectConnectionSecurityScheme", + text: str, + annotations: list["_models.Annotation"], + logprobs: Optional[list["_models.LogProb"]] = None, ) -> None: ... @overload @@ -9255,24 +12732,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = OpenApiAuthType.PROJECT_CONNECTION # type: ignore + self.type = OutputMessageContentType.OUTPUT_TEXT # type: ignore -class OpenApiProjectConnectionSecurityScheme(_Model): - """Security scheme for OpenApi managed_identity authentication. +class OutputMessageContentRefusalContent(OutputMessageContent, discriminator="refusal"): + """Refusal. - :ivar project_connection_id: Project connection id for Project Connection auth type. Required. - :vartype project_connection_id: str + :ivar type: The type of the refusal. Always ``refusal``. Required. + :vartype type: str or ~azure.ai.projects.models.REFUSAL + :ivar refusal: The refusal explanation from the model. Required. + :vartype refusal: str """ - project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Project connection id for Project Connection auth type. Required.""" + 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: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The refusal explanation from the model. Required.""" @overload def __init__( self, *, - project_connection_id: str, + refusal: str, ) -> None: ... @overload @@ -9284,6 +12765,7 @@ 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 class PendingUploadRequest(_Model): @@ -9390,7 +12872,7 @@ class Prompt(_Model): :ivar id: The unique identifier of the prompt template to use. Required. :vartype id: str - :ivar version: Optional version of the prompt template. + :ivar version: :vartype version: str :ivar variables: :vartype variables: ~azure.ai.projects.models.ResponsePromptVariables @@ -9399,7 +12881,6 @@ class Prompt(_Model): 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"]) - """Optional version of the prompt template.""" variables: Optional["_models.ResponsePromptVariables"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -9523,10 +13004,10 @@ class PromptAgentDefinitionText(_Model): """PromptAgentDefinitionText. :ivar format: - :vartype format: ~azure.ai.projects.models.ResponseTextFormatConfiguration + :vartype format: ~azure.ai.projects.models.TextResponseFormatConfiguration """ - format: Optional["_models.ResponseTextFormatConfiguration"] = rest_field( + format: Optional["_models.TextResponseFormatConfiguration"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -9534,7 +13015,7 @@ class PromptAgentDefinitionText(_Model): def __init__( self, *, - format: Optional["_models.ResponseTextFormatConfiguration"] = None, + format: Optional["_models.TextResponseFormatConfiguration"] = None, ) -> None: ... @overload @@ -9656,189 +13137,41 @@ 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. Is either a Literal["auto"] type or a - Literal["default-2024-11-15"] type. - :vartype ranker: str or str - :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 - """ - - ranker: Optional[Literal["auto", "default-2024-11-15"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The ranker to use for the file search. Is either a Literal[\"auto\"] type or a - Literal[\"default-2024-11-15\"] type.""" - 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.""" - - @overload - def __init__( - self, - *, - ranker: Optional[Literal["auto", "default-2024-11-15"]] = None, - score_threshold: Optional[float] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Reasoning(_Model): - """**o-series models only** - - Configuration options for `reasoning models - `_. - - :ivar effort: Known values are: "none", "minimal", "low", "medium", and "high". - :vartype effort: str or ~azure.ai.projects.models.ReasoningEffort - :ivar summary: A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of ``auto``, ``concise``, or ``detailed``. Is one of the following types: Literal["auto"], - Literal["concise"], Literal["detailed"] - :vartype summary: str or str or str - :ivar generate_summary: **Deprecated**: use ``summary`` instead. A summary of the reasoning - performed by the model. This can be useful for debugging and understanding the model's - reasoning process. One of ``auto``, ``concise``, or ``detailed``. Is one of the following - types: Literal["auto"], Literal["concise"], Literal["detailed"] - :vartype generate_summary: str or str or str - """ - - effort: Optional[Union[str, "_models.ReasoningEffort"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"none\", \"minimal\", \"low\", \"medium\", and \"high\".""" - summary: Optional[Literal["auto", "concise", "detailed"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of ``auto``, ``concise``, or ``detailed``. 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"] - ) - """**Deprecated**: use ``summary`` instead. A summary of the reasoning performed by the model. - This can be useful for debugging and understanding the model's reasoning process. One of - ``auto``, ``concise``, or ``detailed``. Is one of the following types: Literal[\"auto\"], - Literal[\"concise\"], Literal[\"detailed\"]""" - - @overload - def __init__( - self, - *, - effort: Optional[Union[str, "_models.ReasoningEffort"]] = 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 ReasoningItemParam(ItemParam, discriminator="reasoning"): - """A description of the chain of thought used by a reasoning model while generating - a response. Be sure to include these items in your ``input`` to the Responses API - for subsequent turns of a conversation if you are manually - `managing conversation state `_. - - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.REASONING - :ivar encrypted_content: The encrypted content of the reasoning item - populated when a - response is - generated with ``reasoning.encrypted_content`` in the ``include`` parameter. - :vartype encrypted_content: str - :ivar summary: Reasoning text contents. Required. - :vartype summary: list[~azure.ai.projects.models.ReasoningItemSummaryPart] - """ - - type: Literal[ItemType.REASONING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - encrypted_content: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The encrypted content of the reasoning item - populated when a response is - generated with ``reasoning.encrypted_content`` in the ``include`` parameter.""" - summary: list["_models.ReasoningItemSummaryPart"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Reasoning text contents. Required.""" - - @overload - def __init__( - self, - *, - summary: list["_models.ReasoningItemSummaryPart"], - encrypted_content: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ItemType.REASONING # type: ignore - - -class ReasoningItemResource(ItemResource, discriminator="reasoning"): - """A description of the chain of thought used by a reasoning model while generating - a response. Be sure to include these items in your ``input`` to the Responses API - for subsequent turns of a conversation if you are manually - `managing conversation state `_. +class RankingOptions(_Model): + """RankingOptions. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.REASONING - :ivar encrypted_content: The encrypted content of the reasoning item - populated when a - response is - generated with ``reasoning.encrypted_content`` in the ``include`` parameter. - :vartype encrypted_content: str - :ivar summary: Reasoning text contents. Required. - :vartype summary: list[~azure.ai.projects.models.ReasoningItemSummaryPart] + :ivar ranker: The ranker to use for the file search. Known values are: "auto" and + "default-2024-11-15". + :vartype ranker: str or ~azure.ai.projects.models.RankerVersionType + :ivar score_threshold: The score threshold for the file search, a number between 0 and 1. + Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer + results. + :vartype score_threshold: float + :ivar hybrid_search: Weights that control how reciprocal rank fusion balances semantic + embedding matches versus sparse keyword matches when hybrid search is enabled. + :vartype hybrid_search: ~azure.ai.projects.models.HybridSearchOptions """ - type: Literal[ItemType.REASONING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - encrypted_content: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The encrypted content of the reasoning item - populated when a response is - generated with ``reasoning.encrypted_content`` in the ``include`` parameter.""" - summary: list["_models.ReasoningItemSummaryPart"] = rest_field( + 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"] ) - """Reasoning text contents. Required.""" + """Weights that control how reciprocal rank fusion balances semantic embedding matches versus + sparse keyword matches when hybrid search is enabled.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - summary: list["_models.ReasoningItemSummaryPart"], - created_by: Optional["_models.CreatedBy"] = None, - encrypted_content: Optional[str] = None, + ranker: Optional[Union[str, "_models.RankerVersionType"]] = None, + score_threshold: Optional[float] = None, + hybrid_search: Optional["_models.HybridSearchOptions"] = None, ) -> None: ... @overload @@ -9850,28 +13183,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.REASONING # type: ignore -class ReasoningItemSummaryPart(_Model): - """ReasoningItemSummaryPart. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ReasoningItemSummaryTextPart +class Reasoning(_Model): + """Reasoning. - :ivar type: Required. "summary_text" - :vartype type: str or ~azure.ai.projects.models.ReasoningItemSummaryPartType + :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 """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. \"summary_text\"""" + 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, *, - type: str, + 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 @@ -9885,19 +13233,19 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ReasoningItemSummaryTextPart(ReasoningItemSummaryPart, discriminator="summary_text"): - """ReasoningItemSummaryTextPart. +class ReasoningTextContent(OutputContent, discriminator="reasoning_text"): + """ReasoningTextContent. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.SUMMARY_TEXT - :ivar text: Required. + :ivar type: The type of the reasoning text. Always ``reasoning_text``. Required. + :vartype type: str or ~azure.ai.projects.models.REASONING_TEXT + :ivar text: The reasoning text from the model. Required. :vartype text: str """ - type: Literal[ReasoningItemSummaryPartType.SUMMARY_TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """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.""" text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + """The reasoning text from the model. Required.""" @overload def __init__( @@ -9915,7 +13263,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ReasoningItemSummaryPartType.SUMMARY_TEXT # type: ignore + self.type = OutputContentType.REASONING_TEXT # type: ignore class RecurrenceTrigger(Trigger, discriminator="Recurrence"): @@ -10063,87 +13411,60 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Response(_Model): - """Response. + """The response object. - :ivar metadata: Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. Required. - :vartype metadata: dict[str, str] - :ivar 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. Required. + :ivar metadata: + :vartype metadata: ~azure.ai.projects.models.Metadata + :ivar top_logprobs: + :vartype top_logprobs: int + :ivar temperature: :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. Required. + :ivar top_p: :vartype top_p: float - :ivar user: A unique identifier representing your end-user, which can help OpenAI to monitor - and detect abuse. `Learn more about safety best practices - `_. Required. + :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 service_tier: Note: service_tier is not applicable to Azure OpenAI. Known values are: - "auto", "default", "flex", "scale", and "priority". - :vartype service_tier: str or ~azure.ai.projects.models.ServiceTier - :ivar top_logprobs: An integer between 0 and 20 specifying the number of most likely tokens to - return at each token position, each with an associated log probability. - :vartype top_logprobs: int - :ivar previous_response_id: The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - `managing conversation state `_. + :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: Note: service_tier is not applicable to Azure OpenAI. 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: Whether to run the model response in the background. - `Learn more about background responses `_. + :ivar background: :vartype background: bool - :ivar max_output_tokens: An upper bound for the number of tokens that can be generated for a - response, including visible output tokens and `reasoning tokens - `_. + :ivar max_output_tokens: :vartype max_output_tokens: int - :ivar max_tool_calls: The maximum number of total calls to built-in tools that can be processed - in a response. This maximum number applies across all built-in tool calls, not per individual - tool. Any further attempts to call a tool by the model will be ignored. + :ivar max_tool_calls: :vartype max_tool_calls: int - :ivar text: Configuration options for a text response from the model. Can be plain - text or structured JSON data. See `Text inputs and outputs - `_ - and `Structured Outputs `_. - :vartype text: ~azure.ai.projects.models.ResponseText - :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. - The two categories of tools you can provide the model are: - * **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web - search](https://platform.openai.com/docs/guides/tools-web-search) - or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). - * **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code. Learn more about - [function calling](https://platform.openai.com/docs/guides/function-calling). + :ivar text: + :vartype text: ~azure.ai.projects.models.ResponseTextParam + :ivar tools: :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 Union[str, "_models.ToolChoiceOptions"] type or a - ToolChoiceObject type. - :vartype tool_choice: str or ~azure.ai.projects.models.ToolChoiceOptions or - ~azure.ai.projects.models.ToolChoiceObject + :ivar tool_choice: + :vartype tool_choice: ~azure.ai.projects.models.ToolChoiceParam :ivar prompt: :vartype prompt: ~azure.ai.projects.models.Prompt - :ivar truncation: The truncation strategy to use for the model response. - * `auto`: If the context of this response and previous ones exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping input items in the - middle of the conversation. - * `disabled` (default): If a model response will exceed the context window - size for a model, the request will fail with a 400 error. Is either a Literal["auto"] type or a - Literal["disabled"] type. + :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 @@ -10151,7 +13472,7 @@ class Response(_Model): 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: + ``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 @@ -10159,32 +13480,27 @@ class Response(_Model): :vartype created_at: ~datetime.datetime :ivar error: Required. :vartype error: ~azure.ai.projects.models.ResponseError - :ivar incomplete_details: Details about why the response is incomplete. Required. - :vartype incomplete_details: ~azure.ai.projects.models.ResponseIncompleteDetails1 + :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. + 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.ItemResource] - :ivar instructions: A system (or developer) message inserted into the model's context. - When using along with ``previous_response_id``, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. Required. Is either a str type or - a [ItemParam] type. - :vartype instructions: str or list[~azure.ai.projects.models.ItemParam] - :ivar output_text: SDK-only convenience property that contains the aggregated text output - from all ``output_text`` items in the ``output`` array, if any are present. - Supported in the Python and JavaScript SDKs. + 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: Required. - :vartype conversation: ~azure.ai.projects.models.ResponseConversation1 + :ivar conversation: + :vartype conversation: ~azure.ai.projects.models.ConversationReference :ivar agent: The agent used for this response. :vartype agent: ~azure.ai.projects.models.AgentId :ivar structured_inputs: The structured inputs to the response that can participate in prompt @@ -10192,86 +13508,54 @@ class Response(_Model): :vartype structured_inputs: dict[str, any] """ - metadata: dict[str, str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. Required.""" - temperature: 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. Required.""" - top_p: 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. Required.""" - user: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A unique identifier representing your end-user, which can help OpenAI to monitor and detect - abuse. `Learn more about safety best practices - `_. Required.""" - service_tier: Optional[Union[str, "_models.ServiceTier"]] = rest_field( + 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"] ) - """Note: service_tier is not applicable to Azure OpenAI. Known values are: \"auto\", \"default\", - \"flex\", \"scale\", and \"priority\".""" - top_logprobs: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An integer between 0 and 20 specifying the number of most likely tokens to return at each token - position, each with an associated log probability.""" + """Note: service_tier is not applicable to Azure OpenAI. 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"]) - """The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - `managing conversation state `_.""" 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"]) - """Whether to run the model response in the background. - `Learn more about background responses `_.""" max_output_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An upper bound for the number of tokens that can be generated for a response, including visible - output tokens and `reasoning tokens `_.""" max_tool_calls: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The maximum number of total calls to built-in tools that can be processed in a response. This - maximum number applies across all built-in tool calls, not per individual tool. Any further - attempts to call a tool by the model will be ignored.""" - text: Optional["_models.ResponseText"] = 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. See `Text inputs and outputs - `_ - and `Structured Outputs `_.""" + 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"]) - """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. - The two categories of tools you can provide the model are: - * **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web - search](https://platform.openai.com/docs/guides/tools-web-search) - or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). - * **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code. Learn more about - [function calling](https://platform.openai.com/docs/guides/function-calling).""" - tool_choice: Optional[Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceObject"]] = rest_field( + tool_choice: Optional["_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 Union[str, \"_models.ToolChoiceOptions\"] type or a - ToolChoiceObject 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"] ) - """The truncation strategy to use for the model response. - * `auto`: If the context of this response and previous ones exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping input items in the - middle of the conversation. - * `disabled` (default): If a model response will exceed the context window - size for a model, the request will fail with a 400 error. Is either a Literal[\"auto\"] type or - a Literal[\"disabled\"] type.""" + """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"]) @@ -10281,7 +13565,7 @@ class Response(_Model): 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: + ``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( @@ -10290,37 +13574,30 @@ class Response(_Model): """Unix timestamp (in seconds) of when this Response was created. Required.""" error: "_models.ResponseError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" - incomplete_details: "_models.ResponseIncompleteDetails1" = rest_field( + incomplete_details: "_models.ResponseIncompleteDetails" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Details about why the response is incomplete. Required.""" - output: list["_models.ItemResource"] = 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.ItemParam"]] = rest_field( + + * 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"] ) - """A system (or developer) message inserted into the model's context. - When using along with ``previous_response_id``, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. Required. Is either a str type or - a [ItemParam] type.""" + """Required. Is either a str type or a [InputItem] type.""" output_text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """SDK-only convenience property that contains the aggregated text output - from all ``output_text`` items in the ``output`` array, if any are present. - Supported in the Python and JavaScript SDKs.""" 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: "_models.ResponseConversation1" = rest_field( + conversation: Optional["_models.ConversationReference"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Required.""" agent: Optional["_models.AgentId"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The agent used for this response.""" structured_inputs: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -10331,285 +13608,39 @@ class Response(_Model): def __init__( # pylint: disable=too-many-locals self, *, - metadata: dict[str, str], - temperature: float, - top_p: float, - user: str, id: str, # pylint: disable=redefined-builtin created_at: datetime.datetime, error: "_models.ResponseError", - incomplete_details: "_models.ResponseIncompleteDetails1", - output: list["_models.ItemResource"], - instructions: Union[str, list["_models.ItemParam"]], + incomplete_details: "_models.ResponseIncompleteDetails", + output: list["_models.OutputItem"], + instructions: Union[str, list["_models.InputItem"]], parallel_tool_calls: bool, - conversation: "_models.ResponseConversation1", - service_tier: Optional[Union[str, "_models.ServiceTier"]] = None, + 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.ResponseText"] = None, + text: Optional["_models.ResponseTextParam"] = None, tools: Optional[list["_models.Tool"]] = None, - tool_choice: Optional[Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceObject"]] = None, + tool_choice: Optional["_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, output_text: Optional[str] = None, - usage: Optional["_models.ResponseUsage"] = None, - agent: Optional["_models.AgentId"] = None, - structured_inputs: Optional[dict[str, Any]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.object: Literal["response"] = "response" - - -class ResponseStreamEvent(_Model): - """ResponseStreamEvent. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ResponseErrorEvent, ResponseCodeInterpreterCallCompletedEvent, - ResponseCodeInterpreterCallInProgressEvent, ResponseCodeInterpreterCallInterpretingEvent, - ResponseCodeInterpreterCallCodeDeltaEvent, ResponseCodeInterpreterCallCodeDoneEvent, - ResponseCompletedEvent, ResponseContentPartAddedEvent, ResponseContentPartDoneEvent, - ResponseCreatedEvent, ResponseFailedEvent, ResponseFileSearchCallCompletedEvent, - ResponseFileSearchCallInProgressEvent, ResponseFileSearchCallSearchingEvent, - ResponseFunctionCallArgumentsDeltaEvent, ResponseFunctionCallArgumentsDoneEvent, - ResponseImageGenCallCompletedEvent, ResponseImageGenCallGeneratingEvent, - ResponseImageGenCallInProgressEvent, ResponseImageGenCallPartialImageEvent, - ResponseInProgressEvent, ResponseIncompleteEvent, ResponseMCPCallArgumentsDeltaEvent, - ResponseMCPCallArgumentsDoneEvent, ResponseMCPCallCompletedEvent, ResponseMCPCallFailedEvent, - ResponseMCPCallInProgressEvent, ResponseMCPListToolsCompletedEvent, - ResponseMCPListToolsFailedEvent, ResponseMCPListToolsInProgressEvent, - ResponseOutputItemAddedEvent, ResponseOutputItemDoneEvent, ResponseTextDeltaEvent, - ResponseTextDoneEvent, ResponseQueuedEvent, ResponseReasoningDeltaEvent, - ResponseReasoningDoneEvent, ResponseReasoningSummaryDeltaEvent, - ResponseReasoningSummaryDoneEvent, ResponseReasoningSummaryPartAddedEvent, - ResponseReasoningSummaryPartDoneEvent, ResponseReasoningSummaryTextDeltaEvent, - ResponseReasoningSummaryTextDoneEvent, ResponseRefusalDeltaEvent, ResponseRefusalDoneEvent, - ResponseWebSearchCallCompletedEvent, ResponseWebSearchCallInProgressEvent, - ResponseWebSearchCallSearchingEvent - - :ivar type: Required. Known values are: "response.audio.delta", "response.audio.done", - "response.audio_transcript.delta", "response.audio_transcript.done", - "response.code_interpreter_call_code.delta", "response.code_interpreter_call_code.done", - "response.code_interpreter_call.completed", "response.code_interpreter_call.in_progress", - "response.code_interpreter_call.interpreting", "response.completed", - "response.content_part.added", "response.content_part.done", "response.created", "error", - "response.file_search_call.completed", "response.file_search_call.in_progress", - "response.file_search_call.searching", "response.function_call_arguments.delta", - "response.function_call_arguments.done", "response.in_progress", "response.failed", - "response.incomplete", "response.output_item.added", "response.output_item.done", - "response.refusal.delta", "response.refusal.done", "response.output_text.annotation.added", - "response.output_text.delta", "response.output_text.done", - "response.reasoning_summary_part.added", "response.reasoning_summary_part.done", - "response.reasoning_summary_text.delta", "response.reasoning_summary_text.done", - "response.web_search_call.completed", "response.web_search_call.in_progress", - "response.web_search_call.searching", "response.image_generation_call.completed", - "response.image_generation_call.generating", "response.image_generation_call.in_progress", - "response.image_generation_call.partial_image", "response.mcp_call.arguments_delta", - "response.mcp_call.arguments_done", "response.mcp_call.completed", "response.mcp_call.failed", - "response.mcp_call.in_progress", "response.mcp_list_tools.completed", - "response.mcp_list_tools.failed", "response.mcp_list_tools.in_progress", "response.queued", - "response.reasoning.delta", "response.reasoning.done", "response.reasoning_summary.delta", and - "response.reasoning_summary.done". - :vartype type: str or ~azure.ai.projects.models.ResponseStreamEventType - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - """ - - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"response.audio.delta\", \"response.audio.done\", - \"response.audio_transcript.delta\", \"response.audio_transcript.done\", - \"response.code_interpreter_call_code.delta\", \"response.code_interpreter_call_code.done\", - \"response.code_interpreter_call.completed\", \"response.code_interpreter_call.in_progress\", - \"response.code_interpreter_call.interpreting\", \"response.completed\", - \"response.content_part.added\", \"response.content_part.done\", \"response.created\", - \"error\", \"response.file_search_call.completed\", \"response.file_search_call.in_progress\", - \"response.file_search_call.searching\", \"response.function_call_arguments.delta\", - \"response.function_call_arguments.done\", \"response.in_progress\", \"response.failed\", - \"response.incomplete\", \"response.output_item.added\", \"response.output_item.done\", - \"response.refusal.delta\", \"response.refusal.done\", - \"response.output_text.annotation.added\", \"response.output_text.delta\", - \"response.output_text.done\", \"response.reasoning_summary_part.added\", - \"response.reasoning_summary_part.done\", \"response.reasoning_summary_text.delta\", - \"response.reasoning_summary_text.done\", \"response.web_search_call.completed\", - \"response.web_search_call.in_progress\", \"response.web_search_call.searching\", - \"response.image_generation_call.completed\", \"response.image_generation_call.generating\", - \"response.image_generation_call.in_progress\", - \"response.image_generation_call.partial_image\", \"response.mcp_call.arguments_delta\", - \"response.mcp_call.arguments_done\", \"response.mcp_call.completed\", - \"response.mcp_call.failed\", \"response.mcp_call.in_progress\", - \"response.mcp_list_tools.completed\", \"response.mcp_list_tools.failed\", - \"response.mcp_list_tools.in_progress\", \"response.queued\", \"response.reasoning.delta\", - \"response.reasoning.done\", \"response.reasoning_summary.delta\", and - \"response.reasoning_summary.done\".""" - sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The sequence number for this event. Required.""" - - @overload - def __init__( - self, - *, - type: 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) - - -class ResponseCodeInterpreterCallCodeDeltaEvent( - ResponseStreamEvent, discriminator="response.code_interpreter_call_code.delta" -): # pylint: disable=name-too-long - """Emitted when a partial code snippet is streamed by the code interpreter. - - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.code_interpreter_call_code.delta``. - Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CODE_INTERPRETER_CALL_CODE_DELTA - :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 - """ - - type: Literal[ResponseStreamEventType.RESPONSE_CODE_INTERPRETER_CALL_CODE_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.code_interpreter_call_code.delta``. Required.""" - 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.""" - - @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 = ResponseStreamEventType.RESPONSE_CODE_INTERPRETER_CALL_CODE_DELTA # type: ignore - - -class ResponseCodeInterpreterCallCodeDoneEvent( - ResponseStreamEvent, discriminator="response.code_interpreter_call_code.done" -): - """Emitted when the code snippet is finalized by the code interpreter. - - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.code_interpreter_call_code.done``. - Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CODE_INTERPRETER_CALL_CODE_DONE - :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 - """ - - type: Literal[ResponseStreamEventType.RESPONSE_CODE_INTERPRETER_CALL_CODE_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.code_interpreter_call_code.done``. Required.""" - 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.""" - - @overload - def __init__( - self, - *, - sequence_number: int, - output_index: int, - item_id: str, - code: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_CODE_INTERPRETER_CALL_CODE_DONE # type: ignore - - -class ResponseCodeInterpreterCallCompletedEvent( - ResponseStreamEvent, discriminator="response.code_interpreter_call.completed" -): # pylint: disable=name-too-long - """Emitted when the code interpreter call is completed. - - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.code_interpreter_call.completed``. - Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CODE_INTERPRETER_CALL_COMPLETED - :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 - """ - - type: Literal[ResponseStreamEventType.RESPONSE_CODE_INTERPRETER_CALL_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.code_interpreter_call.completed``. Required.""" - 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.""" - - @overload - def __init__( - self, - *, - sequence_number: int, - output_index: int, - item_id: str, + usage: Optional["_models.ResponseUsage"] = None, + conversation: Optional["_models.ConversationReference"] = None, + agent: Optional["_models.AgentId"] = None, + structured_inputs: Optional[dict[str, Any]] = None, ) -> None: ... @overload @@ -10621,41 +13652,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_CODE_INTERPRETER_CALL_COMPLETED # type: ignore + self.object: Literal["response"] = "response" -class ResponseCodeInterpreterCallInProgressEvent( - ResponseStreamEvent, discriminator="response.code_interpreter_call.in_progress" -): # pylint: disable=name-too-long - """Emitted when a code interpreter call is in progress. +class ResponseAudioDeltaEvent(_Model): + """Emitted when there is a partial audio response. - :ivar sequence_number: The sequence number for this event. Required. + :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 type: The type of the event. Always ``response.code_interpreter_call.in_progress``. - Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CODE_INTERPRETER_CALL_IN_PROGRESS - :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 delta: A chunk of Base64 encoded response audio bytes. Required. + :vartype delta: bytes """ - type: Literal[ResponseStreamEventType.RESPONSE_CODE_INTERPRETER_CALL_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.code_interpreter_call.in_progress``. Required.""" - 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.""" + 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, - output_index: int, - item_id: str, + delta: bytes, ) -> None: ... @overload @@ -10667,41 +13692,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_CODE_INTERPRETER_CALL_IN_PROGRESS # type: ignore + self.type: Literal["response.audio.delta"] = "response.audio.delta" -class ResponseCodeInterpreterCallInterpretingEvent( - ResponseStreamEvent, discriminator="response.code_interpreter_call.interpreting" -): # pylint: disable=name-too-long - """Emitted when the code interpreter is actively interpreting the code snippet. +class ResponseAudioDoneEvent(_Model): + """Emitted when the audio response is complete. - :ivar sequence_number: The sequence number for this event. Required. + :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 - :ivar type: The type of the event. Always ``response.code_interpreter_call.interpreting``. - Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CODE_INTERPRETER_CALL_INTERPRETING - :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 """ - type: Literal[ResponseStreamEventType.RESPONSE_CODE_INTERPRETER_CALL_INTERPRETING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.code_interpreter_call.interpreting``. Required.""" - 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.""" + 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, - output_index: int, - item_id: str, ) -> None: ... @overload @@ -10713,31 +13727,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_CODE_INTERPRETER_CALL_INTERPRETING # type: ignore + self.type: Literal["response.audio.done"] = "response.audio.done" -class ResponseCompletedEvent(ResponseStreamEvent, discriminator="response.completed"): - """Emitted when the model response is complete. +class ResponseAudioTranscriptDeltaEvent(_Model): + """Emitted when there is a partial transcript of audio. - :ivar sequence_number: The sequence number for this event. Required. + :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 - :ivar type: The type of the event. Always ``response.completed``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_COMPLETED - :ivar response: Properties of the completed response. Required. - :vartype response: ~azure.ai.projects.models.Response """ - type: Literal[ResponseStreamEventType.RESPONSE_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.completed``. Required.""" - response: "_models.Response" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Properties of the completed response. Required.""" + 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, - response: "_models.Response", ) -> None: ... @overload @@ -10749,46 +13769,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_COMPLETED # type: ignore + self.type: Literal["response.audio.transcript.delta"] = "response.audio.transcript.delta" -class ResponseContentPartAddedEvent(ResponseStreamEvent, discriminator="response.content_part.added"): - """Emitted when a new content part is added. +class ResponseAudioTranscriptDoneEvent(_Model): + """Emitted when the full audio transcript is completed. - :ivar sequence_number: The sequence number for this event. Required. + :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 - :ivar type: The type of the event. Always ``response.content_part.added``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CONTENT_PART_ADDED - :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.ItemContent """ - type: Literal[ResponseStreamEventType.RESPONSE_CONTENT_PART_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.content_part.added``. Required.""" - 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.ItemContent" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The content part that was added. Required.""" + 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, - item_id: str, - output_index: int, - content_index: int, - part: "_models.ItemContent", ) -> None: ... @overload @@ -10800,46 +13806,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_CONTENT_PART_ADDED # type: ignore + self.type: Literal["response.audio.transcript.done"] = "response.audio.transcript.done" -class ResponseContentPartDoneEvent(ResponseStreamEvent, discriminator="response.content_part.done"): - """Emitted when a content part is done. +class ResponseCodeInterpreterCallCodeDeltaEvent(_Model): # pylint: disable=name-too-long + """Emitted when a partial code snippet is streamed by the code interpreter. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.content_part.done``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CONTENT_PART_DONE - :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. + :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 content_index: The index of the content part that is done. Required. - :vartype content_index: int - :ivar part: The content part that is done. Required. - :vartype part: ~azure.ai.projects.models.ItemContent + :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[ResponseStreamEventType.RESPONSE_CONTENT_PART_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.content_part.done``. Required.""" - 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.""" + 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 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.""" - part: "_models.ItemContent" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The content part that is done. Required.""" + """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, *, - sequence_number: int, - item_id: str, output_index: int, - content_index: int, - part: "_models.ItemContent", + item_id: str, + delta: str, + sequence_number: int, ) -> None: ... @overload @@ -10851,24 +13860,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_CONTENT_PART_DONE # type: ignore + self.type: Literal["response.code_interpreter_call_code.delta"] = "response.code_interpreter_call_code.delta" -class ResponseConversation1(_Model): - """ResponseConversation1. +class ResponseCodeInterpreterCallCodeDoneEvent(_Model): + """Emitted when the code snippet is finalized by the code interpreter. - :ivar id: Required. - :vartype id: str + :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 """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + 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, *, - id: str, # pylint: disable=redefined-builtin + output_index: int, + item_id: str, + code: str, + sequence_number: int, ) -> None: ... @overload @@ -10880,30 +13914,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: 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 ResponseCreatedEvent(ResponseStreamEvent, discriminator="response.created"): - """An event that is emitted when a response is created. +class ResponseCodeInterpreterCallCompletedEvent(_Model): # pylint: disable=name-too-long + """Emitted when the code interpreter call is completed. - :ivar sequence_number: The sequence number for this event. Required. + :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 - :ivar type: The type of the event. Always ``response.created``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_CREATED - :ivar response: The response that was created. Required. - :vartype response: ~azure.ai.projects.models.Response """ - type: Literal[ResponseStreamEventType.RESPONSE_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.created``. Required.""" - response: "_models.Response" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The response that was created. Required.""" + 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, - response: "_models.Response", ) -> None: ... @overload @@ -10915,41 +13964,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_CREATED # type: ignore + self.type: Literal["response.code_interpreter_call.completed"] = "response.code_interpreter_call.completed" -class ResponseError(_Model): - """An error object returned when the model fails to generate a Response. +class ResponseCodeInterpreterCallInProgressEvent(_Model): # pylint: disable=name-too-long + """Emitted when a code interpreter call is in progress. - :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 + :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 """ - code: Union[str, "_models.ResponseErrorCode"] = rest_field( + type: Literal["response.code_interpreter_call.in_progress"] = 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.""" + """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, *, - code: Union[str, "_models.ResponseErrorCode"], - message: str, + output_index: int, + item_id: str, + sequence_number: int, ) -> None: ... @overload @@ -10961,40 +14014,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: 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 ResponseErrorEvent(ResponseStreamEvent, discriminator="error"): - """Emitted when an error occurs. +class ResponseCodeInterpreterCallInterpretingEvent(_Model): # pylint: disable=name-too-long + """Emitted when the code interpreter is actively interpreting the code snippet. - :ivar sequence_number: The sequence number for this event. Required. + :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 - :ivar type: The type of the event. Always ``error``. Required. - :vartype type: str or ~azure.ai.projects.models.ERROR - :ivar code: The error code. Required. - :vartype code: str - :ivar message: The error message. Required. - :vartype message: str - :ivar param: The error parameter. Required. - :vartype param: str """ - type: Literal[ResponseStreamEventType.ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``error``. Required.""" - code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The error code. 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"]) - """The error parameter. Required.""" + 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, - code: str, - message: str, - param: str, ) -> None: ... @overload @@ -11006,31 +14064,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.ERROR # type: ignore + self.type: Literal["response.code_interpreter_call.interpreting"] = ( + "response.code_interpreter_call.interpreting" + ) -class ResponseFailedEvent(ResponseStreamEvent, discriminator="response.failed"): - """An event that is emitted when a response fails. +class ResponseCompletedEvent(_Model): + """Emitted when the model response is complete. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.failed``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_FAILED - :ivar response: The response that failed. Required. + :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[ResponseStreamEventType.RESPONSE_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.failed``. Required.""" + 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"]) - """The response that failed. Required.""" + """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, *, - sequence_number: int, response: "_models.Response", + sequence_number: int, ) -> None: ... @overload @@ -11042,37 +14106,52 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_FAILED # type: ignore + self.type: Literal["response.completed"] = "response.completed" -class ResponseFileSearchCallCompletedEvent(ResponseStreamEvent, discriminator="response.file_search_call.completed"): - """Emitted when a file search call is completed (results found). +class ResponseContentPartAddedEvent(_Model): + """Emitted when a new content part is added. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.file_search_call.completed``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_FILE_SEARCH_CALL_COMPLETED - :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. + :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[ResponseStreamEventType.RESPONSE_FILE_SEARCH_CALL_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.file_search_call.completed``. Required.""" - 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.""" + 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 file search call is initiated. Required.""" + """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, *, - sequence_number: int, - output_index: int, item_id: str, + output_index: int, + content_index: int, + part: "_models.OutputContent", + sequence_number: int, ) -> None: ... @overload @@ -11084,37 +14163,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_FILE_SEARCH_CALL_COMPLETED # type: ignore + self.type: Literal["response.content_part.added"] = "response.content_part.added" -class ResponseFileSearchCallInProgressEvent(ResponseStreamEvent, discriminator="response.file_search_call.in_progress"): - """Emitted when a file search call is initiated. +class ResponseContentPartDoneEvent(_Model): + """Emitted when a content part is done. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.file_search_call.in_progress``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_FILE_SEARCH_CALL_IN_PROGRESS - :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. + :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[ResponseStreamEventType.RESPONSE_FILE_SEARCH_CALL_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.file_search_call.in_progress``. Required.""" - 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.""" + 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 file search call is initiated. Required.""" + """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, *, - sequence_number: int, - output_index: int, item_id: str, + output_index: int, + content_index: int, + sequence_number: int, + part: "_models.OutputContent", ) -> None: ... @overload @@ -11126,37 +14218,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_FILE_SEARCH_CALL_IN_PROGRESS # type: ignore + self.type: Literal["response.content_part.done"] = "response.content_part.done" -class ResponseFileSearchCallSearchingEvent(ResponseStreamEvent, discriminator="response.file_search_call.searching"): - """Emitted when a file search is currently searching. +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 - :ivar type: The type of the event. Always ``response.file_search_call.searching``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_FILE_SEARCH_CALL_SEARCHING - :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 """ - type: Literal[ResponseStreamEventType.RESPONSE_FILE_SEARCH_CALL_SEARCHING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.file_search_call.searching``. Required.""" - 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.""" + 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, - output_index: int, - item_id: str, ) -> None: ... @overload @@ -11168,44 +14258,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_FILE_SEARCH_CALL_SEARCHING # type: ignore + self.type: Literal["response.created"] = "response.created" -class ResponseFunctionCallArgumentsDeltaEvent( - ResponseStreamEvent, discriminator="response.function_call_arguments.delta" -): - """Emitted when there is a partial function-call arguments delta. +class ResponseCustomToolCallInputDeltaEvent(_Model): + """ResponseCustomToolCallInputDelta. - :ivar sequence_number: The sequence number for this event. Required. + :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 type: The type of the event. Always ``response.function_call_arguments.delta``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA - :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. + :ivar output_index: The index of the output this delta applies to. Required. :vartype output_index: int - :ivar delta: The function-call arguments delta that is added. Required. + :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[ResponseStreamEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.function_call_arguments.delta``. Required.""" - 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.""" + 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 item that the function-call arguments delta is added to. Required.""" + """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 function-call arguments delta that is added. Required.""" + """The incremental input data (delta) for the custom tool call. Required.""" @overload def __init__( self, *, sequence_number: int, - item_id: str, output_index: int, + item_id: str, delta: str, ) -> None: ... @@ -11218,43 +14310,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA # type: ignore + self.type: Literal["response.custom_tool_call_input.delta"] = "response.custom_tool_call_input.delta" -class ResponseFunctionCallArgumentsDoneEvent( - ResponseStreamEvent, discriminator="response.function_call_arguments.done" -): - """Emitted when function-call arguments are finalized. +class ResponseCustomToolCallInputDoneEvent(_Model): + """ResponseCustomToolCallInputDone. - :ivar sequence_number: The sequence number for this event. Required. + :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 type: Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item. Required. + :ivar output_index: The index of the output this event applies to. Required. :vartype output_index: int - :ivar arguments: The function-call arguments. Required. - :vartype arguments: str + :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[ResponseStreamEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" + 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 item. Required.""" - arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The function-call arguments. Required.""" + """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, - item_id: str, output_index: int, - arguments: str, + item_id: str, + input: str, ) -> None: ... @overload @@ -11266,36 +14361,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE # type: ignore + self.type: Literal["response.custom_tool_call_input.done"] = "response.custom_tool_call_input.done" -class ResponseImageGenCallCompletedEvent(ResponseStreamEvent, discriminator="response.image_generation_call.completed"): - """Emitted when an image generation tool call has completed and the final image is available. +class ResponseError(_Model): + """An error object returned when the model fails to generate a Response. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always 'response.image_generation_call.completed'. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_IMAGE_GENERATION_CALL_COMPLETED - :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 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 """ - type: Literal[ResponseStreamEventType.RESPONSE_IMAGE_GENERATION_CALL_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.image_generation_call.completed'. 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 image generation item being processed. Required.""" + 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, *, - sequence_number: int, - output_index: int, - item_id: str, + code: Union[str, "_models.ResponseErrorCode"], + message: str, ) -> None: ... @overload @@ -11307,40 +14407,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_IMAGE_GENERATION_CALL_COMPLETED # type: ignore -class ResponseImageGenCallGeneratingEvent( - ResponseStreamEvent, discriminator="response.image_generation_call.generating" -): - """Emitted when an image generation tool call is actively generating an image (intermediate - state). +class ResponseErrorEvent(_Model): + """Emitted when an error occurs. - :ivar sequence_number: The sequence number for this event. Required. + :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 - :ivar type: The type of the event. Always 'response.image_generation_call.generating'. - Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_IMAGE_GENERATION_CALL_GENERATING - :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 """ - type: Literal[ResponseStreamEventType.RESPONSE_IMAGE_GENERATION_CALL_GENERATING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.image_generation_call.generating'. 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 image generation item being processed. Required.""" + 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, - output_index: int, - item_id: str, ) -> None: ... @overload @@ -11352,39 +14454,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_IMAGE_GENERATION_CALL_GENERATING # type: ignore + self.type: Literal["error"] = "error" -class ResponseImageGenCallInProgressEvent( - ResponseStreamEvent, discriminator="response.image_generation_call.in_progress" -): - """Emitted when an image generation tool call is in progress. +class ResponseFailedEvent(_Model): + """An event that is emitted when a response fails. - :ivar sequence_number: The sequence number for this event. Required. + :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 type: The type of the event. Always 'response.image_generation_call.in_progress'. - Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_IMAGE_GENERATION_CALL_IN_PROGRESS - :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 response: The response that failed. Required. + :vartype response: ~azure.ai.projects.models.Response """ - type: Literal[ResponseStreamEventType.RESPONSE_IMAGE_GENERATION_CALL_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.image_generation_call.in_progress'. 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 image generation item being processed. Required.""" + 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, - output_index: int, - item_id: str, + response: "_models.Response", ) -> None: ... @overload @@ -11396,52 +14494,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_IMAGE_GENERATION_CALL_IN_PROGRESS # type: ignore + self.type: Literal["response.failed"] = "response.failed" -class ResponseImageGenCallPartialImageEvent( - ResponseStreamEvent, discriminator="response.image_generation_call.partial_image" -): - """Emitted when a partial image is available during image generation streaming. +class ResponseFileSearchCallCompletedEvent(_Model): + """Emitted when a file search call is completed (results found). - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always 'response.image_generation_call.partial_image'. + :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 type: str or ~azure.ai.projects.models.RESPONSE_IMAGE_GENERATION_CALL_PARTIAL_IMAGE - :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. + :ivar item_id: The ID of the output item that the file search call is initiated. Required. :vartype item_id: str - :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 + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int """ - type: Literal[ResponseStreamEventType.RESPONSE_IMAGE_GENERATION_CALL_PARTIAL_IMAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.image_generation_call.partial_image'. Required.""" + 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 in the response's output array. Required.""" + """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 unique identifier 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.""" + """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, *, - sequence_number: int, output_index: int, item_id: str, - partial_image_index: int, - partial_image_b64: str, + sequence_number: int, ) -> None: ... @overload @@ -11453,28 +14542,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_IMAGE_GENERATION_CALL_PARTIAL_IMAGE # type: ignore + self.type: Literal["response.file_search_call.completed"] = "response.file_search_call.completed" -class ResponseIncompleteDetails1(_Model): - """ResponseIncompleteDetails1. +class ResponseFileSearchCallInProgressEvent(_Model): + """Emitted when a file search call is initiated. - :ivar reason: The reason why the response is incomplete. Is either a - Literal["max_output_tokens"] type or a Literal["content_filter"] type. - :vartype reason: str or str + :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 """ - reason: Optional[Literal["max_output_tokens", "content_filter"]] = rest_field( + type: Literal["response.file_search_call.in_progress"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The reason why the response is incomplete. Is either a Literal[\"max_output_tokens\"] type or a - Literal[\"content_filter\"] type.""" + """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, *, - reason: Optional[Literal["max_output_tokens", "content_filter"]] = None, + output_index: int, + item_id: str, + sequence_number: int, ) -> None: ... @overload @@ -11486,30 +14590,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.file_search_call.in_progress"] = "response.file_search_call.in_progress" -class ResponseIncompleteEvent(ResponseStreamEvent, discriminator="response.incomplete"): - """An event that is emitted when a response finishes as incomplete. +class ResponseFileSearchCallSearchingEvent(_Model): + """Emitted when a file search is currently searching. - :ivar sequence_number: The sequence number for this event. Required. + :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 - :ivar type: The type of the event. Always ``response.incomplete``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_INCOMPLETE - :ivar response: The response that was incomplete. Required. - :vartype response: ~azure.ai.projects.models.Response """ - type: Literal[ResponseStreamEventType.RESPONSE_INCOMPLETE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.incomplete``. Required.""" - response: "_models.Response" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The response that was incomplete. Required.""" + 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, - response: "_models.Response", ) -> None: ... @overload @@ -11521,31 +14638,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_INCOMPLETE # type: ignore + self.type: Literal["response.file_search_call.searching"] = "response.file_search_call.searching" -class ResponseInProgressEvent(ResponseStreamEvent, discriminator="response.in_progress"): - """Emitted when the response is in progress. +class ResponseFormatJsonSchemaSchema(_Model): + """JSON schema.""" - :ivar sequence_number: The sequence number for this event. Required. + +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 type: The type of the event. Always ``response.in_progress``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_IN_PROGRESS - :ivar response: The response that is in progress. Required. - :vartype response: ~azure.ai.projects.models.Response + :ivar delta: The function-call arguments delta that is added. Required. + :vartype delta: str """ - type: Literal[ResponseStreamEventType.RESPONSE_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.in_progress``. Required.""" - response: "_models.Response" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The response that is in progress. Required.""" + 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, - response: "_models.Response", + delta: str, ) -> None: ... @overload @@ -11557,41 +14696,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_IN_PROGRESS # type: ignore + self.type: Literal["response.function_call_arguments.delta"] = "response.function_call_arguments.delta" -class ResponseMCPCallArgumentsDeltaEvent(ResponseStreamEvent, discriminator="response.mcp_call.arguments_delta"): - """Emitted when there is a delta (partial update) to the arguments of an MCP tool call. +class ResponseFunctionCallArgumentsDoneEvent(_Model): + """Emitted when function-call arguments are finalized. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always 'response.mcp_call.arguments_delta'. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_ARGUMENTS_DELTA - :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. + :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 delta: The partial update to the arguments for the MCP tool call. Required. - :vartype delta: any + :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[ResponseStreamEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.mcp_call.arguments_delta'. 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.""" + 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 unique identifier of the MCP tool call item being processed. Required.""" - delta: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The partial update to the arguments for the MCP tool call. Required.""" + """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, *, - sequence_number: int, - output_index: int, item_id: str, - delta: Any, + name: str, + output_index: int, + sequence_number: int, + arguments: str, ) -> None: ... @overload @@ -11603,41 +14751,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA # type: ignore + self.type: Literal["response.function_call_arguments.done"] = "response.function_call_arguments.done" -class ResponseMCPCallArgumentsDoneEvent(ResponseStreamEvent, discriminator="response.mcp_call.arguments_done"): - """Emitted when the arguments for an MCP tool call are finalized. +class ResponseImageGenCallCompletedEvent(_Model): + """ResponseImageGenCallCompletedEvent. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always 'response.mcp_call.arguments_done'. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_ARGUMENTS_DONE + :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 item_id: The unique identifier of the MCP tool call item being processed. Required. + :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 - :ivar arguments: The finalized arguments for the MCP tool call. Required. - :vartype arguments: any """ - type: Literal[ResponseStreamEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.mcp_call.arguments_done'. Required.""" + 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 MCP tool call item being processed. Required.""" - arguments: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The finalized arguments for the MCP tool call. Required.""" + """The unique identifier of the image generation item being processed. Required.""" @overload def __init__( self, *, - sequence_number: int, output_index: int, + sequence_number: int, item_id: str, - arguments: Any, ) -> None: ... @overload @@ -11649,25 +14798,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE # type: ignore + self.type: Literal["response.image_generation_call.completed"] = "response.image_generation_call.completed" -class ResponseMCPCallCompletedEvent(ResponseStreamEvent, discriminator="response.mcp_call.completed"): - """Emitted when an MCP tool call has completed successfully. +class ResponseImageGenCallGeneratingEvent(_Model): + """ResponseImageGenCallGeneratingEvent. - :ivar sequence_number: The sequence number for this event. Required. + :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 - :ivar type: The type of the event. Always 'response.mcp_call.completed'. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_COMPLETED """ - type: Literal[ResponseStreamEventType.RESPONSE_MCP_CALL_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.mcp_call.completed'. Required.""" + 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: ... @@ -11680,25 +14846,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_MCP_CALL_COMPLETED # type: ignore + self.type: Literal["response.image_generation_call.generating"] = "response.image_generation_call.generating" -class ResponseMCPCallFailedEvent(ResponseStreamEvent, discriminator="response.mcp_call.failed"): - """Emitted when an MCP tool call has failed. +class ResponseImageGenCallInProgressEvent(_Model): + """ResponseImageGenCallInProgressEvent. - :ivar sequence_number: The sequence number for this event. Required. + :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 - :ivar type: The type of the event. Always 'response.mcp_call.failed'. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_FAILED """ - type: Literal[ResponseStreamEventType.RESPONSE_MCP_CALL_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.mcp_call.failed'. Required.""" + 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: ... @@ -11711,36 +14894,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_MCP_CALL_FAILED # type: ignore + self.type: Literal["response.image_generation_call.in_progress"] = "response.image_generation_call.in_progress" -class ResponseMCPCallInProgressEvent(ResponseStreamEvent, discriminator="response.mcp_call.in_progress"): - """Emitted when an MCP tool call is in progress. +class ResponseImageGenCallPartialImageEvent(_Model): + """ResponseImageGenCallPartialImageEvent. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always 'response.mcp_call.in_progress'. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_CALL_IN_PROGRESS + :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 MCP tool call item being processed. Required. + :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[ResponseStreamEventType.RESPONSE_MCP_CALL_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.mcp_call.in_progress'. Required.""" + 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 MCP tool call item being processed. Required.""" + """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, *, - sequence_number: int, output_index: int, item_id: str, + sequence_number: int, + partial_image_index: int, + partial_image_b64: str, ) -> None: ... @overload @@ -11752,26 +14955,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_MCP_CALL_IN_PROGRESS # type: ignore + self.type: Literal["response.image_generation_call.partial_image"] = ( + "response.image_generation_call.partial_image" + ) -class ResponseMCPListToolsCompletedEvent(ResponseStreamEvent, discriminator="response.mcp_list_tools.completed"): - """Emitted when the list of available MCP tools has been successfully retrieved. +class ResponseIncompleteDetails(_Model): + """ResponseIncompleteDetails. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always 'response.mcp_list_tools.completed'. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_LIST_TOOLS_COMPLETED + :ivar reason: Is either a Literal["max_output_tokens"] type or a Literal["content_filter"] + type. + :vartype reason: str or str """ - type: Literal[ResponseStreamEventType.RESPONSE_MCP_LIST_TOOLS_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.mcp_list_tools.completed'. Required.""" + 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, *, - sequence_number: int, + reason: Optional[Literal["max_output_tokens", "content_filter"]] = None, ) -> None: ... @overload @@ -11783,25 +14989,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_MCP_LIST_TOOLS_COMPLETED # type: ignore -class ResponseMCPListToolsFailedEvent(ResponseStreamEvent, discriminator="response.mcp_list_tools.failed"): - """Emitted when the attempt to list available MCP tools has failed. +class ResponseIncompleteEvent(_Model): + """An event that is emitted when a response finishes as incomplete. - :ivar sequence_number: The sequence number for this event. Required. + :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 - :ivar type: The type of the event. Always 'response.mcp_list_tools.failed'. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_LIST_TOOLS_FAILED """ - type: Literal[ResponseStreamEventType.RESPONSE_MCP_LIST_TOOLS_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.mcp_list_tools.failed'. Required.""" + 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: ... @@ -11814,25 +15028,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_MCP_LIST_TOOLS_FAILED # type: ignore + self.type: Literal["response.incomplete"] = "response.incomplete" -class ResponseMCPListToolsInProgressEvent(ResponseStreamEvent, discriminator="response.mcp_list_tools.in_progress"): - """Emitted when the system is in the process of retrieving the list of available MCP tools. +class ResponseInProgressEvent(_Model): + """Emitted when the response is in progress. - :ivar sequence_number: The sequence number for this event. Required. + :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 - :ivar type: The type of the event. Always 'response.mcp_list_tools.in_progress'. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_MCP_LIST_TOOLS_IN_PROGRESS """ - type: Literal[ResponseStreamEventType.RESPONSE_MCP_LIST_TOOLS_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.mcp_list_tools.in_progress'. Required.""" + 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: ... @@ -11845,36 +15068,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_MCP_LIST_TOOLS_IN_PROGRESS # type: ignore + self.type: Literal["response.in_progress"] = "response.in_progress" -class ResponseOutputItemAddedEvent(ResponseStreamEvent, discriminator="response.output_item.added"): - """Emitted when a new output item is added. +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 sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.output_item.added``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_ITEM_ADDED - :ivar output_index: The index of the output item that was added. Required. - :vartype output_index: int - :ivar item: The output item that was added. Required. - :vartype item: ~azure.ai.projects.models.ItemResource + :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] """ - type: Literal[ResponseStreamEventType.RESPONSE_OUTPUT_ITEM_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.output_item.added``. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item that was added. Required.""" - item: "_models.ItemResource" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The output item that was added. Required.""" + 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, *, - sequence_number: int, - output_index: int, - item: "_models.ItemResource", + token: str, + logprob: float, + top_logprobs: Optional[list["_models.ResponseLogProbTopLogprobs"]] = None, ) -> None: ... @overload @@ -11886,36 +15111,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_OUTPUT_ITEM_ADDED # type: ignore -class ResponseOutputItemDoneEvent(ResponseStreamEvent, discriminator="response.output_item.done"): - """Emitted when an output item is marked done. +class ResponseLogProbTopLogprobs(_Model): + """ResponseLogProbTopLogprobs. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.output_item.done``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_ITEM_DONE - :ivar output_index: The index of the output item that was marked done. Required. - :vartype output_index: int - :ivar item: The output item that was marked done. Required. - :vartype item: ~azure.ai.projects.models.ItemResource + :ivar token: + :vartype token: str + :ivar logprob: + :vartype logprob: float """ - type: Literal[ResponseStreamEventType.RESPONSE_OUTPUT_ITEM_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.output_item.done``. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item that was marked done. Required.""" - item: "_models.ItemResource" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The output item that was marked done. Required.""" + 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, *, - sequence_number: int, - output_index: int, - item: "_models.ItemResource", + token: Optional[str] = None, + logprob: Optional[float] = None, ) -> None: ... @overload @@ -11926,40 +15141,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_OUTPUT_ITEM_DONE # type: ignore - - -class ResponsePromptVariables(_Model): - """Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. - - """ + super().__init__(*args, **kwargs) -class ResponseQueuedEvent(ResponseStreamEvent, discriminator="response.queued"): - """Emitted when a response is queued and waiting to be processed. +class ResponseMCPCallArgumentsDeltaEvent(_Model): + """ResponseMCPCallArgumentsDeltaEvent. - :ivar sequence_number: The sequence number for this event. Required. + :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 - :ivar type: The type of the event. Always 'response.queued'. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_QUEUED - :ivar response: The full response object that is queued. Required. - :vartype response: ~azure.ai.projects.models.Response """ - type: Literal[ResponseStreamEventType.RESPONSE_QUEUED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.queued'. Required.""" - response: "_models.Response" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The full response object that is queued. Required.""" + 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, - response: "_models.Response", ) -> None: ... @overload @@ -11971,47 +15194,48 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_QUEUED # type: ignore + self.type: Literal["response.mcp_call_arguments.delta"] = "response.mcp_call_arguments.delta" -class ResponseReasoningDeltaEvent(ResponseStreamEvent, discriminator="response.reasoning.delta"): - """Emitted when there is a delta (partial update) to the reasoning content. +class ResponseMCPCallArgumentsDoneEvent(_Model): + """ResponseMCPCallArgumentsDoneEvent. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always 'response.reasoning.delta'. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_REASONING_DELTA - :ivar item_id: The unique identifier of the item for which reasoning is being updated. - Required. - :vartype item_id: str + :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 content_index: The index of the reasoning content part within the output item. Required. - :vartype content_index: int - :ivar delta: The partial update to the reasoning content. Required. - :vartype delta: any + :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[ResponseStreamEventType.RESPONSE_REASONING_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.reasoning.delta'. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the item for which reasoning is being updated. Required.""" + 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.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the reasoning content part within the output item. Required.""" - delta: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The partial update to the reasoning content. 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, *, - sequence_number: int, - item_id: str, output_index: int, - content_index: int, - delta: Any, + item_id: str, + arguments: str, + sequence_number: int, ) -> None: ... @overload @@ -12023,46 +15247,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_REASONING_DELTA # type: ignore + self.type: Literal["response.mcp_call_arguments.done"] = "response.mcp_call_arguments.done" -class ResponseReasoningDoneEvent(ResponseStreamEvent, discriminator="response.reasoning.done"): - """Emitted when the reasoning content is finalized for an item. +class ResponseMCPCallCompletedEvent(_Model): + """ResponseMCPCallCompletedEvent. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always 'response.reasoning.done'. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_REASONING_DONE - :ivar item_id: The unique identifier of the item for which reasoning is finalized. Required. + :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 in the response's output array. Required. + :ivar output_index: The index of the output item that completed. Required. :vartype output_index: int - :ivar content_index: The index of the reasoning content part within the output item. Required. - :vartype content_index: int - :ivar text: The finalized reasoning text. Required. - :vartype text: str + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int """ - type: Literal[ResponseStreamEventType.RESPONSE_REASONING_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.reasoning.done'. Required.""" + 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 unique identifier of the item for which reasoning is finalized. Required.""" + """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 in the response's output array. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the reasoning content part within the output item. Required.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The finalized reasoning text. Required.""" + """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, *, - sequence_number: int, item_id: str, output_index: int, - content_index: int, - text: str, + sequence_number: int, ) -> None: ... @overload @@ -12074,47 +15294,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_REASONING_DONE # type: ignore + self.type: Literal["response.mcp_call.completed"] = "response.mcp_call.completed" -class ResponseReasoningSummaryDeltaEvent(ResponseStreamEvent, discriminator="response.reasoning_summary.delta"): - """Emitted when there is a delta (partial update) to the reasoning summary content. +class ResponseMCPCallFailedEvent(_Model): + """ResponseMCPCallFailedEvent. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always 'response.reasoning_summary.delta'. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_REASONING_SUMMARY_DELTA - :ivar item_id: The unique identifier of the item for which the reasoning summary is being - updated. Required. + :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 in the response's output array. Required. + :ivar output_index: The index of the output item that failed. Required. :vartype output_index: int - :ivar summary_index: The index of the summary part within the output item. Required. - :vartype summary_index: int - :ivar delta: The partial update to the reasoning summary content. Required. - :vartype delta: any + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int """ - type: Literal[ResponseStreamEventType.RESPONSE_REASONING_SUMMARY_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.reasoning_summary.delta'. Required.""" + 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 unique identifier of the item for which the reasoning summary is being updated. Required.""" + """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 in the response's output array. Required.""" - summary_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the summary part within the output item. Required.""" - delta: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The partial update to the reasoning summary content. Required.""" + """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, *, - sequence_number: int, item_id: str, output_index: int, - summary_index: int, - delta: Any, + sequence_number: int, ) -> None: ... @overload @@ -12126,47 +15339,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_REASONING_SUMMARY_DELTA # type: ignore + self.type: Literal["response.mcp_call.failed"] = "response.mcp_call.failed" -class ResponseReasoningSummaryDoneEvent(ResponseStreamEvent, discriminator="response.reasoning_summary.done"): - """Emitted when the reasoning summary content is finalized for an item. +class ResponseMCPCallInProgressEvent(_Model): + """ResponseMCPCallInProgressEvent. - :ivar sequence_number: The sequence number for this event. Required. + :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 type: The type of the event. Always 'response.reasoning_summary.done'. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_REASONING_SUMMARY_DONE - :ivar item_id: The unique identifier of the item for which the reasoning summary is finalized. - 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 summary_index: The index of the summary part within the output item. Required. - :vartype summary_index: int - :ivar text: The finalized reasoning summary text. Required. - :vartype text: str + :ivar item_id: The unique identifier of the MCP tool call item being processed. Required. + :vartype item_id: str """ - type: Literal[ResponseStreamEventType.RESPONSE_REASONING_SUMMARY_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always 'response.reasoning_summary.done'. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier of the item for which the reasoning summary is finalized. Required.""" + 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.""" - summary_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the summary part within the output item. Required.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The finalized reasoning summary text. 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, - item_id: str, output_index: int, - summary_index: int, - text: str, + item_id: str, ) -> None: ... @overload @@ -12178,49 +15386,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_REASONING_SUMMARY_DONE # type: ignore + self.type: Literal["response.mcp_call.in_progress"] = "response.mcp_call.in_progress" -class ResponseReasoningSummaryPartAddedEvent( - ResponseStreamEvent, discriminator="response.reasoning_summary_part.added" -): - """Emitted when a new reasoning summary part is added. +class ResponseMCPListToolsCompletedEvent(_Model): + """ResponseMCPListToolsCompletedEvent. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.reasoning_summary_part.added``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_REASONING_SUMMARY_PART_ADDED - :ivar item_id: The ID of the item this summary part is associated with. Required. + :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 this summary part is associated with. - Required. + :ivar output_index: The index of the output item that was processed. Required. :vartype output_index: int - :ivar summary_index: The index of the summary part within the reasoning summary. Required. - :vartype summary_index: int - :ivar part: The summary part that was added. Required. - :vartype part: ~azure.ai.projects.models.ReasoningItemSummaryPart + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int """ - type: Literal[ResponseStreamEventType.RESPONSE_REASONING_SUMMARY_PART_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.reasoning_summary_part.added``. Required.""" + 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 item this summary part is associated with. Required.""" + """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 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.""" - part: "_models.ReasoningItemSummaryPart" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The summary part that was added. Required.""" + """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, *, - sequence_number: int, item_id: str, output_index: int, - summary_index: int, - part: "_models.ReasoningItemSummaryPart", + sequence_number: int, ) -> None: ... @overload @@ -12232,47 +15433,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_REASONING_SUMMARY_PART_ADDED # type: ignore + self.type: Literal["response.mcp_list_tools.completed"] = "response.mcp_list_tools.completed" -class ResponseReasoningSummaryPartDoneEvent(ResponseStreamEvent, discriminator="response.reasoning_summary_part.done"): - """Emitted when a reasoning summary part is completed. +class ResponseMCPListToolsFailedEvent(_Model): + """ResponseMCPListToolsFailedEvent. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.reasoning_summary_part.done``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_REASONING_SUMMARY_PART_DONE - :ivar item_id: The ID of the item this summary part is associated with. Required. + :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 this summary part is associated with. - Required. + :ivar output_index: The index of the output item that failed. Required. :vartype output_index: int - :ivar summary_index: The index of the summary part within the reasoning summary. Required. - :vartype summary_index: int - :ivar part: The completed summary part. Required. - :vartype part: ~azure.ai.projects.models.ReasoningItemSummaryPart + :ivar sequence_number: The sequence number of this event. Required. + :vartype sequence_number: int """ - type: Literal[ResponseStreamEventType.RESPONSE_REASONING_SUMMARY_PART_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.reasoning_summary_part.done``. Required.""" + 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 item this summary part is associated with. Required.""" + """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 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.""" - part: "_models.ReasoningItemSummaryPart" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The completed summary part. Required.""" + """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, *, - sequence_number: int, item_id: str, output_index: int, - summary_index: int, - part: "_models.ReasoningItemSummaryPart", + sequence_number: int, ) -> None: ... @overload @@ -12284,49 +15480,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_REASONING_SUMMARY_PART_DONE # type: ignore + self.type: Literal["response.mcp_list_tools.failed"] = "response.mcp_list_tools.failed" -class ResponseReasoningSummaryTextDeltaEvent( - ResponseStreamEvent, discriminator="response.reasoning_summary_text.delta" -): - """Emitted when a delta is added to a reasoning summary text. +class ResponseMCPListToolsInProgressEvent(_Model): + """ResponseMCPListToolsInProgressEvent. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.reasoning_summary_text.delta``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_REASONING_SUMMARY_TEXT_DELTA - :ivar item_id: The ID of the item this summary text delta is associated with. Required. + :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 this summary text delta is associated with. - Required. + :ivar output_index: The index of the output item that is being processed. 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[ResponseStreamEventType.RESPONSE_REASONING_SUMMARY_TEXT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.reasoning_summary_text.delta``. Required.""" + 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 item this summary text delta is associated with. Required.""" + """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 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.""" + """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, *, - sequence_number: int, item_id: str, output_index: int, - summary_index: int, - delta: str, + sequence_number: int, ) -> None: ... @overload @@ -12338,47 +15527,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_REASONING_SUMMARY_TEXT_DELTA # type: ignore + self.type: Literal["response.mcp_list_tools.in_progress"] = "response.mcp_list_tools.in_progress" -class ResponseReasoningSummaryTextDoneEvent(ResponseStreamEvent, discriminator="response.reasoning_summary_text.done"): - """Emitted when a reasoning summary text is completed. +class ResponseOutputItemAddedEvent(_Model): + """Emitted when a new output item is added. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.reasoning_summary_text.done``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_REASONING_SUMMARY_TEXT_DONE - :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. + :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 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 + :ivar item: The output item that was added. Required. + :vartype item: ~azure.ai.projects.models.OutputItem """ - type: Literal[ResponseStreamEventType.RESPONSE_REASONING_SUMMARY_TEXT_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.reasoning_summary_text.done``. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item this summary text is associated with. Required.""" + 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 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.""" + """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, *, - sequence_number: int, - item_id: str, output_index: int, - summary_index: int, - text: str, + sequence_number: int, + item: "_models.OutputItem", ) -> None: ... @overload @@ -12390,46 +15572,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_REASONING_SUMMARY_TEXT_DONE # type: ignore + self.type: Literal["response.output_item.added"] = "response.output_item.added" -class ResponseRefusalDeltaEvent(ResponseStreamEvent, discriminator="response.refusal.delta"): - """Emitted when there is a partial refusal text. +class ResponseOutputItemDoneEvent(_Model): + """Emitted when an output item is marked done. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.refusal.delta``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_REFUSAL_DELTA - :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. + :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 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 + :ivar item: The output item that was marked done. Required. + :vartype item: ~azure.ai.projects.models.OutputItem """ - type: Literal[ResponseStreamEventType.RESPONSE_REFUSAL_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.refusal.delta``. Required.""" - 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.""" + 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 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.""" + """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, *, - sequence_number: int, - item_id: str, output_index: int, - content_index: int, - delta: str, + sequence_number: int, + item: "_models.OutputItem", ) -> None: ... @overload @@ -12441,47 +15617,59 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_REFUSAL_DELTA # type: ignore + self.type: Literal["response.output_item.done"] = "response.output_item.done" -class ResponseRefusalDoneEvent(ResponseStreamEvent, discriminator="response.refusal.done"): - """Emitted when refusal text is finalized. +class ResponseOutputTextAnnotationAddedEvent(_Model): + """ResponseOutputTextAnnotationAddedEvent. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.refusal.done``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_REFUSAL_DONE - :ivar item_id: The ID of the output item that the refusal text is finalized. Required. + :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 that the refusal text is finalized. Required. + :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 that the refusal text is finalized. - Required. + :ivar content_index: The index of the content part within the output item. Required. :vartype content_index: int - :ivar refusal: The refusal text that is finalized. Required. - :vartype refusal: str + :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[ResponseStreamEventType.RESPONSE_REFUSAL_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.refusal.done``. Required.""" + 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 ID of the output item that the refusal text is finalized. Required.""" + """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 that the refusal text is finalized. Required.""" + """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 that the refusal text is finalized. Required.""" - refusal: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The refusal text that is finalized. Required.""" + """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, *, - sequence_number: int, item_id: str, output_index: int, content_index: int, - refusal: str, + annotation_index: int, + sequence_number: int, + annotation: "_models.Annotation", ) -> None: ... @overload @@ -12493,36 +15681,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_REFUSAL_DONE # type: ignore + self.type: Literal["response.output_text.annotation.added"] = "response.output_text.annotation.added" -class ResponsesMessageItemParam(ItemParam, discriminator="message"): - """A response message item, representing a role and content, as provided as client request - parameters. +class ResponsePromptVariables(_Model): + """Prompt Variables.""" - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ResponsesAssistantMessageItemParam, ResponsesDeveloperMessageItemParam, - ResponsesSystemMessageItemParam, ResponsesUserMessageItemParam - :ivar type: The type of the responses item, which is always 'message'. Required. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :ivar role: The role associated with the message. Required. Known values are: "system", - "developer", "user", and "assistant". - :vartype role: str or ~azure.ai.projects.models.ResponsesMessageRole +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 """ - __mapping__: dict[str, _Model] = {} - type: Literal[ItemType.MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the responses item, which is always 'message'. Required.""" - role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) - """The role associated with the message. Required. Known values are: \"system\", \"developer\", - \"user\", and \"assistant\".""" + 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, *, - role: str, + response: "_models.Response", + sequence_number: int, ) -> None: ... @overload @@ -12534,35 +15725,55 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.MESSAGE # type: ignore + self.type: Literal["response.queued"] = "response.queued" -class ResponsesAssistantMessageItemParam(ResponsesMessageItemParam, discriminator="assistant"): - """A message parameter item with the ``assistant`` role. +class ResponseReasoningSummaryPartAddedEvent(_Model): + """Emitted when a new reasoning summary part is added. - :ivar type: The type of the responses item, which is always 'message'. Required. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :ivar role: The role of the message, which is always ``assistant``. Required. - :vartype role: str or ~azure.ai.projects.models.ASSISTANT - :ivar content: The content associated with the message. Required. Is either a str type or a - [ItemContent] type. - :vartype content: str or list[~azure.ai.projects.models.ItemContent] + :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 """ - __mapping__: dict[str, _Model] = {} - role: Literal[ResponsesMessageRole.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The role of the message, which is always ``assistant``. Required.""" - content: Union["str", list["_models.ItemContent"]] = rest_field( + 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 content associated with the message. Required. Is either a str type or a [ItemContent] - type.""" + """The summary part that was added. Required.""" @overload def __init__( self, *, - content: Union[str, list["_models.ItemContent"]], + item_id: str, + output_index: int, + summary_index: int, + sequence_number: int, + part: "_models.ResponseReasoningSummaryPartAddedEventPart", ) -> None: ... @overload @@ -12574,53 +15785,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = ResponsesMessageRole.ASSISTANT # type: ignore + self.type: Literal["response.reasoning_summary_part.added"] = "response.reasoning_summary_part.added" -class ResponsesMessageItemResource(ItemResource, discriminator="message"): - """A response message resource item, representing a role and content, as provided on service - responses. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ResponsesAssistantMessageItemResource, ResponsesDeveloperMessageItemResource, - ResponsesSystemMessageItemResource, ResponsesUserMessageItemResource +class ResponseReasoningSummaryPartAddedEventPart(_Model): # pylint: disable=name-too-long + """ResponseReasoningSummaryPartAddedEventPart. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: The type of the responses item, which is always 'message'. Required. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :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 - :ivar role: The role associated with the message. Required. Known values are: "system", - "developer", "user", and "assistant". - :vartype role: str or ~azure.ai.projects.models.ResponsesMessageRole + :ivar type: Required. Default value is "summary_text". + :vartype type: str + :ivar text: Required. + :vartype text: str """ - __mapping__: dict[str, _Model] = {} - type: Literal[ItemType.MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the responses item, which is always 'message'. 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\"]""" - role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) - """The role associated with the message. Required. Known values are: \"system\", \"developer\", - \"user\", and \"assistant\".""" + 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, *, - id: str, # pylint: disable=redefined-builtin - status: Literal["in_progress", "completed", "incomplete"], - role: str, - created_by: Optional["_models.CreatedBy"] = None, + text: str, ) -> None: ... @overload @@ -12632,42 +15818,55 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.MESSAGE # type: ignore + self.type: Literal["summary_text"] = "summary_text" -class ResponsesAssistantMessageItemResource(ResponsesMessageItemResource, discriminator="assistant"): - """A message resource item with the ``assistant`` role. +class ResponseReasoningSummaryPartDoneEvent(_Model): + """Emitted when a reasoning summary part is completed. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: The type of the responses item, which is always 'message'. Required. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :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 - :ivar role: The role of the message, which is always ``assistant``. Required. - :vartype role: str or ~azure.ai.projects.models.ASSISTANT - :ivar content: The content associated with the message. Required. - :vartype content: list[~azure.ai.projects.models.ItemContent] + :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 """ - __mapping__: dict[str, _Model] = {} - role: Literal[ResponsesMessageRole.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The role of the message, which is always ``assistant``. Required.""" - content: list["_models.ItemContent"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The content associated with the message. Required.""" + type: Literal["response.reasoning_summary_part.done"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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"] + ) + """The completed summary part. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - status: Literal["in_progress", "completed", "incomplete"], - content: list["_models.ItemContent"], - created_by: Optional["_models.CreatedBy"] = None, + item_id: str, + output_index: int, + summary_index: int, + sequence_number: int, + part: "_models.ResponseReasoningSummaryPartDoneEventPart", ) -> None: ... @overload @@ -12679,35 +15878,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = ResponsesMessageRole.ASSISTANT # type: ignore + self.type: Literal["response.reasoning_summary_part.done"] = "response.reasoning_summary_part.done" -class ResponsesDeveloperMessageItemParam(ResponsesMessageItemParam, discriminator="developer"): - """A message parameter item with the ``developer`` role. +class ResponseReasoningSummaryPartDoneEventPart(_Model): # pylint: disable=name-too-long + """ResponseReasoningSummaryPartDoneEventPart. - :ivar type: The type of the responses item, which is always 'message'. Required. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :ivar role: The role of the message, which is always ``developer``. Required. - :vartype role: str or ~azure.ai.projects.models.DEVELOPER - :ivar content: The content associated with the message. Required. Is either a str type or a - [ItemContent] type. - :vartype content: str or list[~azure.ai.projects.models.ItemContent] + :ivar type: Required. Default value is "summary_text". + :vartype type: str + :ivar text: Required. + :vartype text: str """ - __mapping__: dict[str, _Model] = {} - role: Literal[ResponsesMessageRole.DEVELOPER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The role of the message, which is always ``developer``. Required.""" - content: Union["str", list["_models.ItemContent"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The content associated with the message. Required. Is either a str type or a [ItemContent] - type.""" + 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, *, - content: Union[str, list["_models.ItemContent"]], + text: str, ) -> None: ... @overload @@ -12719,42 +15911,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = ResponsesMessageRole.DEVELOPER # type: ignore + self.type: Literal["summary_text"] = "summary_text" -class ResponsesDeveloperMessageItemResource(ResponsesMessageItemResource, discriminator="developer"): - """A message resource item with the ``developer`` role. +class ResponseReasoningSummaryTextDeltaEvent(_Model): + """Emitted when a delta is added to a reasoning summary text. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: The type of the responses item, which is always 'message'. Required. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :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 - :ivar role: The role of the message, which is always ``developer``. Required. - :vartype role: str or ~azure.ai.projects.models.DEVELOPER - :ivar content: The content associated with the message. Required. - :vartype content: list[~azure.ai.projects.models.ItemContent] + :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 """ - __mapping__: dict[str, _Model] = {} - role: Literal[ResponsesMessageRole.DEVELOPER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The role of the message, which is always ``developer``. Required.""" - content: list["_models.ItemContent"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The content associated with the message. Required.""" + type: Literal["response.reasoning_summary_text.delta"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, *, - id: str, # pylint: disable=redefined-builtin - status: Literal["in_progress", "completed", "incomplete"], - content: list["_models.ItemContent"], - created_by: Optional["_models.CreatedBy"] = None, + item_id: str, + output_index: int, + summary_index: int, + delta: str, + sequence_number: int, ) -> None: ... @overload @@ -12766,35 +15969,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = ResponsesMessageRole.DEVELOPER # type: ignore + self.type: Literal["response.reasoning_summary_text.delta"] = "response.reasoning_summary_text.delta" -class ResponsesSystemMessageItemParam(ResponsesMessageItemParam, discriminator="system"): - """A message parameter item with the ``system`` role. +class ResponseReasoningSummaryTextDoneEvent(_Model): + """Emitted when a reasoning summary text is completed. - :ivar type: The type of the responses item, which is always 'message'. Required. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :ivar role: The role of the message, which is always ``system``. Required. - :vartype role: str or ~azure.ai.projects.models.SYSTEM - :ivar content: The content associated with the message. Required. Is either a str type or a - [ItemContent] type. - :vartype content: str or list[~azure.ai.projects.models.ItemContent] + :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 """ - __mapping__: dict[str, _Model] = {} - role: Literal[ResponsesMessageRole.SYSTEM] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The role of the message, which is always ``system``. Required.""" - content: Union["str", list["_models.ItemContent"]] = rest_field( + type: Literal["response.reasoning_summary_text.done"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The content associated with the message. Required. Is either a str type or a [ItemContent] - type.""" + """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, *, - content: Union[str, list["_models.ItemContent"]], + item_id: str, + output_index: int, + summary_index: int, + text: str, + sequence_number: int, ) -> None: ... @overload @@ -12806,42 +16027,54 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = ResponsesMessageRole.SYSTEM # type: ignore + self.type: Literal["response.reasoning_summary_text.done"] = "response.reasoning_summary_text.done" -class ResponsesSystemMessageItemResource(ResponsesMessageItemResource, discriminator="system"): - """A message resource item with the ``system`` role. +class ResponseReasoningTextDeltaEvent(_Model): + """Emitted when a delta is added to a reasoning text. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: The type of the responses item, which is always 'message'. Required. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :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 - :ivar role: The role of the message, which is always ``system``. Required. - :vartype role: str or ~azure.ai.projects.models.SYSTEM - :ivar content: The content associated with the message. Required. - :vartype content: list[~azure.ai.projects.models.ItemContent] + :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 """ - __mapping__: dict[str, _Model] = {} - role: Literal[ResponsesMessageRole.SYSTEM] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The role of the message, which is always ``system``. Required.""" - content: list["_models.ItemContent"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The content associated with the message. 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, *, - id: str, # pylint: disable=redefined-builtin - status: Literal["in_progress", "completed", "incomplete"], - content: list["_models.ItemContent"], - created_by: Optional["_models.CreatedBy"] = None, + item_id: str, + output_index: int, + content_index: int, + delta: str, + sequence_number: int, ) -> None: ... @overload @@ -12853,35 +16086,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = ResponsesMessageRole.SYSTEM # type: ignore + self.type: Literal["response.reasoning_text.delta"] = "response.reasoning_text.delta" -class ResponsesUserMessageItemParam(ResponsesMessageItemParam, discriminator="user"): - """A message parameter item with the ``user`` role. +class ResponseReasoningTextDoneEvent(_Model): + """Emitted when a reasoning text is completed. - :ivar type: The type of the responses item, which is always 'message'. Required. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :ivar role: The role of the message, which is always ``user``. Required. - :vartype role: str or ~azure.ai.projects.models.USER - :ivar content: The content associated with the message. Required. Is either a str type or a - [ItemContent] type. - :vartype content: str or list[~azure.ai.projects.models.ItemContent] + :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 """ - __mapping__: dict[str, _Model] = {} - role: Literal[ResponsesMessageRole.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The role of the message, which is always ``user``. Required.""" - content: Union["str", list["_models.ItemContent"]] = rest_field( + type: Literal["response.reasoning_text.done"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The content associated with the message. Required. Is either a str type or a [ItemContent] - type.""" + """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, *, - content: Union[str, list["_models.ItemContent"]], + item_id: str, + output_index: int, + content_index: int, + text: str, + sequence_number: int, ) -> None: ... @overload @@ -12893,42 +16144,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = ResponsesMessageRole.USER # type: ignore + self.type: Literal["response.reasoning_text.done"] = "response.reasoning_text.done" -class ResponsesUserMessageItemResource(ResponsesMessageItemResource, discriminator="user"): - """A message resource item with the ``user`` role. +class ResponseRefusalDeltaEvent(_Model): + """Emitted when there is a partial refusal text. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: The type of the responses item, which is always 'message'. Required. - :vartype type: str or ~azure.ai.projects.models.MESSAGE - :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 - :ivar role: The role of the message, which is always ``user``. Required. - :vartype role: str or ~azure.ai.projects.models.USER - :ivar content: The content associated with the message. Required. - :vartype content: list[~azure.ai.projects.models.ItemContent] + :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 """ - __mapping__: dict[str, _Model] = {} - role: Literal[ResponsesMessageRole.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The role of the message, which is always ``user``. Required.""" - content: list["_models.ItemContent"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The content associated with the message. Required.""" + 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, *, - id: str, # pylint: disable=redefined-builtin - status: Literal["in_progress", "completed", "incomplete"], - content: list["_models.ItemContent"], - created_by: Optional["_models.CreatedBy"] = None, + item_id: str, + output_index: int, + content_index: int, + delta: str, + sequence_number: int, ) -> None: ... @overload @@ -12940,25 +16199,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = ResponsesMessageRole.USER # type: ignore + self.type: Literal["response.refusal.delta"] = "response.refusal.delta" -class ResponseText(_Model): - """ResponseText. +class ResponseRefusalDoneEvent(_Model): + """Emitted when refusal text is finalized. - :ivar format: - :vartype format: ~azure.ai.projects.models.ResponseTextFormatConfiguration + :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 """ - format: Optional["_models.ResponseTextFormatConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + 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, *, - format: Optional["_models.ResponseTextFormatConfiguration"] = None, + item_id: str, + output_index: int, + content_index: int, + refusal: str, + sequence_number: int, ) -> None: ... @overload @@ -12970,15 +16255,15 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["response.refusal.done"] = "response.refusal.done" -class ResponseTextDeltaEvent(ResponseStreamEvent, discriminator="response.output_text.delta"): +class ResponseTextDeltaEvent(_Model): """Emitted when there is an additional text delta. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.output_text.delta``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_TEXT_DELTA + :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. @@ -12987,10 +16272,15 @@ class ResponseTextDeltaEvent(ResponseStreamEvent, discriminator="response.output :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] """ - type: Literal[ResponseStreamEventType.RESPONSE_OUTPUT_TEXT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.output_text.delta``. 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"]) @@ -12999,16 +16289,21 @@ class ResponseTextDeltaEvent(ResponseStreamEvent, discriminator="response.output """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, *, - sequence_number: int, item_id: str, output_index: int, content_index: int, delta: str, + sequence_number: int, + logprobs: list["_models.ResponseLogProb"], ) -> None: ... @overload @@ -13020,16 +16315,15 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_OUTPUT_TEXT_DELTA # type: ignore + self.type: Literal["response.output_text.delta"] = "response.output_text.delta" -class ResponseTextDoneEvent(ResponseStreamEvent, discriminator="response.output_text.done"): +class ResponseTextDoneEvent(_Model): """Emitted when text content is finalized. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int - :ivar type: The type of the event. Always ``response.output_text.done``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_OUTPUT_TEXT_DONE + :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. @@ -13039,10 +16333,15 @@ class ResponseTextDoneEvent(ResponseStreamEvent, discriminator="response.output_ :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[ResponseStreamEventType.RESPONSE_OUTPUT_TEXT_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.output_text.done``. Required.""" + 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"]) @@ -13051,16 +16350,21 @@ class ResponseTextDoneEvent(ResponseStreamEvent, discriminator="response.output_ """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, *, - sequence_number: int, item_id: str, output_index: int, content_index: int, text: str, + sequence_number: int, + logprobs: list["_models.ResponseLogProb"], ) -> None: ... @overload @@ -13072,29 +16376,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_OUTPUT_TEXT_DONE # type: ignore + self.type: Literal["response.output_text.done"] = "response.output_text.done" -class ResponseTextFormatConfiguration(_Model): - """ResponseTextFormatConfiguration. +class ResponseTextParam(_Model): + """Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ResponseTextFormatConfigurationJsonObject, ResponseTextFormatConfigurationJsonSchema, - ResponseTextFormatConfigurationText + * [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + * [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - :ivar type: Required. Known values are: "text", "json_schema", and "json_object". - :vartype type: str or ~azure.ai.projects.models.ResponseTextFormatConfigurationType + :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 """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"text\", \"json_schema\", and \"json_object\".""" + format: Optional["_models.TextResponseFormatConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + verbosity: Optional[Literal["low", "medium", "high"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"]""" @overload def __init__( self, *, - type: str, + format: Optional["_models.TextResponseFormatConfiguration"] = None, + verbosity: Optional[Literal["low", "medium", "high"]] = None, ) -> None: ... @overload @@ -13108,21 +16420,46 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ResponseTextFormatConfigurationJsonObject( - ResponseTextFormatConfiguration, discriminator="json_object" -): # pylint: disable=name-too-long - """ResponseTextFormatConfigurationJsonObject. +class ResponseUsage(_Model): + """Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.JSON_OBJECT + :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 """ - type: Literal[ResponseTextFormatConfigurationType.JSON_OBJECT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" + input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of input tokens. Required.""" + input_tokens_details: "_models.ResponseUsageInputTokensDetails" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A detailed breakdown of the input tokens. Required.""" + output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of output tokens. Required.""" + output_tokens_details: "_models.ResponseUsageOutputTokensDetails" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A detailed breakdown of the output tokens. Required.""" + total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The total number of tokens used. Required.""" @overload def __init__( self, + *, + input_tokens: int, + input_tokens_details: "_models.ResponseUsageInputTokensDetails", + output_tokens: int, + output_tokens_details: "_models.ResponseUsageOutputTokensDetails", + total_tokens: int, ) -> None: ... @overload @@ -13134,59 +16471,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseTextFormatConfigurationType.JSON_OBJECT # type: ignore -class ResponseTextFormatConfigurationJsonSchema( - ResponseTextFormatConfiguration, discriminator="json_schema" -): # pylint: disable=name-too-long - """JSON Schema response format. Used to generate structured JSON responses. - Learn more about `Structured Outputs - `_. +class ResponseUsageInputTokensDetails(_Model): + """ResponseUsageInputTokensDetails. - :ivar type: The type of response format being defined. Always ``json_schema``. Required. - :vartype type: str or ~azure.ai.projects.models.JSON_SCHEMA - :ivar description: A description of what the response format is for, used by the model to - determine how to respond in the format. - :vartype description: str - :ivar name: The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. Required. - :vartype name: str - :ivar schema: Required. - :vartype schema: dict[str, any] - :ivar strict: Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the ``schema`` field. Only a subset of JSON Schema is supported when - ``strict`` is ``true``. To learn more, read the `Structured Outputs - guide `_. - :vartype strict: bool + :ivar cached_tokens: Required. + :vartype cached_tokens: int """ - type: Literal[ResponseTextFormatConfigurationType.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.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A description of what the response format is for, used by the model to - determine how to respond in the format.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. Required.""" - schema: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + cached_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" - strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the ``schema`` field. Only a subset of JSON Schema is supported when - ``strict`` is ``true``. To learn more, read the `Structured Outputs - guide `_.""" @overload def __init__( self, *, - name: str, - schema: dict[str, Any], - description: Optional[str] = None, - strict: Optional[bool] = None, + cached_tokens: int, ) -> None: ... @overload @@ -13198,78 +16499,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseTextFormatConfigurationType.JSON_SCHEMA # type: ignore -class ResponseTextFormatConfigurationText(ResponseTextFormatConfiguration, discriminator="text"): - """ResponseTextFormatConfigurationText. +class ResponseUsageOutputTokensDetails(_Model): + """ResponseUsageOutputTokensDetails. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.TEXT + :ivar reasoning_tokens: Required. + :vartype reasoning_tokens: int """ - type: Literal[ResponseTextFormatConfigurationType.TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + reasoning_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" - @overload - def __init__( - self, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ResponseTextFormatConfigurationType.TEXT # type: ignore - - -class ResponseUsage(_Model): - """Represents token usage details including input tokens, output tokens, - a breakdown of output tokens, and the total tokens used. - - :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.MemoryStoreOperationUsageInputTokensDetails - :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.MemoryStoreOperationUsageOutputTokensDetails - :ivar total_tokens: The total number of tokens used. Required. - :vartype total_tokens: int - """ - - input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of input tokens. Required.""" - input_tokens_details: "_models.MemoryStoreOperationUsageInputTokensDetails" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A detailed breakdown of the input tokens. Required.""" - output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The number of output tokens. Required.""" - output_tokens_details: "_models.MemoryStoreOperationUsageOutputTokensDetails" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """A detailed breakdown of the output tokens. Required.""" - total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The total number of tokens used. Required.""" - @overload def __init__( self, *, - input_tokens: int, - input_tokens_details: "_models.MemoryStoreOperationUsageInputTokensDetails", - output_tokens: int, - output_tokens_details: "_models.MemoryStoreOperationUsageOutputTokensDetails", - total_tokens: int, + reasoning_tokens: int, ) -> None: ... @overload @@ -13283,34 +16529,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ResponseWebSearchCallCompletedEvent(ResponseStreamEvent, discriminator="response.web_search_call.completed"): - """Note: web_search is not yet available via Azure OpenAI. +class ResponseWebSearchCallCompletedEvent(_Model): + """Emitted when a web search call is completed. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int :ivar type: The type of the event. Always ``response.web_search_call.completed``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_WEB_SEARCH_CALL_COMPLETED + 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 """ - type: Literal[ResponseStreamEventType.RESPONSE_WEB_SEARCH_CALL_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.web_search_call.completed``. Required.""" + type: Literal["response.web_search_call.completed"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """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, *, - sequence_number: int, output_index: int, item_id: str, + sequence_number: int, ) -> None: ... @overload @@ -13322,37 +16574,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_WEB_SEARCH_CALL_COMPLETED # type: ignore + self.type: Literal["response.web_search_call.completed"] = "response.web_search_call.completed" -class ResponseWebSearchCallInProgressEvent(ResponseStreamEvent, discriminator="response.web_search_call.in_progress"): - """Note: web_search is not yet available via Azure OpenAI. +class ResponseWebSearchCallInProgressEvent(_Model): + """Emitted when a web search call is initiated. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int :ivar type: The type of the event. Always ``response.web_search_call.in_progress``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS + 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 """ - type: Literal[ResponseStreamEventType.RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.web_search_call.in_progress``. 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, *, - sequence_number: int, output_index: int, item_id: str, + sequence_number: int, ) -> None: ... @overload @@ -13364,37 +16622,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS # type: ignore + self.type: Literal["response.web_search_call.in_progress"] = "response.web_search_call.in_progress" -class ResponseWebSearchCallSearchingEvent(ResponseStreamEvent, discriminator="response.web_search_call.searching"): - """Note: web_search is not yet available via Azure OpenAI. +class ResponseWebSearchCallSearchingEvent(_Model): + """Emitted when a web search call is executing. - :ivar sequence_number: The sequence number for this event. Required. - :vartype sequence_number: int :ivar type: The type of the event. Always ``response.web_search_call.searching``. Required. - :vartype type: str or ~azure.ai.projects.models.RESPONSE_WEB_SEARCH_CALL_SEARCHING + 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 """ - type: Literal[ResponseStreamEventType.RESPONSE_WEB_SEARCH_CALL_SEARCHING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the event. Always ``response.web_search_call.searching``. 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, *, - sequence_number: int, output_index: int, item_id: str, + sequence_number: int, ) -> None: ... @overload @@ -13406,7 +16670,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStreamEventType.RESPONSE_WEB_SEARCH_CALL_SEARCHING # type: ignore + self.type: Literal["response.web_search_call.searching"] = "response.web_search_call.searching" class SASCredentials(BaseCredentials, discriminator="SAS"): @@ -13554,8 +16818,86 @@ class ScheduleRun(_Model): def __init__( self, *, - schedule_id: str, - trigger_time: Optional[str] = None, + schedule_id: str, + trigger_time: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Screenshot(ComputerAction, discriminator="screenshot"): + """Screenshot. + + :ivar type: Specifies the event type. For a screenshot action, this property is + always set to ``screenshot``. Required. + :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.""" + + @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 = ComputerActionType.SCREENSHOT # type: ignore + + +class Scroll(ComputerAction, discriminator="scroll"): + """Scroll. + + :ivar type: Specifies the event type. For a scroll action, this property is + always set to ``scroll``. Required. + :vartype type: str or ~azure.ai.projects.models.SCROLL + :ivar x: The x-coordinate where the scroll occurred. Required. + :vartype x: int + :ivar y: The y-coordinate where the scroll occurred. Required. + :vartype y: int + :ivar scroll_x: The horizontal scroll distance. Required. + :vartype scroll_x: int + :ivar scroll_y: The vertical scroll distance. Required. + :vartype scroll_y: int + """ + + 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.""" + 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"]) + """The y-coordinate where the scroll occurred. Required.""" + scroll_x: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The horizontal scroll distance. Required.""" + scroll_y: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The vertical scroll distance. Required.""" + + @overload + def __init__( + self, + *, + x: int, + y: int, + scroll_x: int, + scroll_y: int, ) -> None: ... @overload @@ -13567,6 +16909,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ComputerActionType.SCROLL # type: ignore class SharepointAgentTool(Tool, discriminator="sharepoint_grounding_preview"): @@ -13638,6 +16981,101 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ToolChoiceParam(_Model): + """How the model should select which tool (or tools) to use when generating + a response. See the ``tools`` parameter to see how to specify which tools + the model can call. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ToolChoiceAllowed, SpecificApplyPatchParam, ToolChoiceCodeInterpreter, + 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. + :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.""" + + @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. + :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.""" + + @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. @@ -13730,18 +17168,17 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class StructuredOutputsItemResource(ItemResource, discriminator="structured_outputs"): """StructuredOutputsItemResource. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.STRUCTURED_OUTPUTS + :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. Default value is "structured_outputs". + :vartype type: str :ivar output: The structured output captured during the response. Required. :vartype output: any """ - type: Literal[ItemType.STRUCTURED_OUTPUTS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" + type: Literal["structured_outputs"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"structured_outputs\".""" output: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The structured output captured during the response. Required.""" @@ -13749,9 +17186,42 @@ class StructuredOutputsItemResource(ItemResource, discriminator="structured_outp def __init__( self, *, - id: str, # pylint: disable=redefined-builtin output: Any, - created_by: Optional["_models.CreatedBy"] = None, + created_by: Optional[Union["_models.CreatedBy", str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = "structured_outputs" # type: ignore + + +class Summary(_Model): + """Summary text. + + :ivar type: The type of the object. Always ``summary_text``. Required. Default value is + "summary_text". + :vartype type: str + :ivar text: A summary of the reasoning output from the model so far. Required. + :vartype text: str + """ + + type: Literal["summary_text"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the object. Always ``summary_text``. Required. Default value is \"summary_text\".""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A summary of the reasoning output from the model so far. Required.""" + + @overload + def __init__( + self, + *, + text: str, ) -> None: ... @overload @@ -13763,7 +17233,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.STRUCTURED_OUTPUTS # type: ignore + self.type: Literal["summary_text"] = "summary_text" class TaxonomyCategory(_Model): @@ -13877,23 +17347,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolChoiceObject(_Model): - """ToolChoiceObject. +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. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ToolChoiceObjectCodeInterpreter, ToolChoiceObjectComputer, ToolChoiceObjectFileSearch, - ToolChoiceObjectFunction, ToolChoiceObjectImageGen, ToolChoiceObjectMCP, - ToolChoiceObjectWebSearch + TextResponseFormatConfigurationResponseFormatJsonObject, TextResponseFormatJsonSchema, + TextResponseFormatConfigurationResponseFormatText - :ivar type: Required. Known values are: "file_search", "function", "computer_use_preview", - "web_search_preview", "image_generation", "code_interpreter", and "mcp". - :vartype type: str or ~azure.ai.projects.models.ToolChoiceObjectType + :ivar type: Required. Known values are: "text", "json_schema", and "json_object". + :vartype type: str or ~azure.ai.projects.models.TextResponseFormatConfigurationType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"file_search\", \"function\", \"computer_use_preview\", - \"web_search_preview\", \"image_generation\", \"code_interpreter\", and \"mcp\".""" + """Required. Known values are: \"text\", \"json_schema\", and \"json_object\".""" @overload def __init__( @@ -13913,14 +17388,218 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolChoiceObjectCodeInterpreter(ToolChoiceObject, discriminator="code_interpreter"): - """ToolChoiceObjectCodeInterpreter. +class TextResponseFormatConfigurationResponseFormatJsonObject( + TextResponseFormatConfiguration, discriminator="json_object" +): # pylint: disable=name-too-long + """JSON object. + + :ivar type: The type of response format being defined. Always ``json_object``. Required. + :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.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = TextResponseFormatConfigurationType.JSON_OBJECT # type: ignore + + +class TextResponseFormatConfigurationResponseFormatText( + TextResponseFormatConfiguration, discriminator="text" +): # pylint: disable=name-too-long + """Text. + + :ivar type: The type of response format being defined. Always ``text``. Required. + :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.""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = TextResponseFormatConfigurationType.TEXT # type: ignore + + +class TextResponseFormatJsonSchema(TextResponseFormatConfiguration, discriminator="json_schema"): + """JSON schema. + + :ivar type: The type of response format being defined. Always ``json_schema``. Required. + :vartype type: str or ~azure.ai.projects.models.JSON_SCHEMA + :ivar description: A description of what the response format is for, used by the model to + determine how to respond in the format. + :vartype description: str + :ivar name: The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. Required. + :vartype name: str + :ivar schema: Required. + :vartype schema: ~azure.ai.projects.models.ResponseFormatJsonSchemaSchema + :ivar strict: + :vartype strict: bool + """ + + type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of response format being defined. Always ``json_schema``. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of what the response format is for, used by the model to + determine how to respond in the format.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. Required.""" + schema: "_models.ResponseFormatJsonSchemaSchema" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required.""" + strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + name: str, + schema: "_models.ResponseFormatJsonSchemaSchema", + description: Optional[str] = None, + strict: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = TextResponseFormatConfigurationType.JSON_SCHEMA # type: ignore + + +class ToolChoiceAllowed(ToolChoiceParam, discriminator="allowed_tools"): + """Allowed tools. + + :ivar type: Allowed tool configuration type. Always ``allowed_tools``. Required. + :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.""" + 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. + :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.""" + + @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. - :vartype type: str or ~azure.ai.projects.models.CODE_INTERPRETER + :vartype type: str or ~azure.ai.projects.models.COMPUTER_USE_PREVIEW """ - type: Literal[ToolChoiceObjectType.CODE_INTERPRETER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + type: Literal[ToolChoiceParamType.COMPUTER_USE_PREVIEW] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Required.""" @overload @@ -13937,22 +17616,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceObjectType.CODE_INTERPRETER # type: ignore + self.type = ToolChoiceParamType.COMPUTER_USE_PREVIEW # type: ignore -class ToolChoiceObjectComputer(ToolChoiceObject, discriminator="computer_use_preview"): - """ToolChoiceObjectComputer. +class ToolChoiceCustom(ToolChoiceParam, discriminator="custom"): + """Custom tool. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.COMPUTER + :ivar type: For custom tool calling, the type is always ``custom``. Required. + :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[ToolChoiceObjectType.COMPUTER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" + type: Literal[ToolChoiceParamType.CUSTOM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """For custom tool calling, the type is always ``custom``. Required.""" + 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 @@ -13964,17 +17649,18 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceObjectType.COMPUTER # type: ignore + self.type = ToolChoiceParamType.CUSTOM # type: ignore -class ToolChoiceObjectFileSearch(ToolChoiceObject, discriminator="file_search"): - """ToolChoiceObjectFileSearch. +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. :vartype type: str or ~azure.ai.projects.models.FILE_SEARCH """ - type: Literal[ToolChoiceObjectType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + type: Literal[ToolChoiceParamType.FILE_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Required.""" @overload @@ -13991,11 +17677,11 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceObjectType.FILE_SEARCH # type: ignore + self.type = ToolChoiceParamType.FILE_SEARCH # type: ignore -class ToolChoiceObjectFunction(ToolChoiceObject, discriminator="function"): - """Use this option to force the model to call a specific function. +class ToolChoiceFunction(ToolChoiceParam, discriminator="function"): + """Function tool. :ivar type: For function calling, the type is always ``function``. Required. :vartype type: str or ~azure.ai.projects.models.FUNCTION @@ -14003,7 +17689,7 @@ class ToolChoiceObjectFunction(ToolChoiceObject, discriminator="function"): :vartype name: str """ - type: Literal[ToolChoiceObjectType.FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + 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.""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The name of the function to call. Required.""" @@ -14024,17 +17710,18 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceObjectType.FUNCTION # type: ignore + self.type = ToolChoiceParamType.FUNCTION # type: ignore -class ToolChoiceObjectImageGen(ToolChoiceObject, discriminator="image_generation"): - """ToolChoiceObjectImageGen. +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. :vartype type: str or ~azure.ai.projects.models.IMAGE_GENERATION """ - type: Literal[ToolChoiceObjectType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + type: Literal[ToolChoiceParamType.IMAGE_GENERATION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Required.""" @overload @@ -14051,26 +17738,25 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceObjectType.IMAGE_GENERATION # type: ignore + self.type = ToolChoiceParamType.IMAGE_GENERATION # type: ignore -class ToolChoiceObjectMCP(ToolChoiceObject, discriminator="mcp"): - """Use this option to force the model to call a specific tool on a remote MCP server. +class ToolChoiceMCP(ToolChoiceParam, discriminator="mcp"): + """MCP tool. :ivar type: For MCP tools, the type is always ``mcp``. Required. :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: The name of the tool to call on the server. + :ivar name: :vartype name: str """ - type: Literal[ToolChoiceObjectType.MCP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + 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.""" 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"]) - """The name of the tool to call on the server.""" @overload def __init__( @@ -14089,17 +17775,46 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceObjectType.MCP # type: ignore + self.type = ToolChoiceParamType.MCP # type: ignore -class ToolChoiceObjectWebSearch(ToolChoiceObject, discriminator="web_search_preview"): - """Note: web_search is not yet available via Azure OpenAI. +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. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH + :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.""" + + @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. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW2025_03_11 """ - type: Literal[ToolChoiceObjectType.WEB_SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + type: Literal[ToolChoiceParamType.WEB_SEARCH_PREVIEW2025_03_11] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Required.""" @overload @@ -14116,7 +17831,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolChoiceObjectType.WEB_SEARCH # type: ignore + self.type = ToolChoiceParamType.WEB_SEARCH_PREVIEW2025_03_11 # type: ignore class ToolDescription(_Model): @@ -14182,7 +17897,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class TopLogProb(_Model): - """The top log probability of a token. + """Top log probability. :ivar token: Required. :vartype token: str @@ -14219,6 +17934,90 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class Type(ComputerAction, discriminator="type"): + """Type. + + :ivar type: Specifies the event type. For a type action, this property is + always set to ``type``. Required. + :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.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text to type. 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 = ComputerActionType.TYPE # type: ignore + + +class UrlCitationBody(Annotation, discriminator="url_citation"): + """URL citation. + + :ivar type: The type of the URL citation. Always ``url_citation``. Required. + :vartype type: str or ~azure.ai.projects.models.URL_CITATION + :ivar url: The URL of the web resource. Required. + :vartype url: str + :ivar start_index: The index of the first character of the URL citation in the message. + Required. + :vartype start_index: int + :ivar end_index: The index of the last character of the URL citation in the message. Required. + :vartype end_index: int + :ivar title: The title of the web resource. Required. + :vartype title: str + """ + + 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.""" + 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"]) + """The index of the first character of the URL citation in the message. Required.""" + end_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the last character of the URL citation in the message. Required.""" + title: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The title of the web resource. Required.""" + + @overload + def __init__( + self, + *, + url: str, + start_index: int, + end_index: int, + title: 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 = AnnotationType.URL_CITATION # type: ignore + + class UserProfileMemoryItem(MemoryItem, discriminator="user_profile"): """A memory item specifically containing user profile information extracted from conversations, such as preferences, interests, and personal details. @@ -14272,25 +18071,21 @@ class VectorStoreFileAttributes(_Model): """ -class WebSearchAction(_Model): - """WebSearchAction. +class Wait(ComputerAction, discriminator="wait"): + """Wait. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - WebSearchActionFind, WebSearchActionOpenPage, WebSearchActionSearch - - :ivar type: Required. Known values are: "search", "open_page", and "find". - :vartype type: str or ~azure.ai.projects.models.WebSearchActionType + :ivar type: Specifies the event type. For a wait action, this property is + always set to ``wait``. Required. + :vartype type: str or ~azure.ai.projects.models.WAIT """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"search\", \"open_page\", and \"find\".""" + 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.""" @overload def __init__( self, - *, - type: str, ) -> None: ... @overload @@ -14302,21 +18097,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ComputerActionType.WAIT # type: ignore -class WebSearchActionFind(WebSearchAction, discriminator="find"): - """Action type "find": Searches for a pattern within a loaded page. +class WebSearchActionFind(_Model): + """Find action. - :ivar type: The action type. Required. - :vartype type: str or ~azure.ai.projects.models.FIND + :ivar type: The action type. Required. Default value is "find". + :vartype type: str :ivar url: The URL of the page searched for the pattern. Required. :vartype url: str :ivar pattern: The pattern or text to search for within the page. Required. :vartype pattern: str """ - type: Literal[WebSearchActionType.FIND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The action type. Required.""" + type: Literal["find"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The action type. Required. Default value is \"find\".""" url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The URL of the page searched for the pattern. Required.""" pattern: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -14339,20 +18135,20 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = WebSearchActionType.FIND # type: ignore + self.type: Literal["find"] = "find" -class WebSearchActionOpenPage(WebSearchAction, discriminator="open_page"): - """Action type "open_page" - Opens a specific URL from search results. +class WebSearchActionOpenPage(_Model): + """Open page action. - :ivar type: The action type. Required. - :vartype type: str or ~azure.ai.projects.models.OPEN_PAGE + :ivar type: The action type. Required. Default value is "open_page". + :vartype type: str :ivar url: The URL opened by the model. Required. :vartype url: str """ - type: Literal[WebSearchActionType.OPEN_PAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The action type. Required.""" + type: Literal["open_page"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The action type. Required. Default value is \"open_page\".""" url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The URL opened by the model. Required.""" @@ -14372,22 +18168,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = WebSearchActionType.OPEN_PAGE # type: ignore + self.type: Literal["open_page"] = "open_page" -class WebSearchActionSearch(WebSearchAction, discriminator="search"): - """Action type "search" - Performs a web search query. +class WebSearchActionSearch(_Model): + """Search action. - :ivar type: The action type. Required. - :vartype type: str or ~azure.ai.projects.models.SEARCH + :ivar type: The action type. Required. Default value is "search". + :vartype type: str :ivar query: The search query. Required. :vartype query: str :ivar sources: Web search sources. :vartype sources: list[~azure.ai.projects.models.WebSearchActionSearchSources] """ - type: Literal[WebSearchActionType.SEARCH] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The action type. Required.""" + type: Literal["search"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The action type. Required. Default value is \"search\".""" query: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The search query. Required.""" sources: Optional[list["_models.WebSearchActionSearchSources"]] = rest_field( @@ -14412,7 +18208,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = WebSearchActionType.SEARCH # type: ignore + self.type: Literal["search"] = "search" class WebSearchActionSearchSources(_Model): @@ -14448,38 +18244,128 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["url"] = "url" +class WebSearchApproximateLocation(_Model): + """Web search approximate location. + + :ivar type: The type of location approximation. Always ``approximate``. Default value is + "approximate". + :vartype type: str + :ivar country: + :vartype country: str + :ivar region: + :vartype region: str + :ivar city: + :vartype city: str + :ivar timezone: + :vartype timezone: str + """ + + type: Optional[Literal["approximate"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of location approximation. Always ``approximate``. Default value is \"approximate\".""" + country: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + region: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + city: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + timezone: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + type: Optional[Literal["approximate"]] = None, + country: Optional[str] = None, + region: Optional[str] = None, + city: Optional[str] = None, + timezone: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class WebSearchConfiguration(_Model): + """A web search configuration for bing custom search. + + :ivar project_connection_id: Project connection id for grounding with bing custom search. + Required. + :vartype project_connection_id: str + :ivar instance_name: Name of the custom configuration instance given to config. Required. + :vartype instance_name: str + """ + + project_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Project connection id for grounding with bing custom search. Required.""" + instance_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the custom configuration instance given to config. Required.""" + + @overload + def __init__( + self, + *, + project_connection_id: str, + instance_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 WebSearchPreviewTool(Tool, discriminator="web_search_preview"): - """Note: web_search is not yet available via Azure OpenAI. + """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. :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_PREVIEW - :ivar user_location: The user's location. - :vartype user_location: ~azure.ai.projects.models.Location + :ivar user_location: + :vartype user_location: ~azure.ai.projects.models.ApproximateLocation :ivar search_context_size: High level guidance for the amount of context window space to use - for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of - the following types: Literal["low"], Literal["medium"], Literal["high"] - :vartype search_context_size: str or str or str + for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Known + values are: "low", "medium", and "high". + :vartype search_context_size: str or ~azure.ai.projects.models.SearchContextSize + :ivar custom_search_configuration: The project connections attached to this tool. There can be + a maximum of 1 connection + resource attached to the tool. + :vartype custom_search_configuration: ~azure.ai.projects.models.WebSearchConfiguration """ type: Literal[ToolType.WEB_SEARCH_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.""" - user_location: Optional["_models.Location"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The user's location.""" - search_context_size: Optional[Literal["low", "medium", "high"]] = rest_field( + user_location: Optional["_models.ApproximateLocation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + search_context_size: Optional[Union[str, "_models.SearchContextSize"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """High level guidance for the amount of context window space to use for the search. One of - ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of the following types: - Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"]""" + ``low``, ``medium``, or ``high``. ``medium`` is the default. Known values are: \"low\", + \"medium\", and \"high\".""" + custom_search_configuration: Optional["_models.WebSearchConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The project connections attached to this tool. There can be a maximum of 1 connection + resource attached to the tool.""" @overload def __init__( self, *, - user_location: Optional["_models.Location"] = None, - search_context_size: Optional[Literal["low", "medium", "high"]] = None, + user_location: Optional["_models.ApproximateLocation"] = None, + search_context_size: Optional[Union[str, "_models.SearchContextSize"]] = None, + custom_search_configuration: Optional["_models.WebSearchConfiguration"] = None, ) -> None: ... @overload @@ -14494,29 +18380,44 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ToolType.WEB_SEARCH_PREVIEW # type: ignore -class WebSearchToolCallItemParam(ItemParam, discriminator="web_search_call"): - """The results of a web search tool call. See the - `web search guide `_ for more - information. +class WebSearchTool(Tool, discriminator="web_search"): + """Web search. - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH_CALL - :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. - :vartype action: ~azure.ai.projects.models.WebSearchAction + :ivar type: The type of the web search tool. One of ``web_search`` or + ``web_search_2025_08_26``. Required. + :vartype type: str or ~azure.ai.projects.models.WEB_SEARCH + :ivar filters: + :vartype filters: ~azure.ai.projects.models.WebSearchToolFilters + :ivar user_location: + :vartype user_location: ~azure.ai.projects.models.WebSearchApproximateLocation + :ivar search_context_size: High level guidance for the amount of context window space to use + for the search. One of ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of + the following types: Literal["low"], Literal["medium"], Literal["high"] + :vartype search_context_size: str or str or str """ - type: Literal[ItemType.WEB_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - action: "_models.WebSearchAction" = 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.""" + 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.""" + filters: Optional["_models.WebSearchToolFilters"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + user_location: Optional["_models.WebSearchApproximateLocation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + search_context_size: Optional[Literal["low", "medium", "high"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """High level guidance for the amount of context window space to use for the search. One of + ``low``, ``medium``, or ``high``. ``medium`` is the default. Is one of the following types: + Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"]""" @overload def __init__( self, *, - action: "_models.WebSearchAction", + filters: Optional["_models.WebSearchToolFilters"] = None, + user_location: Optional["_models.WebSearchApproximateLocation"] = None, + search_context_size: Optional[Literal["low", "medium", "high"]] = None, ) -> None: ... @overload @@ -14528,47 +18429,23 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.WEB_SEARCH_CALL # type: ignore + self.type = ToolType.WEB_SEARCH # type: ignore -class WebSearchToolCallItemResource(ItemResource, discriminator="web_search_call"): - """The results of a web search tool call. See the - `web search guide `_ for more - information. +class WebSearchToolFilters(_Model): + """WebSearchToolFilters. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :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. - :vartype action: ~azure.ai.projects.models.WebSearchAction + :ivar allowed_domains: + :vartype allowed_domains: list[str] """ - type: Literal[ItemType.WEB_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" - 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: "_models.WebSearchAction" = 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.""" + allowed_domains: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - status: Literal["in_progress", "searching", "completed", "failed"], - action: "_models.WebSearchAction", - created_by: Optional["_models.CreatedBy"] = None, + allowed_domains: Optional[list[str]] = None, ) -> None: ... @overload @@ -14580,7 +18457,6 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.WEB_SEARCH_CALL # type: ignore class WeeklyRecurrenceSchedule(RecurrenceSchedule, discriminator="Weekly"): @@ -14621,12 +18497,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class WorkflowActionOutputItemResource(ItemResource, discriminator="workflow_action"): """WorkflowActionOutputItemResource. - :ivar id: Required. - :vartype id: str - :ivar created_by: The information about the creator of the item. - :vartype created_by: ~azure.ai.projects.models.CreatedBy - :ivar type: Required. - :vartype type: str or ~azure.ai.projects.models.WORKFLOW_ACTION + :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. Default value is "workflow_action". + :vartype type: str :ivar kind: The kind of CSDL action (e.g., 'SetVariable', 'InvokeAzureAgent'). Required. :vartype kind: str :ivar action_id: Unique identifier for the action. Required. @@ -14641,8 +18516,8 @@ class WorkflowActionOutputItemResource(ItemResource, discriminator="workflow_act :vartype status: str or str or str or str """ - type: Literal[ItemType.WORKFLOW_ACTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required.""" + type: Literal["workflow_action"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"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"]) @@ -14662,11 +18537,10 @@ class WorkflowActionOutputItemResource(ItemResource, discriminator="workflow_act def __init__( self, *, - id: str, # pylint: disable=redefined-builtin kind: str, action_id: str, status: Literal["completed", "failed", "in_progress", "cancelled"], - created_by: Optional["_models.CreatedBy"] = None, + created_by: Optional[Union["_models.CreatedBy", str]] = None, parent_action_id: Optional[str] = None, previous_action_id: Optional[str] = None, ) -> None: ... @@ -14680,7 +18554,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.WORKFLOW_ACTION # type: ignore + self.type = "workflow_action" # type: ignore class WorkflowAgentDefinition(AgentDefinition, discriminator="workflow"): diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py index fc88ae38be4a..c717b1845cf1 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_patch.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. @@ -6,7 +7,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List, Dict, Optional, Any, Tuple +from typing import List, Dict, Optional, Any, Tuple, overload, Mapping, Literal from azure.core.polling import LROPoller, AsyncLROPoller, PollingMethod, AsyncPollingMethod from azure.core.polling.base_polling import ( LROBasePolling, @@ -14,8 +15,10 @@ _raise_if_bad_http_status_and_method, ) from azure.core.polling.async_base_polling import AsyncLROBasePolling -from ._models import CustomCredential as CustomCredentialGenerated +from ._enums import TextResponseFormatConfigurationType +from ._models import TextResponseFormatConfiguration, CustomCredential as CustomCredentialGenerated from ..models import MemoryStoreUpdateCompletedResult, MemoryStoreUpdateResult +from .._utils.model_base import rest_discriminator, rest_field class CustomCredential(CustomCredentialGenerated): @@ -259,7 +262,7 @@ def from_continuation_token( cls, polling_method: AsyncPollingMethod[MemoryStoreUpdateCompletedResult], continuation_token: str, - **kwargs: Any + **kwargs: Any, ) -> "AsyncUpdateMemoriesLROPoller": """Create a poller from a continuation token. @@ -280,12 +283,65 @@ def from_continuation_token( return cls(client, initial_response, deserialization_callback, polling_method) +# Patched in order to set of type of "schema" to dict[str, Any] instead of ResponseFormatJsonSchemaSchema +class TextResponseFormatJsonSchema(TextResponseFormatConfiguration, discriminator="json_schema"): + """JSON schema. + + :ivar type: The type of response format being defined. Always ``json_schema``. Required. + :vartype type: str or ~azure.ai.projects.models.JSON_SCHEMA + :ivar description: A description of what the response format is for, used by the model to + determine how to respond in the format. + :vartype description: str + :ivar name: The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. Required. + :vartype name: str + :ivar schema: Required. + :vartype schema: ~azure.ai.projects.models.ResponseFormatJsonSchemaSchema + :ivar strict: + :vartype strict: bool + """ + + type: Literal[TextResponseFormatConfigurationType.JSON_SCHEMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of response format being defined. Always ``json_schema``. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A description of what the response format is for, used by the model to + determine how to respond in the format.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. Required.""" + schema: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + strict: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + name: str, + schema: dict[str, Any], + description: Optional[str] = None, + strict: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.type = TextResponseFormatConfigurationType.JSON_SCHEMA # type: ignore + + __all__: List[str] = [ "CustomCredential", "UpdateMemoriesLROPollingMethod", "AsyncUpdateMemoriesLROPollingMethod", "UpdateMemoriesLROPoller", "AsyncUpdateMemoriesLROPoller", + "TextResponseFormatJsonSchema", ] # Add all objects you want publicly available to users at this package level 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 71813b37c2f7..786cf9090c8f 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 @@ -201,7 +201,7 @@ def build_agents_list_request( *, kind: Optional[Union[str, _models.AgentKind]] = None, limit: Optional[int] = None, - order: Optional[Literal["asc", "desc"]] = None, + order: Optional[Union[str, _models.PageOrder]] = None, after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any @@ -344,7 +344,7 @@ def build_agents_list_versions_request( agent_name: str, *, limit: Optional[int] = None, - order: Optional[Literal["asc", "desc"]] = None, + order: Optional[Union[str, _models.PageOrder]] = None, after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any @@ -456,7 +456,7 @@ def build_memory_stores_get_request(name: str, **kwargs: Any) -> HttpRequest: def build_memory_stores_list_request( *, limit: Optional[int] = None, - order: Optional[Literal["asc", "desc"]] = None, + order: Optional[Union[str, _models.PageOrder]] = None, after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any @@ -2631,7 +2631,7 @@ def list( *, kind: Optional[Union[str, _models.AgentKind]] = None, limit: Optional[int] = None, - order: Optional[Literal["asc", "desc"]] = None, + order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.AgentDetails"]: @@ -2646,9 +2646,8 @@ def list( :paramtype limit: int :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for ascending order and``desc`` - for descending order. Is either a Literal["asc"] type or a Literal["desc"] type. Default value - is None. - :paramtype order: str or str + 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 @@ -3285,7 +3284,7 @@ def list_versions( agent_name: str, *, limit: Optional[int] = None, - order: Optional[Literal["asc", "desc"]] = None, + order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.AgentVersionDetails"]: @@ -3299,9 +3298,8 @@ def list_versions( :paramtype limit: int :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for ascending order and``desc`` - for descending order. Is either a Literal["asc"] type or a Literal["desc"] type. Default value - is None. - :paramtype order: str or str + 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 @@ -3793,7 +3791,7 @@ def list( self, *, limit: Optional[int] = None, - order: Optional[Literal["asc", "desc"]] = None, + order: Optional[Union[str, _models.PageOrder]] = None, before: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.MemoryStoreDetails"]: @@ -3805,9 +3803,8 @@ def list( :paramtype limit: int :keyword order: Sort order by the ``created_at`` timestamp of the objects. ``asc`` for ascending order and``desc`` - for descending order. Is either a Literal["asc"] type or a Literal["desc"] type. Default value - is None. - :paramtype order: str or str + 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 @@ -3952,7 +3949,7 @@ def search_memories( *, scope: str, content_type: str = "application/json", - items: Optional[List[_models.ItemParam]] = None, + items: Optional[List[_models.Item]] = None, previous_search_id: Optional[str] = None, options: Optional[_models.MemorySearchOptions] = None, **kwargs: Any @@ -3968,7 +3965,7 @@ def search_memories( 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.ItemParam] + :paramtype items: list[~azure.ai.projects.models.Item] :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 @@ -4027,7 +4024,7 @@ def search_memories( body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, - items: Optional[List[_models.ItemParam]] = None, + items: Optional[List[_models.Item]] = None, previous_search_id: Optional[str] = None, options: Optional[_models.MemorySearchOptions] = None, **kwargs: Any @@ -4042,7 +4039,7 @@ def search_memories( 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.ItemParam] + :paramtype items: list[~azure.ai.projects.models.Item] :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 @@ -4137,7 +4134,7 @@ def _update_memories_initial( body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, - items: Optional[List[_models.ItemParam]] = None, + items: Optional[List[_models.Item]] = None, previous_update_id: Optional[str] = None, update_delay: Optional[int] = None, **kwargs: Any @@ -4222,7 +4219,7 @@ def _begin_update_memories( *, scope: str, content_type: str = "application/json", - items: Optional[List[_models.ItemParam]] = None, + items: Optional[List[_models.Item]] = None, previous_update_id: Optional[str] = None, update_delay: Optional[int] = None, **kwargs: Any @@ -4248,7 +4245,7 @@ def _begin_update_memories( body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, - items: Optional[List[_models.ItemParam]] = None, + items: Optional[List[_models.Item]] = None, previous_update_id: Optional[str] = None, update_delay: Optional[int] = None, **kwargs: Any @@ -4263,7 +4260,7 @@ def _begin_update_memories( Required. :paramtype scope: str :keyword items: Conversation items from which to extract memories. Default value is None. - :paramtype items: list[~azure.ai.projects.models.ItemParam] + :paramtype items: list[~azure.ai.projects.models.Item] :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 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 e69e8d2988ec..1bb6dd9ca7df 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 @@ -14,8 +14,8 @@ from .. import models as _models from ..models import ( MemoryStoreOperationUsage, - MemoryStoreOperationUsageInputTokensDetails, - MemoryStoreOperationUsageOutputTokensDetails, + ResponseUsageInputTokensDetails, + ResponseUsageOutputTokensDetails, MemoryStoreUpdateCompletedResult, UpdateMemoriesLROPoller, UpdateMemoriesLROPollingMethod, @@ -34,7 +34,7 @@ def begin_update_memories( *, scope: str, content_type: str = "application/json", - items: Optional[List[_models.ItemParam]] = None, + items: Optional[List[_models.Item]] = None, previous_update_id: Optional[str] = None, update_delay: Optional[int] = None, **kwargs: Any, @@ -119,7 +119,7 @@ def begin_update_memories( body: Union[JSON, IO[bytes]] = _Unset, *, scope: str = _Unset, - items: Optional[List[_models.ItemParam]] = None, + items: Optional[List[_models.Item]] = None, previous_update_id: Optional[str] = None, update_delay: Optional[int] = None, **kwargs: Any, @@ -193,9 +193,9 @@ def get_long_running_output(pipeline_response): usage = MemoryStoreOperationUsage( embedding_tokens=0, input_tokens=0, - input_tokens_details=MemoryStoreOperationUsageInputTokensDetails(cached_tokens=0), + input_tokens_details=ResponseUsageInputTokensDetails(cached_tokens=0), output_tokens=0, - output_tokens_details=MemoryStoreOperationUsageOutputTokensDetails(reasoning_tokens=0), + output_tokens_details=ResponseUsageOutputTokensDetails(reasoning_tokens=0), total_tokens=0, ) deserialized = MemoryStoreUpdateCompletedResult(memory_operations=[], usage=usage) 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 4297fcee6892..ba9a5da65c3a 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 @@ -488,6 +488,11 @@ def _add_instructions_event( # Convert schema to JSON string if it's a dict/object if isinstance(response_schema, dict): schema_str = json.dumps(response_schema, ensure_ascii=False) + elif hasattr(response_schema, "as_dict"): + # Handle model objects that have as_dict() method (e.g., ResponseFormatJsonSchemaSchema) + schema_dict = response_schema.as_dict() + schema_str = json.dumps(schema_dict, ensure_ascii=False) + # TODO: is this 'elif' still needed, not that we added the above? elif hasattr(response_schema, "__dict__"): # Handle model objects by converting to dict first schema_dict = {k: v for k, v in response_schema.__dict__.items() if not k.startswith("_")} diff --git a/sdk/ai/azure-ai-projects/cspell.json b/sdk/ai/azure-ai-projects/cspell.json index 12f5733ae5c7..0afac27e5460 100644 --- a/sdk/ai/azure-ai-projects/cspell.json +++ b/sdk/ai/azure-ai-projects/cspell.json @@ -2,38 +2,39 @@ "ignoreWords": [ "agentic", "aiproject", - "azureopenai", - "GLEU", + "aiprojectclient", "aiservices", - "azureai", - "GENAI", - "UPIA", "ansii", - "getconnectionwithcredentials", - "quantitive", - "balapvbyostoragecanary", - "fspath", "aread", - "inpainting", - "CSDL", - "fstring", - "aiprojectclient", - "Tadmaq", - "Udbk", - "Ministral", + "azureai", + "azureopenai", + "balapvbyostoragecanary", + "closefd", "cogsvc", + "CSDL", "evals", "FineTuning", - "ftjob", + "fspath", + "fstring", "ftchkpt", - "closefd" + "ftjob", + "GENAI", + "getconnectionwithcredentials", + "GLEU", + "inpainting", + "Ministral", + "quantitive", + "Tadmaq", + "Udbk", + "UPIA", + "xhigh" + ], + "ignorePaths": [ + "*.csv", + "*.json", + "*.jsonl" ], - "ignorePaths": [ - "*.csv", - "*.json", - "*.jsonl" - ], - "words": [ - "Pxqzykebv" - ] + "words": [ + "Pxqzykebv" + ] } diff --git a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd index 5baa4bc23f33..8be0b2dd2cf5 100644 --- a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd +++ b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd @@ -20,10 +20,6 @@ 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 Add quotation marks around "str" in the expression: content: Union[str, list["_models.ItemContent"]] = rest_field( -REM This fixes the serialization of this expression: item_param: ItemParam = ResponsesUserMessageItemParam(content="my text") -powershell -Command "(Get-Content azure\ai\projects\models\_models.py) -replace 'Union\[str, list\[\"_models\.ItemContent\"\]\] = rest_field\(', 'Union[\"str\", list[\"_models.ItemContent\"]] = rest_field(' | Set-Content azure\ai\projects\models\_models.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" @@ -31,4 +27,4 @@ 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" echo Now do these additional changes manually, if you want the "Generate docs" job to succeed in PR pipeline -REM 1. Remove `generate_summary` from class `Reasoning`. It's deprecated but causes two types of errors. Consider removing it from TypeSpec. +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 410bc99ea30e..f1afc7922d60 100644 --- a/sdk/ai/azure-ai-projects/pyproject.toml +++ b/sdk/ai/azure-ai-projects/pyproject.toml @@ -33,7 +33,8 @@ keywords = ["azure", "azure sdk"] dependencies = [ "isodate>=0.6.1", - "azure-core>=1.35.0", + "azure-core>=1.36.0", + "typing-extensions>=4.11", "azure-identity>=1.15.0", "openai>=2.8.0", "azure-storage-blob>=12.15.0", @@ -65,4 +66,3 @@ pytyped = ["py.typed"] [tool.azure-sdk-build] verifytypes = false - 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 e2fd112e2301..31d84821591e 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 @@ -38,7 +38,7 @@ from azure.ai.projects.models import ( PromptAgentDefinition, PromptAgentDefinitionText, - ResponseTextFormatConfigurationJsonSchema, + TextResponseFormatJsonSchema, ) from pydantic import BaseModel, Field @@ -65,9 +65,7 @@ class CalendarEvent(BaseModel): definition=PromptAgentDefinition( model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"], text=PromptAgentDefinitionText( - format=ResponseTextFormatConfigurationJsonSchema( - name="CalendarEvent", schema=CalendarEvent.model_json_schema() - ) + format=TextResponseFormatJsonSchema(name="CalendarEvent", schema=CalendarEvent.model_json_schema()) ), instructions=""" You are a helpful assistant that extracts calendar event information from the input user messages, 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 0f6ca012249d..beb96d3800a9 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 @@ -39,7 +39,7 @@ from azure.ai.projects.models import ( PromptAgentDefinition, PromptAgentDefinitionText, - ResponseTextFormatConfigurationJsonSchema, + TextResponseFormatJsonSchema, ) from pydantic import BaseModel, Field @@ -66,9 +66,7 @@ async def main() -> None: definition=PromptAgentDefinition( model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"], text=PromptAgentDefinitionText( - format=ResponseTextFormatConfigurationJsonSchema( - name="CalendarEvent", schema=CalendarEvent.model_json_schema() - ) + format=TextResponseFormatJsonSchema(name="CalendarEvent", schema=CalendarEvent.model_json_schema()) ), instructions=""" You are a helpful assistant that extracts calendar event information from the input user messages, 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 4da066eed149..4bec6db40ba3 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 @@ -30,7 +30,6 @@ from azure.ai.projects import AIProjectClient from azure.ai.projects.models import ( PromptAgentDefinition, - ResponseStreamEventType, WorkflowAgentDefinition, ItemType, ) @@ -157,8 +156,7 @@ for event in stream: print(f"Event {event.sequence_number} type '{event.type}'", end="") if ( - event.type == ResponseStreamEventType.RESPONSE_OUTPUT_ITEM_ADDED - or event.type == ResponseStreamEventType.RESPONSE_OUTPUT_ITEM_DONE + event.type == "response.output_item.added" or event.type == "response.output_item.done" ) and event.item.type == ItemType.WORKFLOW_ACTION: print( f": item action ID '{event.item.action_id}' is '{event.item.status}' (previous action ID: '{event.item.previous_action_id}')", 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 4e07d00610c6..f8c683d7fcbc 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 @@ -31,7 +31,6 @@ from azure.ai.projects.aio import AIProjectClient from azure.ai.projects.models import ( PromptAgentDefinition, - ResponseStreamEventType, WorkflowAgentDefinition, ItemType, ) @@ -159,8 +158,7 @@ async def main(): async for event in stream: print(f"Event {event.sequence_number} type '{event.type}'", end="") if ( - event.type == ResponseStreamEventType.RESPONSE_OUTPUT_ITEM_ADDED - or event.type == ResponseStreamEventType.RESPONSE_OUTPUT_ITEM_DONE + event.type == "response.output_item.added" or event.type == "response.output_item.done" ) and event.item.type == ItemType.WORKFLOW_ACTION: print( f": item action ID '{event.item.action_id}' is '{event.item.status}' (previous action ID: '{event.item.previous_action_id}')", 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 db84258efae8..443f736d5cff 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 @@ -28,7 +28,7 @@ from dotenv import load_dotenv from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, CodeInterpreterTool, CodeInterpreterToolAuto +from azure.ai.projects.models import PromptAgentDefinition, CodeInterpreterTool, CodeInterpreterContainerAuto load_dotenv() @@ -48,7 +48,7 @@ # Upload the CSV file for the code interpreter file = openai_client.files.create(purpose="assistants", file=open(asset_file_path, "rb")) - tool = CodeInterpreterTool(container=CodeInterpreterToolAuto(file_ids=[file.id])) + tool = CodeInterpreterTool(container=CodeInterpreterContainerAuto(file_ids=[file.id])) # [END tool_declaration] print(f"File uploaded (id: {file.id})") 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 b794599b70af..0f8f8eacf6ee 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 @@ -29,7 +29,7 @@ from dotenv import load_dotenv from azure.identity.aio import DefaultAzureCredential from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import PromptAgentDefinition, CodeInterpreterTool, CodeInterpreterToolAuto +from azure.ai.projects.models import PromptAgentDefinition, CodeInterpreterTool, CodeInterpreterContainerAuto load_dotenv() @@ -61,7 +61,7 @@ async def main() -> None: definition=PromptAgentDefinition( model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"], instructions="You are a helpful assistant.", - tools=[CodeInterpreterTool(container=CodeInterpreterToolAuto(file_ids=[file.id]))], + tools=[CodeInterpreterTool(container=CodeInterpreterContainerAuto(file_ids=[file.id]))], ), description="Code interpreter agent for data analysis and visualization.", ) diff --git a/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation_async.py b/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_image_generation_async.py index b4ae4813aef3..0ad945453783 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. 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 d2c9149c9cea..78908d0fba8e 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. 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 2374aca75c1a..bc5f1bcec13a 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 @@ -39,7 +39,7 @@ MemoryStoreDefaultDefinition, MemoryStoreDefaultOptions, MemorySearchOptions, - ResponsesUserMessageItemParam, + EasyInputMessage, ) load_dotenv() @@ -82,8 +82,8 @@ scope = "user_123" # Add memories to the memory store - user_message = ResponsesUserMessageItemParam( - 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, @@ -101,7 +101,7 @@ ) # Retrieve memories from the memory store - query_message = ResponsesUserMessageItemParam(content="What are my coffee preferences?") + 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) ) 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 18286a7ae0a6..fe1f1ae1c27b 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 @@ -15,7 +15,7 @@ from azure.ai.projects.models import ( Reasoning, FunctionTool, - ResponseTextFormatConfigurationText, + # ResponseTextFormatConfigurationText, ) from devtools_testutils import ( recorded_by_proxy, @@ -516,7 +516,7 @@ def test_agent_with_structured_output_with_instructions_content_recording_enable assert True == AIProjectInstrumentor().is_content_recording_enabled() assert True == AIProjectInstrumentor().is_instrumented() - from azure.ai.projects.models import ResponseTextFormatConfigurationJsonSchema + from azure.ai.projects.models import TextResponseFormatJsonSchema with self.create_client(operation_group="tracing", **kwargs) as project_client: @@ -536,7 +536,7 @@ def test_agent_with_structured_output_with_instructions_content_recording_enable model=model, instructions="You are a helpful assistant that extracts person information.", text=PromptAgentDefinitionText( - format=ResponseTextFormatConfigurationJsonSchema( + format=TextResponseFormatJsonSchema( name="PersonInfo", schema=test_schema, ) @@ -603,7 +603,7 @@ def test_agent_with_structured_output_with_instructions_content_recording_disabl assert False == AIProjectInstrumentor().is_content_recording_enabled() assert True == AIProjectInstrumentor().is_instrumented() - from azure.ai.projects.models import ResponseTextFormatConfigurationJsonSchema + from azure.ai.projects.models import TextResponseFormatJsonSchema with self.create_client(operation_group="agents", **kwargs) as project_client: @@ -622,7 +622,7 @@ def test_agent_with_structured_output_with_instructions_content_recording_disabl model=model, instructions="You are a helpful assistant that extracts person information.", text=PromptAgentDefinitionText( - format=ResponseTextFormatConfigurationJsonSchema( + format=TextResponseFormatJsonSchema( name="PersonInfo", schema=test_schema, ) @@ -677,7 +677,7 @@ def test_agent_with_structured_output_without_instructions_content_recording_ena assert True == AIProjectInstrumentor().is_content_recording_enabled() assert True == AIProjectInstrumentor().is_instrumented() - from azure.ai.projects.models import ResponseTextFormatConfigurationJsonSchema + from azure.ai.projects.models import TextResponseFormatJsonSchema with self.create_client(operation_group="tracing", **kwargs) as project_client: @@ -695,7 +695,7 @@ def test_agent_with_structured_output_without_instructions_content_recording_ena model=model, # No instructions provided text=PromptAgentDefinitionText( - format=ResponseTextFormatConfigurationJsonSchema( + format=TextResponseFormatJsonSchema( name="Result", schema=test_schema, ) @@ -759,7 +759,7 @@ def test_agent_with_structured_output_without_instructions_content_recording_dis assert False == AIProjectInstrumentor().is_content_recording_enabled() assert True == AIProjectInstrumentor().is_instrumented() - from azure.ai.projects.models import ResponseTextFormatConfigurationJsonSchema + from azure.ai.projects.models import TextResponseFormatJsonSchema with self.create_client(operation_group="agents", **kwargs) as project_client: @@ -777,7 +777,7 @@ def test_agent_with_structured_output_without_instructions_content_recording_dis model=model, # No instructions provided text=PromptAgentDefinitionText( - format=ResponseTextFormatConfigurationJsonSchema( + 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 0e486fd97ae1..39c878fd889c 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 @@ -13,7 +13,7 @@ from azure.ai.projects.models import ( Reasoning, FunctionTool, - ResponseTextFormatConfigurationText, + # ResponseTextFormatConfigurationText, ) from devtools_testutils.aio import recorded_by_proxy_async @@ -394,7 +394,7 @@ async def test_agent_with_structured_output_with_instructions_content_recording_ assert True == AIProjectInstrumentor().is_content_recording_enabled() assert True == AIProjectInstrumentor().is_instrumented() - from azure.ai.projects.models import ResponseTextFormatConfigurationJsonSchema + from azure.ai.projects.models import TextResponseFormatJsonSchema project_client = self.create_async_client(operation_group="tracing", **kwargs) @@ -415,7 +415,7 @@ async def test_agent_with_structured_output_with_instructions_content_recording_ model=model, instructions="You are a helpful assistant that extracts person information.", text=PromptAgentDefinitionText( - format=ResponseTextFormatConfigurationJsonSchema( + format=TextResponseFormatJsonSchema( name="PersonInfo", schema=test_schema, ) @@ -484,7 +484,7 @@ async def test_agent_with_structured_output_with_instructions_content_recording_ assert False == AIProjectInstrumentor().is_content_recording_enabled() assert True == AIProjectInstrumentor().is_instrumented() - from azure.ai.projects.models import ResponseTextFormatConfigurationJsonSchema + from azure.ai.projects.models import TextResponseFormatJsonSchema project_client = self.create_async_client(operation_group="agents", **kwargs) @@ -504,7 +504,7 @@ async def test_agent_with_structured_output_with_instructions_content_recording_ model=model, instructions="You are a helpful assistant that extracts person information.", text=PromptAgentDefinitionText( - format=ResponseTextFormatConfigurationJsonSchema( + format=TextResponseFormatJsonSchema( name="PersonInfo", schema=test_schema, ) @@ -561,7 +561,7 @@ async def test_agent_with_structured_output_without_instructions_content_recordi assert True == AIProjectInstrumentor().is_content_recording_enabled() assert True == AIProjectInstrumentor().is_instrumented() - from azure.ai.projects.models import ResponseTextFormatConfigurationJsonSchema + from azure.ai.projects.models import TextResponseFormatJsonSchema project_client = self.create_async_client(operation_group="tracing", **kwargs) @@ -580,7 +580,7 @@ async def test_agent_with_structured_output_without_instructions_content_recordi model=model, # No instructions provided text=PromptAgentDefinitionText( - format=ResponseTextFormatConfigurationJsonSchema( + format=TextResponseFormatJsonSchema( name="Result", schema=test_schema, ) @@ -644,7 +644,7 @@ async def test_agent_with_structured_output_without_instructions_content_recordi assert False == AIProjectInstrumentor().is_content_recording_enabled() assert True == AIProjectInstrumentor().is_instrumented() - from azure.ai.projects.models import ResponseTextFormatConfigurationJsonSchema + from azure.ai.projects.models import TextResponseFormatJsonSchema project_client = self.create_async_client(operation_group="agents", **kwargs) @@ -663,7 +663,7 @@ async def test_agent_with_structured_output_without_instructions_content_recordi model=model, # No instructions provided text=PromptAgentDefinitionText( - format=ResponseTextFormatConfigurationJsonSchema( + format=TextResponseFormatJsonSchema( name="Result", schema=test_schema, ) 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 ce090902ffb9..3a7fbdff92ac 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 @@ -4130,7 +4130,6 @@ def test_workflow_agent_streaming_with_content_recording(self, **kwargs): WorkflowAgentDefinition, AgentReference, PromptAgentDefinition, - ResponseStreamEventType, ) self.cleanup() @@ -4254,10 +4253,7 @@ def test_workflow_agent_streaming_with_content_recording(self, **kwargs): # Consume the stream and track workflow actions workflow_action_count = 0 for event in stream: - if ( - event.type == ResponseStreamEventType.RESPONSE_OUTPUT_ITEM_ADDED - and event.item.type == "workflow_action" - ): + if event.type == "response.output_item.added" and event.item.type == "workflow_action": workflow_action_count += 1 # Verify we got workflow actions during streaming 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 0d0e187ff2a6..98f4ada367df 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 @@ -10,7 +10,7 @@ from devtools_testutils import recorded_by_proxy, RecordedTransport from azure.ai.projects.models import ( PromptAgentDefinition, - ResponseTextFormatConfigurationJsonSchema, + TextResponseFormatJsonSchema, PromptAgentDefinitionText, ) @@ -176,9 +176,7 @@ class CalendarEvent(BaseModel): definition=PromptAgentDefinition( model=model, text=PromptAgentDefinitionText( - format=ResponseTextFormatConfigurationJsonSchema( - name="CalendarEvent", schema=CalendarEvent.model_json_schema() - ) + format=TextResponseFormatJsonSchema(name="CalendarEvent", schema=CalendarEvent.model_json_schema()) ), instructions=""" You are a helpful assistant that extracts calendar event information from the input user messages, 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 8b99aaa8cfcf..9a73410e6821 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 @@ -11,7 +11,7 @@ from devtools_testutils import RecordedTransport from azure.ai.projects.models import ( PromptAgentDefinition, - ResponseTextFormatConfigurationJsonSchema, + TextResponseFormatJsonSchema, PromptAgentDefinitionText, ) @@ -149,7 +149,7 @@ class CalendarEvent(BaseModel): definition=PromptAgentDefinition( model=model, text=PromptAgentDefinitionText( - format=ResponseTextFormatConfigurationJsonSchema( + format=TextResponseFormatJsonSchema( name="CalendarEvent", schema=CalendarEvent.model_json_schema() ) ), 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 35e9ee088cd8..c69948ebc824 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 @@ -12,9 +12,9 @@ # ResponsesSystemMessageItemParam, # ItemContentInputText, ItemType, - ResponsesMessageRole, - ItemContentType, + InputContentType, ) +from openai.types.conversations import ConversationItem class TestConversationItemsCrud(TestBase): @@ -70,15 +70,15 @@ def test_conversation_items_crud(self, **kwargs): self._validate_conversation_item( item_list[0], expected_type=ItemType.MESSAGE, - expected_role=ResponsesMessageRole.USER, - expected_content_type=ItemContentType.INPUT_TEXT, + expected_role="user", + expected_content_type=InputContentType.INPUT_TEXT, expected_content_text="first message", ) self._validate_conversation_item( item_list[1], expected_type=ItemType.MESSAGE, - expected_role=ResponsesMessageRole.USER, - expected_content_type=ItemContentType.INPUT_TEXT, + expected_role="user", + expected_content_type=InputContentType.INPUT_TEXT, expected_content_text="second message", ) item1_id = item_list[0].id @@ -99,15 +99,15 @@ def test_conversation_items_crud(self, **kwargs): # self._validate_conversation_item( # item_list[0], # expected_type=ItemType.MESSAGE, - # expected_role=ResponsesMessageRole.SYSTEM, - # expected_content_type=ItemContentType.INPUT_TEXT, + # expected_role="system", + # expected_content_type=InputContentType.INPUT_TEXT, # expected_content_text="third message", # ) # self._validate_conversation_item( # item_list[1], # expected_type=ItemType.MESSAGE, - # expected_role=ResponsesMessageRole.USER, - # expected_content_type=ItemContentType.INPUT_TEXT, + # expected_role="user", + # expected_content_type=InputContentType.INPUT_TEXT, # expected_content_text="fourth message", # ) # item3_id = item_list[0].id @@ -119,8 +119,8 @@ def test_conversation_items_crud(self, **kwargs): item, expected_type=ItemType.MESSAGE, expected_id=item1_id, - expected_role=ResponsesMessageRole.USER, - expected_content_type=ItemContentType.INPUT_TEXT, + expected_role="user", + expected_content_type=InputContentType.INPUT_TEXT, expected_content_text="first message", ) 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 21359835d963..94a2d765f9c1 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 @@ -13,8 +13,7 @@ # ResponsesSystemMessageItemParam, # ItemContentInputText, ItemType, - ResponsesMessageRole, - ItemContentType, + InputContentType, ) @@ -50,15 +49,15 @@ async def test_conversation_items_crud_async(self, **kwargs): self._validate_conversation_item( item_list[0], expected_type=ItemType.MESSAGE, - expected_role=ResponsesMessageRole.USER, - expected_content_type=ItemContentType.INPUT_TEXT, + expected_role="user", + expected_content_type=InputContentType.INPUT_TEXT, expected_content_text="first message", ) self._validate_conversation_item( item_list[1], expected_type=ItemType.MESSAGE, - expected_role=ResponsesMessageRole.USER, - expected_content_type=ItemContentType.INPUT_TEXT, + expected_role="user", + expected_content_type=InputContentType.INPUT_TEXT, expected_content_text="second message", ) item1_id = item_list[0].id @@ -79,15 +78,15 @@ async def test_conversation_items_crud_async(self, **kwargs): # self._validate_conversation_item( # item_list[0], # expected_type=ItemType.MESSAGE, - # expected_role=ResponsesMessageRole.SYSTEM, - # expected_content_type=ItemContentType.INPUT_TEXT, + # expected_role="system", + # expected_content_type=InputContentType.INPUT_TEXT, # expected_content_text="third message", # ) # self._validate_conversation_item( # item_list[1], # expected_type=ItemType.MESSAGE, - # expected_role=ResponsesMessageRole.USER, - # expected_content_type=ItemContentType.INPUT_TEXT, + # expected_role="user", + # expected_content_type=InputContentType.INPUT_TEXT, # expected_content_text="fourth message", # ) # item3_id = item_list[0].id @@ -99,8 +98,8 @@ async def test_conversation_items_crud_async(self, **kwargs): item, expected_type=ItemType.MESSAGE, expected_id=item1_id, - expected_role=ResponsesMessageRole.USER, - expected_content_type=ItemContentType.INPUT_TEXT, + expected_role="user", + expected_content_type=InputContentType.INPUT_TEXT, expected_content_text="first message", ) 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 4a2142d96150..2601424c4a1b 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 @@ -15,7 +15,12 @@ import json from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, CodeInterpreterTool, CodeInterpreterToolAuto, FunctionTool +from azure.ai.projects.models import ( + PromptAgentDefinition, + CodeInterpreterTool, + CodeInterpreterContainerAuto, + FunctionTool, +) from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam @@ -62,7 +67,7 @@ def test_calculate_and_save(self, **kwargs): model=model, instructions="You are a calculator assistant. Use code interpreter to perform calculations, then ALWAYS save the result using the save_result function.", tools=[ - CodeInterpreterTool(container=CodeInterpreterToolAuto()), + CodeInterpreterTool(container=CodeInterpreterContainerAuto()), func_tool, ], ), @@ -124,7 +129,7 @@ def test_generate_data_and_report(self, **kwargs): model=model, instructions="You are a data analyst. Use code interpreter to generate and analyze data, then ALWAYS create a report using the generate_report function with the exact statistics you computed.", tools=[ - CodeInterpreterTool(container=CodeInterpreterToolAuto()), + CodeInterpreterTool(container=CodeInterpreterContainerAuto()), report_function, ], ), diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_code_interpreter.py b/sdk/ai/azure-ai-projects/tests/agents/tools/multitool/test_agent_file_search_and_code_interpreter.py index 608143619c28..a60340a6571b 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 @@ -15,7 +15,12 @@ from io import BytesIO from test_base import TestBase, servicePreparer from devtools_testutils import recorded_by_proxy, RecordedTransport -from azure.ai.projects.models import PromptAgentDefinition, FileSearchTool, CodeInterpreterTool, CodeInterpreterToolAuto +from azure.ai.projects.models import ( + PromptAgentDefinition, + FileSearchTool, + CodeInterpreterTool, + CodeInterpreterContainerAuto, +) class TestAgentFileSearchAndCodeInterpreter(TestBase): @@ -83,7 +88,7 @@ def test_find_and_analyze_data(self, **kwargs): instructions="You are a data analyst. Use file search to find data files, then use code interpreter to perform calculations on the data.", tools=[ FileSearchTool(vector_store_ids=[vector_store.id]), - CodeInterpreterTool(container=CodeInterpreterToolAuto()), + CodeInterpreterTool(container=CodeInterpreterContainerAuto()), ], ), description="Agent with File Search and Code Interpreter.", @@ -153,7 +158,7 @@ def fibonacci(n): instructions="You are a code analyst. Use file search to find code files, then use code interpreter to execute and test the code.", tools=[ FileSearchTool(vector_store_ids=[vector_store.id]), - CodeInterpreterTool(container=CodeInterpreterToolAuto()), + CodeInterpreterTool(container=CodeInterpreterContainerAuto()), ], ), description="Agent for code analysis and execution.", 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 4edbedf51548..1b4bd4462be5 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 @@ -20,7 +20,7 @@ PromptAgentDefinition, FileSearchTool, CodeInterpreterTool, - CodeInterpreterToolAuto, + CodeInterpreterContainerAuto, FunctionTool, ) from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam @@ -104,7 +104,7 @@ def test_complete_analysis_workflow(self, **kwargs): instructions="You are a data analyst. Use file search to find data files, code interpreter to calculate statistics, and ALWAYS save your analysis using the save_analysis function.", tools=[ FileSearchTool(vector_store_ids=[vector_store.id]), - CodeInterpreterTool(container=CodeInterpreterToolAuto()), + CodeInterpreterTool(container=CodeInterpreterContainerAuto()), func_tool, ], ), 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 2798aecd66e3..13337934bfd4 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 @@ -12,7 +12,7 @@ from azure.ai.projects.models import ( PromptAgentDefinition, CodeInterpreterTool, - CodeInterpreterToolAuto, + CodeInterpreterContainerAuto, ) @@ -54,7 +54,7 @@ def test_agent_code_interpreter_simple_math(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can execute Python code.", - tools=[CodeInterpreterTool(container=CodeInterpreterToolAuto(file_ids=[]))], + tools=[CodeInterpreterTool(container=CodeInterpreterContainerAuto(file_ids=[]))], ), description="Simple code interpreter agent for basic Python execution.", ) @@ -154,7 +154,7 @@ def test_agent_code_interpreter_file_generation(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can analyze data and create visualizations.", - tools=[CodeInterpreterTool(container=CodeInterpreterToolAuto(file_ids=[file.id]))], + tools=[CodeInterpreterTool(container=CodeInterpreterContainerAuto(file_ids=[file.id]))], ), description="Code interpreter agent for file processing and chart generation.", ) diff --git a/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter_async.py b/sdk/ai/azure-ai-projects/tests/agents/tools/test_agent_code_interpreter_async.py index 709947e12485..6932f282830b 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 @@ -11,7 +11,7 @@ from azure.ai.projects.models import ( PromptAgentDefinition, CodeInterpreterTool, - CodeInterpreterToolAuto, + CodeInterpreterContainerAuto, ) @@ -40,7 +40,7 @@ async def test_agent_code_interpreter_simple_math_async(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant that can execute Python code.", - tools=[CodeInterpreterTool(container=CodeInterpreterToolAuto(file_ids=[]))], + tools=[CodeInterpreterTool(container=CodeInterpreterContainerAuto(file_ids=[]))], ), description="Simple code interpreter agent for basic Python execution.", ) 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 0a8940c3c393..636e85370bb4 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. @@ -17,7 +18,7 @@ FunctionTool, FileSearchTool, CodeInterpreterTool, - CodeInterpreterToolAuto, + CodeInterpreterContainerAuto, PromptAgentDefinition, ) from openai.types.responses.response_input_param import FunctionCallOutput, ResponseInputParam @@ -328,7 +329,7 @@ def test_code_interpreter_with_conversation(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a data analysis assistant. Use Python to perform calculations.", - tools=[CodeInterpreterTool(container=CodeInterpreterToolAuto(file_ids=[]))], + tools=[CodeInterpreterTool(container=CodeInterpreterContainerAuto(file_ids=[]))], ), description="Code interpreter agent for conversation testing.", ) @@ -427,7 +428,7 @@ def test_code_interpreter_with_file_in_conversation(self, **kwargs): definition=PromptAgentDefinition( model=model, instructions="You are a helpful assistant.", - tools=[CodeInterpreterTool(container=CodeInterpreterToolAuto(file_ids=[uploaded_file.id]))], + tools=[CodeInterpreterTool(container=CodeInterpreterContainerAuto(file_ids=[uploaded_file.id]))], ), description="Code interpreter agent for data analysis and visualization.", ) diff --git a/sdk/ai/azure-ai-projects/tests/conftest.py b/sdk/ai/azure-ai-projects/tests/conftest.py index 39deacea7ac1..c28a47fb1170 100644 --- a/sdk/ai/azure-ai-projects/tests/conftest.py +++ b/sdk/ai/azure-ai-projects/tests/conftest.py @@ -25,6 +25,7 @@ if not load_dotenv(find_dotenv(), override=True): print("Did not find a .env file. Using default environment variable values for tests.") + def pytest_collection_modifyitems(items): if os.environ.get("AZURE_TEST_RUN_LIVE") == "true": return 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 67e8839f35bc..88dfd1c265b4 100644 --- a/sdk/ai/azure-ai-projects/tests/finetuning/test_finetuning.py +++ b/sdk/ai/azure-ai-projects/tests/finetuning/test_finetuning.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. 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 1778fc35317a..b609c15eaf2a 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. diff --git a/sdk/ai/azure-ai-projects/tests/test_base.py b/sdk/ai/azure-ai-projects/tests/test_base.py index 188a1564d1ab..a564d0af8796 100644 --- a/sdk/ai/azure-ai-projects/tests/test_base.py +++ b/sdk/ai/azure-ai-projects/tests/test_base.py @@ -24,13 +24,13 @@ DeploymentType, Index, IndexType, - ItemContentType, + InputContentType, ItemResource, ItemType, ModelDeployment, - ResponsesMessageRole, ) from openai.types.responses import Response +from openai.types.conversations import ConversationItem from azure.ai.projects.models._models import AgentDetails, AgentVersionDetails from devtools_testutils import AzureRecordedTestCase, EnvironmentVariableLoader from azure.ai.projects import AIProjectClient as AIProjectClient @@ -539,17 +539,17 @@ def _validate_agent( def _validate_conversation_item( self, - item: ItemResource, + item: ConversationItem, *, expected_type: Optional[ItemType] = None, expected_id: Optional[str] = None, - expected_role: Optional[ResponsesMessageRole] = None, - expected_content_type: Optional[ItemContentType] = None, + expected_role: Optional[str] = None, + expected_content_type: Optional[InputContentType] = None, expected_content_text: Optional[str] = None, ) -> None: assert item - # From ItemResource: + # From ConversationItem: if expected_type: assert item.type == expected_type else: diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index 80b8dc2ae282..00631b52071a 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,4 +1,4 @@ -directory: specification/ai/Azure.AI.Projects -commit: 78bfd335c31b8764578cfb9840f3b74349c10354 -repo: Azure/azure-rest-api-specs-pr +directory: specification/ai/Foundry +commit: 51415f0131fc0e65f88e8a75b4b729a528e8e959 +repo: Azure/azure-rest-api-specs additionalDirectories: