From 3652cf16d068bc61d64a919a1e523eca4bcdc63c Mon Sep 17 00:00:00 2001 From: Travis Wilson Date: Thu, 13 Feb 2025 17:04:50 -0800 Subject: [PATCH 1/8] initial pluginification for aoai --- .../openai/Azure.AI.OpenAI/Configuration.json | 10 + ...alElasticsearchChatDataSourceParameters.cs | 2 +- .../OnYourData/AzureAISearchChatDataSource.cs | 8 +- .../Chat/OnYourData/CosmosChatDataSource.cs | 8 +- .../OnYourData/ElasticsearchChatDataSource.cs | 8 +- .../Chat/OnYourData/MongoDBChatDataSource.cs | 8 +- .../Chat/OnYourData/PineconeChatDataSource.cs | 8 +- ...equestContentFilterResult.Serialization.cs | 6 +- .../Files/AzureOpenAIFile.Serialization.cs | 6 +- .../src/Custom/Files/AzureOpenAIFile.cs | 6 +- .../Custom/Internal/AzureOpenAIChatError.cs | 2 +- .../Custom/Internal/AzureOpenAIDalleError.cs | 2 +- .../AzureOpenAIChatError.Serialization.cs | 107 +- .../src/Generated/AzureOpenAIChatError.cs | 66 +- ...reOpenAIChatErrorResponse.Serialization.cs | 75 +- .../Generated/AzureOpenAIChatErrorResponse.cs | 50 +- .../AzureOpenAIDalleError.Serialization.cs | 107 +- .../src/Generated/AzureOpenAIDalleError.cs | 66 +- ...eOpenAIDalleErrorResponse.Serialization.cs | 75 +- .../AzureOpenAIDalleErrorResponse.cs | 50 +- ...AzureSearchChatDataSource.Serialization.cs | 82 +- .../Generated/AzureSearchChatDataSource.cs | 3 - .../Generated/ChatCitation.Serialization.cs | 134 +- .../src/Generated/ChatCitation.cs | 70 +- .../Generated/ChatDataSource.Serialization.cs | 88 +- .../src/Generated/ChatDataSource.cs | 56 +- .../src/Generated/ChatDocumentFilterReason.cs | 38 +- .../ChatMessageContext.Serialization.cs | 102 +- .../src/Generated/ChatMessageContext.cs | 54 +- .../ChatRetrievedDocument.Serialization.cs | 180 +- .../src/Generated/ChatRetrievedDocument.cs | 83 +- ...tentFilterBlocklistResult.Serialization.cs | 99 +- .../Generated/ContentFilterBlocklistResult.cs | 55 +- ...tentFilterDetectionResult.Serialization.cs | 89 +- .../Generated/ContentFilterDetectionResult.cs | 57 +- ...tedMaterialCitationResult.Serialization.cs | 89 +- ...ntFilterProtectedMaterialCitationResult.cs | 51 +- ...erProtectedMaterialResult.Serialization.cs | 97 +- .../ContentFilterProtectedMaterialResult.cs | 61 +- .../src/Generated/ContentFilterSeverity.cs | 47 +- ...ntentFilterSeverityResult.Serialization.cs | 89 +- .../Generated/ContentFilterSeverityResult.cs | 56 +- .../ContentFilterTextSpan.Serialization.cs | 89 +- .../src/Generated/ContentFilterTextSpan.cs | 57 +- ...ntentFilterTextSpanResult.Serialization.cs | 99 +- .../Generated/ContentFilterTextSpanResult.cs | 67 +- .../CosmosChatDataSource.Serialization.cs | 82 +- .../src/Generated/CosmosChatDataSource.cs | 3 - .../DataSourceAuthentication.Serialization.cs | 97 +- .../src/Generated/DataSourceAuthentication.cs | 59 +- .../DataSourceFieldMappings.Serialization.cs | 204 +- .../src/Generated/DataSourceFieldMappings.cs | 54 +- .../src/Generated/DataSourceQueryType.cs | 53 +- .../DataSourceVectorizer.Serialization.cs | 85 +- .../src/Generated/DataSourceVectorizer.cs | 59 +- ...asticsearchChatDataSource.Serialization.cs | 82 +- .../Generated/ElasticsearchChatDataSource.cs | 3 - .../src/Generated/Internal/Argument.cs | 10 +- .../Generated/Internal/BinaryContentHelper.cs | 17 +- .../Internal/ChangeTrackingDictionary.cs | 3 +- .../Generated/Internal/ChangeTrackingList.cs | 2 +- .../Generated/Internal/ClientUriBuilder.cs | 132 +- .../src/Generated/Internal/ErrorResult.cs | 2 +- .../Internal/ModelSerializationExtensions.cs | 159 +- .../MultipartFormDataBinaryContent.cs | 197 - .../src/Generated/Internal/Optional.cs | 12 +- .../PipelineRequestHeadersExtensions.cs | 25 + .../src/Generated/Internal/TypeFormatters.cs | 150 + .../Internal/Utf8JsonBinaryContent.cs | 2 +- ...okenAuthenticationOptions.Serialization.cs | 78 +- ...aSourceAccessTokenAuthenticationOptions.cs | 20 +- ...iKeyAuthenticationOptions.Serialization.cs | 78 +- ...atDataSourceApiKeyAuthenticationOptions.cs | 20 +- ...ringAuthenticationOptions.Serialization.cs | 78 +- ...ceConnectionStringAuthenticationOptions.cs | 20 +- ...ntNameVectorizationSource.Serialization.cs | 92 +- ...SourceDeploymentNameVectorizationSource.cs | 42 +- ...iKeyAuthenticationOptions.Serialization.cs | 78 +- ...ourceEncodedApiKeyAuthenticationOptions.cs | 20 +- ...dpointVectorizationSource.Serialization.cs | 102 +- ...atDataSourceEndpointVectorizationSource.cs | 56 +- ...gratedVectorizationSource.Serialization.cs | 68 +- ...DataSourceIntegratedVectorizationSource.cs | 10 +- ...eyIdAuthenticationOptions.Serialization.cs | 84 +- ...aSourceKeyAndKeyIdAuthenticationOptions.cs | 24 +- ...odelIdVectorizationSource.Serialization.cs | 78 +- ...hatDataSourceModelIdVectorizationSource.cs | 23 +- ...tityAuthenticationOptions.Serialization.cs | 68 +- ...nedManagedIdentityAuthenticationOptions.cs | 10 +- ...tityAuthenticationOptions.Serialization.cs | 78 +- ...nedManagedIdentityAuthenticationOptions.cs | 20 +- ...wordAuthenticationOptions.Serialization.cs | 84 +- ...sernameAndPasswordAuthenticationOptions.cs | 24 +- ...ntFilterBlocklistIdResult.Serialization.cs | 83 +- ...rnalAzureContentFilterBlocklistIdResult.cs | 66 +- ...lterBlocklistResultDetail.Serialization.cs | 83 +- ...AzureContentFilterBlocklistResultDetail.cs | 63 +- ...ilterResultForChoiceError.Serialization.cs | 83 +- ...lAzureContentFilterResultForChoiceError.cs | 63 +- ...romptContentFilterResults.Serialization.cs | 139 +- ...lterResultForPromptContentFilterResults.cs | 147 +- ...BChatDataSourceParameters.Serialization.cs | 222 +- ...alAzureCosmosDBChatDataSourceParameters.cs | 129 +- ...OpenAIChatErrorInnerError.Serialization.cs | 89 +- .../InternalAzureOpenAIChatErrorInnerError.cs | 56 +- ...ernalAzureOpenAIChatErrorInnerErrorCode.cs | 26 +- ...penAIDalleErrorInnerError.Serialization.cs | 89 +- ...InternalAzureOpenAIDalleErrorInnerError.cs | 56 +- ...rnalAzureOpenAIDalleErrorInnerErrorCode.cs | 26 +- ...hChatDataSourceParameters.Serialization.cs | 262 +- ...rnalAzureSearchChatDataSourceParameters.cs | 128 +- ...hChatDataSourceParametersIncludeContext.cs | 34 +- ...hChatDataSourceParameters.Serialization.cs | 220 +- ...alElasticsearchChatDataSourceParameters.cs | 114 +- ...BChatDataSourceParameters.Serialization.cs | 226 +- ...InternalMongoDBChatDataSourceParameters.cs | 151 +- ...eChatDataSourceParameters.Serialization.cs | 212 +- ...nternalPineconeChatDataSourceParameters.cs | 139 +- ...nknownAzureChatDataSource.Serialization.cs | 69 +- .../InternalUnknownAzureChatDataSource.cs | 11 +- ...urceAuthenticationOptions.Serialization.cs | 69 +- ...zureChatDataSourceAuthenticationOptions.cs | 11 +- ...SourceVectorizationSource.Serialization.cs | 69 +- ...nAzureChatDataSourceVectorizationSource.cs | 11 +- .../MongoDBChatDataSource.Serialization.cs | 82 +- .../src/Generated/MongoDBChatDataSource.cs | 3 - .../PineconeChatDataSource.Serialization.cs | 82 +- .../src/Generated/PineconeChatDataSource.cs | 3 - ...equestContentFilterResult.Serialization.cs | 91 +- .../Generated/RequestContentFilterResult.cs | 49 +- ...tImageContentFilterResult.Serialization.cs | 129 +- .../RequestImageContentFilterResult.cs | 50 +- ...sponseContentFilterResult.Serialization.cs | 165 +- .../Generated/ResponseContentFilterResult.cs | 85 +- ...eImageContentFilterResult.Serialization.cs | 105 +- .../ResponseImageContentFilterResult.cs | 70 +- .../UserSecurityContext.Serialization.cs | 99 +- .../src/Generated/UserSecurityContext.cs | 49 +- .../openai/Azure.AI.OpenAI/tspCodeModel.json | 12494 ++++++++++++++++ .plugin.azure/.gitignore | 184 + .plugin.azure/emitter/src/emitter.ts | 12 + .plugin.azure/emitter/src/index.ts | 1 + .../generator/AzureOpenAI.Library.Plugin.sln | 22 + .../src/AzureOpenAI.Library.Plugin.csproj | 23 + .../generator/src/AzureOpenAILibraryPlugin.cs | 21 + .../src/AzureOpenAILibraryVisitor.cs | 187 + .plugin.azure/generator/src/DocEditVisitor.cs | 64 + .../src/Properties/launchSettings.json | 9 + .plugin.azure/nuget.config | 9 + .plugin.azure/package.json | 45 + .plugin.azure/tsconfig.build.json | 11 + .plugin.azure/tsconfig.json | 27 + .plugin.azure/tspconfig.yaml | 4 + .scripts.azure/Invoke-CodeGen.ps1 | 2 + .typespec.azure/tspconfig.yaml | 9 +- package-lock.json | 32 +- package.json | 4 +- 157 files changed, 17177 insertions(+), 5600 deletions(-) create mode 100644 .dotnet.azure/sdk/openai/Azure.AI.OpenAI/Configuration.json delete mode 100644 .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/MultipartFormDataBinaryContent.cs create mode 100644 .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/PipelineRequestHeadersExtensions.cs create mode 100644 .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/TypeFormatters.cs create mode 100644 .dotnet.azure/sdk/openai/Azure.AI.OpenAI/tspCodeModel.json create mode 100644 .plugin.azure/.gitignore create mode 100644 .plugin.azure/emitter/src/emitter.ts create mode 100644 .plugin.azure/emitter/src/index.ts create mode 100644 .plugin.azure/generator/AzureOpenAI.Library.Plugin.sln create mode 100644 .plugin.azure/generator/src/AzureOpenAI.Library.Plugin.csproj create mode 100644 .plugin.azure/generator/src/AzureOpenAILibraryPlugin.cs create mode 100644 .plugin.azure/generator/src/AzureOpenAILibraryVisitor.cs create mode 100644 .plugin.azure/generator/src/DocEditVisitor.cs create mode 100644 .plugin.azure/generator/src/Properties/launchSettings.json create mode 100644 .plugin.azure/nuget.config create mode 100644 .plugin.azure/package.json create mode 100644 .plugin.azure/tsconfig.build.json create mode 100644 .plugin.azure/tsconfig.json create mode 100644 .plugin.azure/tspconfig.yaml diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/Configuration.json b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/Configuration.json new file mode 100644 index 000000000..af0888870 --- /dev/null +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/Configuration.json @@ -0,0 +1,10 @@ +{ + "output-folder": ".", + "namespace": "Azure.AI.OpenAI", + "library-name": "Azure.AI.OpenAI", + "single-top-level-client": true, + "unreferenced-types-handling": "keepAll", + "model-namespace": false, + "flavor": "unbranded", + "use-model-reader-writer": true +} diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/Internal/InternalElasticsearchChatDataSourceParameters.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/Internal/InternalElasticsearchChatDataSourceParameters.cs index 6849475ba..75f7b137d 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/Internal/InternalElasticsearchChatDataSourceParameters.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/Internal/InternalElasticsearchChatDataSourceParameters.cs @@ -11,7 +11,7 @@ namespace Azure.AI.OpenAI.Chat; internal partial class InternalElasticsearchChatDataSourceParameters { [CodeGenMember("IncludeContexts")] - private IList _internalIncludeContexts = new ChangeTrackingList(); + private IList _internalIncludeContexts { get; set; } = new ChangeTrackingList(); private DataSourceOutputContexts? _outputContexts; /// diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureAISearchChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureAISearchChatDataSource.cs index 6bd1abc36..395d1e9e2 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureAISearchChatDataSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureAISearchChatDataSource.cs @@ -115,7 +115,7 @@ public DataSourceVectorizer VectorizationSource /// /// Creates a new instance of . /// - public AzureSearchChatDataSource() : base(type: "azure_search", serializedAdditionalRawData: null) + public AzureSearchChatDataSource() : base(type: "azure_search", additionalBinaryDataProperties: null) { InternalParameters = new(); } @@ -132,11 +132,11 @@ internal AzureSearchChatDataSource(InternalAzureSearchChatDataSourceParameters i /// Initializes a new instance of . /// - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The parameter information to control the use of the Azure Search data source. [SetsRequiredMembers] - internal AzureSearchChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalAzureSearchChatDataSourceParameters internalParameters) - : base(type, serializedAdditionalRawData) + internal AzureSearchChatDataSource(string type, IDictionary additionalBinaryDataProperties, InternalAzureSearchChatDataSourceParameters internalParameters) + : base(type, additionalBinaryDataProperties) { InternalParameters = internalParameters; } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/CosmosChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/CosmosChatDataSource.cs index 26d8f3d53..5e1442726 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/CosmosChatDataSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/CosmosChatDataSource.cs @@ -101,7 +101,7 @@ public DataSourceOutputContexts? OutputContexts /// /// Initializes a new instance of . /// - public CosmosChatDataSource() : base(type: "azure_cosmos_db", serializedAdditionalRawData: null) + public CosmosChatDataSource() : base(type: "azure_cosmos_db", additionalBinaryDataProperties: null) { InternalParameters = new(); } @@ -118,11 +118,11 @@ internal CosmosChatDataSource(InternalAzureCosmosDBChatDataSourceParameters inte /// Initializes a new instance of . /// - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The parameter information to control the use of the Azure Search data source. [SetsRequiredMembers] - internal CosmosChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalAzureCosmosDBChatDataSourceParameters internalParameters) - : base(type, serializedAdditionalRawData) + internal CosmosChatDataSource(string type, IDictionary additionalBinaryDataProperties, InternalAzureCosmosDBChatDataSourceParameters internalParameters) + : base(type, additionalBinaryDataProperties) { InternalParameters = internalParameters; } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/ElasticsearchChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/ElasticsearchChatDataSource.cs index fca284581..384ad4730 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/ElasticsearchChatDataSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/ElasticsearchChatDataSource.cs @@ -104,7 +104,7 @@ public DataSourceVectorizer VectorizationSource set => InternalParameters.VectorizationSource = value; } - public ElasticsearchChatDataSource() : base(type: "elasticsearch", serializedAdditionalRawData: null) + public ElasticsearchChatDataSource() : base(type: "elasticsearch", additionalBinaryDataProperties: null) { InternalParameters = new(); } @@ -129,11 +129,11 @@ internal ElasticsearchChatDataSource(InternalElasticsearchChatDataSourceParamete /// Initializes a new instance of . /// - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The parameter information to control the use of the Azure Search data source. [SetsRequiredMembers] - internal ElasticsearchChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalElasticsearchChatDataSourceParameters internalParameters) - : base(type, serializedAdditionalRawData) + internal ElasticsearchChatDataSource(string type, IDictionary additionalBinaryDataProperties, InternalElasticsearchChatDataSourceParameters internalParameters) + : base(type, additionalBinaryDataProperties) { InternalParameters = internalParameters; } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/MongoDBChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/MongoDBChatDataSource.cs index e3fb59e1d..e9232b32d 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/MongoDBChatDataSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/MongoDBChatDataSource.cs @@ -106,7 +106,7 @@ public DataSourceVectorizer VectorizationSource /// /// Creates a new instance of . /// - public MongoDBChatDataSource() : base(type: "mongo_db", serializedAdditionalRawData: null) + public MongoDBChatDataSource() : base(type: "mongo_db", additionalBinaryDataProperties: null) { InternalParameters = new(); } @@ -131,11 +131,11 @@ internal MongoDBChatDataSource(InternalMongoDBChatDataSourceParameters internalP /// Initializes a new instance of . /// - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The parameter information to control the use of the Azure Search data source. [SetsRequiredMembers] - internal MongoDBChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalMongoDBChatDataSourceParameters internalParameters) - : base(type, serializedAdditionalRawData) + internal MongoDBChatDataSource(string type, IDictionary additionalBinaryDataProperties, InternalMongoDBChatDataSourceParameters internalParameters) + : base(type, additionalBinaryDataProperties) { InternalParameters = internalParameters; } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/PineconeChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/PineconeChatDataSource.cs index 33c2cb95e..67f42132c 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/PineconeChatDataSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/PineconeChatDataSource.cs @@ -97,7 +97,7 @@ public DataSourceOutputContexts? OutputContexts set => InternalParameters.OutputContexts = value; } - public PineconeChatDataSource() : base(type: "pinecone", serializedAdditionalRawData: null) + public PineconeChatDataSource() : base(type: "pinecone", additionalBinaryDataProperties: null) { InternalParameters = new(); } @@ -122,11 +122,11 @@ internal PineconeChatDataSource(InternalPineconeChatDataSourceParameters interna /// Initializes a new instance of . /// - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The parameter information to control the use of the Azure Search data source. [SetsRequiredMembers] - internal PineconeChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalPineconeChatDataSourceParameters internalParameters) - : base(type, serializedAdditionalRawData) + internal PineconeChatDataSource(string type, IDictionary additionalBinaryDataProperties, InternalPineconeChatDataSourceParameters internalParameters) + : base(type, additionalBinaryDataProperties) { InternalParameters = internalParameters; } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/RequestContentFilterResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/RequestContentFilterResult.Serialization.cs index 545ee7baf..5ac827498 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/RequestContentFilterResult.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/RequestContentFilterResult.Serialization.cs @@ -18,7 +18,7 @@ internal static RequestContentFilterResult DeserializeContentFilterResultForProm } int? promptIndex = default; InternalAzureContentFilterResultForPromptContentFilterResults contentFilterResults = default; - IDictionary serializedAdditionalRawData = default; + IDictionary additionalBinaryDataProperties = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { @@ -47,7 +47,7 @@ internal static RequestContentFilterResult DeserializeContentFilterResultForProm rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new RequestContentFilterResult(promptIndex, contentFilterResults, serializedAdditionalRawData); + additionalBinaryDataProperties = rawDataDictionary; + return new RequestContentFilterResult(promptIndex, contentFilterResults, additionalBinaryDataProperties); } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFile.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFile.Serialization.cs index bbed5e234..629c0afbc 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFile.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFile.Serialization.cs @@ -97,7 +97,7 @@ internal static AzureOpenAIFile DeserializeAzureOpenAIFile(JsonElement element, string purpose = default; string statusDetails = default; AzureOpenAIFileStatus status = default; - IDictionary serializedAdditionalRawData = default; + IDictionary additionalBinaryDataProperties = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { @@ -152,7 +152,7 @@ internal static AzureOpenAIFile DeserializeAzureOpenAIFile(JsonElement element, rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; + additionalBinaryDataProperties = rawDataDictionary; return new AzureOpenAIFile( id, bytes, @@ -162,7 +162,7 @@ internal static AzureOpenAIFile DeserializeAzureOpenAIFile(JsonElement element, purpose, statusDetails, status, - serializedAdditionalRawData); + additionalBinaryDataProperties); } void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFile.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFile.cs index e911e77d3..c4c26e6ce 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFile.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFile.cs @@ -75,9 +75,9 @@ internal AzureOpenAIFile(string id, int? bytes, DateTimeOffset createdAt, string /// The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results` and `vision`. /// Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. /// - /// Keeps track of any properties unknown to the library. - internal AzureOpenAIFile(string id, int? bytes, DateTimeOffset createdAt, string filename, InternalOpenAIFileObject @object, string purpose, string statusDetails, AzureOpenAIFileStatus azureStatus, IDictionary serializedAdditionalRawData) - : base(id, createdAt, filename, purpose.ToFilePurpose(), @object, bytes, azureStatus.ToFileStatus(), statusDetails, serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AzureOpenAIFile(string id, int? bytes, DateTimeOffset createdAt, string filename, InternalOpenAIFileObject @object, string purpose, string statusDetails, AzureOpenAIFileStatus azureStatus, IDictionary additionalBinaryDataProperties) + : base(id, createdAt, filename, purpose.ToFilePurpose(), @object, bytes, azureStatus.ToFileStatus(), statusDetails, additionalBinaryDataProperties) { _object = @object.ToString(); _purpose = purpose; diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureOpenAIChatError.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureOpenAIChatError.cs index 0940684db..2f61a1094 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureOpenAIChatError.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureOpenAIChatError.cs @@ -18,7 +18,7 @@ internal static AzureOpenAIChatError TryCreateFromResponse(PipelineResponse resp { using JsonDocument errorDocument = JsonDocument.Parse(response.Content); AzureOpenAIChatErrorResponse errorResponse - = AzureOpenAIChatErrorResponse.DeserializeAzureOpenAIChatErrorResponse(errorDocument.RootElement); + = AzureOpenAIChatErrorResponse.DeserializeAzureOpenAIChatErrorResponse(errorDocument.RootElement, null); return errorResponse.Error; } catch (InvalidOperationException) diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureOpenAIDalleError.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureOpenAIDalleError.cs index a6bdb5975..10bc8401f 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureOpenAIDalleError.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureOpenAIDalleError.cs @@ -18,7 +18,7 @@ internal static AzureOpenAIDalleError TryCreateFromResponse(PipelineResponse res { using JsonDocument errorDocument = JsonDocument.Parse(response.Content); AzureOpenAIDalleErrorResponse errorResponse - = AzureOpenAIDalleErrorResponse.DeserializeAzureOpenAIDalleErrorResponse(errorDocument.RootElement); + = AzureOpenAIDalleErrorResponse.DeserializeAzureOpenAIDalleErrorResponse(errorDocument.RootElement, null); return errorResponse.Error; } catch (InvalidOperationException) diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs index b81a78292..8ad0d6ac7 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs @@ -19,44 +19,41 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AzureOpenAIChatError)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("code") != true && Optional.IsDefined(Code)) + if (Optional.IsDefined(Code) && _additionalBinaryDataProperties?.ContainsKey("code") != true) { writer.WritePropertyName("code"u8); writer.WriteStringValue(Code); } - if (SerializedAdditionalRawData?.ContainsKey("message") != true && Optional.IsDefined(Message)) + if (Optional.IsDefined(Message) && _additionalBinaryDataProperties?.ContainsKey("message") != true) { writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); } - if (SerializedAdditionalRawData?.ContainsKey("param") != true && Optional.IsDefined(Param)) + if (Optional.IsDefined(Param) && _additionalBinaryDataProperties?.ContainsKey("param") != true) { writer.WritePropertyName("param"u8); writer.WriteStringValue(Param); } - if (SerializedAdditionalRawData?.ContainsKey("type") != true && Optional.IsDefined(Type)) + if (Optional.IsDefined(Type) && _additionalBinaryDataProperties?.ContainsKey("type") != true) { writer.WritePropertyName("type"u8); writer.WriteStringValue(Type); } - if (SerializedAdditionalRawData?.ContainsKey("inner_error") != true && Optional.IsDefined(InnerError)) + if (Optional.IsDefined(InnerError) && _additionalBinaryDataProperties?.ContainsKey("inner_error") != true) { writer.WritePropertyName("inner_error"u8); writer.WriteObjectValue(InnerError, options); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -64,7 +61,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -75,84 +72,81 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AzureOpenAIChatError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AzureOpenAIChatError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected virtual AzureOpenAIChatError JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AzureOpenAIChatError)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAzureOpenAIChatError(document.RootElement, options); } - internal static AzureOpenAIChatError DeserializeAzureOpenAIChatError(JsonElement element, ModelReaderWriterOptions options = null) + internal static AzureOpenAIChatError DeserializeAzureOpenAIChatError(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string code = default; string message = default; - string param = default; - string type = default; + string @param = default; + string @type = default; InternalAzureOpenAIChatErrorInnerError innerError = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("code"u8)) + if (prop.NameEquals("code"u8)) { - code = property.Value.GetString(); + code = prop.Value.GetString(); continue; } - if (property.NameEquals("message"u8)) + if (prop.NameEquals("message"u8)) { - message = property.Value.GetString(); + message = prop.Value.GetString(); continue; } - if (property.NameEquals("param"u8)) + if (prop.NameEquals("param"u8)) { - param = property.Value.GetString(); + @param = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("inner_error"u8)) + if (prop.NameEquals("inner_error"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - innerError = InternalAzureOpenAIChatErrorInnerError.DeserializeInternalAzureOpenAIChatErrorInnerError(property.Value, options); + innerError = InternalAzureOpenAIChatErrorInnerError.DeserializeInternalAzureOpenAIChatErrorInnerError(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AzureOpenAIChatError( code, message, - param, - type, + @param, + @type, innerError, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -162,15 +156,16 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - AzureOpenAIChatError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + AzureOpenAIChatError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected virtual AzureOpenAIChatError PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeAzureOpenAIChatError(document.RootElement, options); } default: @@ -180,18 +175,20 @@ AzureOpenAIChatError IPersistableModel.Create(BinaryData d string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static AzureOpenAIChatError FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(AzureOpenAIChatError azureOpenAIChatError) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAzureOpenAIChatError(document.RootElement); + if (azureOpenAIChatError == null) + { + return null; + } + return BinaryContent.Create(azureOpenAIChatError, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + public static explicit operator AzureOpenAIChatError(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeAzureOpenAIChatError(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs index b379c88ac..62c077fcd 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs @@ -7,71 +7,39 @@ namespace Azure.AI.OpenAI { - /// The structured representation of an error from an Azure OpenAI chat completion request. internal partial class AzureOpenAIChatError { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal AzureOpenAIChatError() { } - /// Initializes a new instance of . - /// The distinct, machine-generated identifier for the error. - /// A human-readable message associated with the error. - /// If applicable, the request input parameter associated with the error. - /// If applicable, the input line number associated with the error. - /// If applicable, an upstream error that originated this error. - /// Keeps track of any properties unknown to the library. - internal AzureOpenAIChatError(string code, string message, string param, string type, InternalAzureOpenAIChatErrorInnerError innerError, IDictionary serializedAdditionalRawData) + internal AzureOpenAIChatError(string code, string message, string @param, string @type, InternalAzureOpenAIChatErrorInnerError innerError, IDictionary additionalBinaryDataProperties) { Code = code; Message = message; - Param = param; - Type = type; + Param = @param; + Type = @type; InnerError = innerError; - SerializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// The distinct, machine-generated identifier for the error. public string Code { get; } - /// A human-readable message associated with the error. + public string Message { get; } - /// If applicable, the request input parameter associated with the error. + public string Param { get; } - /// If applicable, the input line number associated with the error. + public string Type { get; } - /// If applicable, an upstream error that originated this error. + public InternalAzureOpenAIChatErrorInnerError InnerError { get; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs index 18d3d9b78..47804130d 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs @@ -19,24 +19,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AzureOpenAIChatErrorResponse)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("error") != true && Optional.IsDefined(Error)) + if (Optional.IsDefined(Error) && _additionalBinaryDataProperties?.ContainsKey("error") != true) { writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -44,7 +41,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -55,54 +52,51 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AzureOpenAIChatErrorResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AzureOpenAIChatErrorResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected virtual AzureOpenAIChatErrorResponse JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AzureOpenAIChatErrorResponse)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAzureOpenAIChatErrorResponse(document.RootElement, options); } - internal static AzureOpenAIChatErrorResponse DeserializeAzureOpenAIChatErrorResponse(JsonElement element, ModelReaderWriterOptions options = null) + internal static AzureOpenAIChatErrorResponse DeserializeAzureOpenAIChatErrorResponse(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } AzureOpenAIChatError error = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("error"u8)) + if (prop.NameEquals("error"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - error = AzureOpenAIChatError.DeserializeAzureOpenAIChatError(property.Value, options); + error = AzureOpenAIChatError.DeserializeAzureOpenAIChatError(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AzureOpenAIChatErrorResponse(error, serializedAdditionalRawData); + return new AzureOpenAIChatErrorResponse(error, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -112,15 +106,16 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - AzureOpenAIChatErrorResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + AzureOpenAIChatErrorResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected virtual AzureOpenAIChatErrorResponse PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeAzureOpenAIChatErrorResponse(document.RootElement, options); } default: @@ -130,18 +125,20 @@ AzureOpenAIChatErrorResponse IPersistableModel.Cre string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static AzureOpenAIChatErrorResponse FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(AzureOpenAIChatErrorResponse azureOpenAIChatErrorResponse) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAzureOpenAIChatErrorResponse(document.RootElement); + if (azureOpenAIChatErrorResponse == null) + { + return null; + } + return BinaryContent.Create(azureOpenAIChatErrorResponse, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + public static explicit operator AzureOpenAIChatErrorResponse(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeAzureOpenAIChatErrorResponse(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs index 767fce2b0..1cc1c60f8 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs @@ -7,55 +7,27 @@ namespace Azure.AI.OpenAI { - /// A structured representation of an error an Azure OpenAI request. internal partial class AzureOpenAIChatErrorResponse { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal AzureOpenAIChatErrorResponse() { } - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal AzureOpenAIChatErrorResponse(AzureOpenAIChatError error, IDictionary serializedAdditionalRawData) + internal AzureOpenAIChatErrorResponse(AzureOpenAIChatError error, IDictionary additionalBinaryDataProperties) { Error = error; - SerializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets the error. public AzureOpenAIChatError Error { get; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs index ce364c570..7eb6d9501 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs @@ -19,44 +19,41 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AzureOpenAIDalleError)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("code") != true && Optional.IsDefined(Code)) + if (Optional.IsDefined(Code) && _additionalBinaryDataProperties?.ContainsKey("code") != true) { writer.WritePropertyName("code"u8); writer.WriteStringValue(Code); } - if (SerializedAdditionalRawData?.ContainsKey("message") != true && Optional.IsDefined(Message)) + if (Optional.IsDefined(Message) && _additionalBinaryDataProperties?.ContainsKey("message") != true) { writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); } - if (SerializedAdditionalRawData?.ContainsKey("param") != true && Optional.IsDefined(Param)) + if (Optional.IsDefined(Param) && _additionalBinaryDataProperties?.ContainsKey("param") != true) { writer.WritePropertyName("param"u8); writer.WriteStringValue(Param); } - if (SerializedAdditionalRawData?.ContainsKey("type") != true && Optional.IsDefined(Type)) + if (Optional.IsDefined(Type) && _additionalBinaryDataProperties?.ContainsKey("type") != true) { writer.WritePropertyName("type"u8); writer.WriteStringValue(Type); } - if (SerializedAdditionalRawData?.ContainsKey("inner_error") != true && Optional.IsDefined(InnerError)) + if (Optional.IsDefined(InnerError) && _additionalBinaryDataProperties?.ContainsKey("inner_error") != true) { writer.WritePropertyName("inner_error"u8); writer.WriteObjectValue(InnerError, options); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -64,7 +61,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -75,84 +72,81 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AzureOpenAIDalleError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AzureOpenAIDalleError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected virtual AzureOpenAIDalleError JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AzureOpenAIDalleError)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAzureOpenAIDalleError(document.RootElement, options); } - internal static AzureOpenAIDalleError DeserializeAzureOpenAIDalleError(JsonElement element, ModelReaderWriterOptions options = null) + internal static AzureOpenAIDalleError DeserializeAzureOpenAIDalleError(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string code = default; string message = default; - string param = default; - string type = default; + string @param = default; + string @type = default; InternalAzureOpenAIDalleErrorInnerError innerError = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("code"u8)) + if (prop.NameEquals("code"u8)) { - code = property.Value.GetString(); + code = prop.Value.GetString(); continue; } - if (property.NameEquals("message"u8)) + if (prop.NameEquals("message"u8)) { - message = property.Value.GetString(); + message = prop.Value.GetString(); continue; } - if (property.NameEquals("param"u8)) + if (prop.NameEquals("param"u8)) { - param = property.Value.GetString(); + @param = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("inner_error"u8)) + if (prop.NameEquals("inner_error"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - innerError = InternalAzureOpenAIDalleErrorInnerError.DeserializeInternalAzureOpenAIDalleErrorInnerError(property.Value, options); + innerError = InternalAzureOpenAIDalleErrorInnerError.DeserializeInternalAzureOpenAIDalleErrorInnerError(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new AzureOpenAIDalleError( code, message, - param, - type, + @param, + @type, innerError, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -162,15 +156,16 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio } } - AzureOpenAIDalleError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + AzureOpenAIDalleError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected virtual AzureOpenAIDalleError PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeAzureOpenAIDalleError(document.RootElement, options); } default: @@ -180,18 +175,20 @@ AzureOpenAIDalleError IPersistableModel.Create(BinaryData string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static AzureOpenAIDalleError FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(AzureOpenAIDalleError azureOpenAIDalleError) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAzureOpenAIDalleError(document.RootElement); + if (azureOpenAIDalleError == null) + { + return null; + } + return BinaryContent.Create(azureOpenAIDalleError, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + public static explicit operator AzureOpenAIDalleError(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeAzureOpenAIDalleError(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs index 7dfb2de16..840c31402 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs @@ -7,71 +7,39 @@ namespace Azure.AI.OpenAI { - /// The structured representation of an error from an Azure OpenAI image generation request. internal partial class AzureOpenAIDalleError { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal AzureOpenAIDalleError() { } - /// Initializes a new instance of . - /// The distinct, machine-generated identifier for the error. - /// A human-readable message associated with the error. - /// If applicable, the request input parameter associated with the error. - /// If applicable, the input line number associated with the error. - /// If applicable, an upstream error that originated this error. - /// Keeps track of any properties unknown to the library. - internal AzureOpenAIDalleError(string code, string message, string param, string type, InternalAzureOpenAIDalleErrorInnerError innerError, IDictionary serializedAdditionalRawData) + internal AzureOpenAIDalleError(string code, string message, string @param, string @type, InternalAzureOpenAIDalleErrorInnerError innerError, IDictionary additionalBinaryDataProperties) { Code = code; Message = message; - Param = param; - Type = type; + Param = @param; + Type = @type; InnerError = innerError; - SerializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// The distinct, machine-generated identifier for the error. public string Code { get; } - /// A human-readable message associated with the error. + public string Message { get; } - /// If applicable, the request input parameter associated with the error. + public string Param { get; } - /// If applicable, the input line number associated with the error. + public string Type { get; } - /// If applicable, an upstream error that originated this error. + public InternalAzureOpenAIDalleErrorInnerError InnerError { get; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs index 8c44690cc..d82f217b9 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs @@ -19,24 +19,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AzureOpenAIDalleErrorResponse)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("error") != true && Optional.IsDefined(Error)) + if (Optional.IsDefined(Error) && _additionalBinaryDataProperties?.ContainsKey("error") != true) { writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -44,7 +41,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -55,54 +52,51 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AzureOpenAIDalleErrorResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AzureOpenAIDalleErrorResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected virtual AzureOpenAIDalleErrorResponse JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AzureOpenAIDalleErrorResponse)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAzureOpenAIDalleErrorResponse(document.RootElement, options); } - internal static AzureOpenAIDalleErrorResponse DeserializeAzureOpenAIDalleErrorResponse(JsonElement element, ModelReaderWriterOptions options = null) + internal static AzureOpenAIDalleErrorResponse DeserializeAzureOpenAIDalleErrorResponse(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } AzureOpenAIDalleError error = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("error"u8)) + if (prop.NameEquals("error"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - error = AzureOpenAIDalleError.DeserializeAzureOpenAIDalleError(property.Value, options); + error = AzureOpenAIDalleError.DeserializeAzureOpenAIDalleError(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AzureOpenAIDalleErrorResponse(error, serializedAdditionalRawData); + return new AzureOpenAIDalleErrorResponse(error, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -112,15 +106,16 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - AzureOpenAIDalleErrorResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + AzureOpenAIDalleErrorResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected virtual AzureOpenAIDalleErrorResponse PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeAzureOpenAIDalleErrorResponse(document.RootElement, options); } default: @@ -130,18 +125,20 @@ AzureOpenAIDalleErrorResponse IPersistableModel.C string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static AzureOpenAIDalleErrorResponse FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(AzureOpenAIDalleErrorResponse azureOpenAIDalleErrorResponse) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAzureOpenAIDalleErrorResponse(document.RootElement); + if (azureOpenAIDalleErrorResponse == null) + { + return null; + } + return BinaryContent.Create(azureOpenAIDalleErrorResponse, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + public static explicit operator AzureOpenAIDalleErrorResponse(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeAzureOpenAIDalleErrorResponse(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs index 6aafb0c3d..a0d91b3fc 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs @@ -7,55 +7,27 @@ namespace Azure.AI.OpenAI { - /// A structured representation of an error an Azure OpenAI request. internal partial class AzureOpenAIDalleErrorResponse { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal AzureOpenAIDalleErrorResponse() { } - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal AzureOpenAIDalleErrorResponse(AzureOpenAIDalleError error, IDictionary serializedAdditionalRawData) + internal AzureOpenAIDalleErrorResponse(AzureOpenAIDalleError error, IDictionary additionalBinaryDataProperties) { Error = error; - SerializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets the error. public AzureOpenAIDalleError Error { get; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs index b19eb9d33..0da6eca1b 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs @@ -7,9 +7,11 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { + /// public partial class AzureSearchChatDataSource : IJsonModel { void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -23,70 +25,69 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AzureSearchChatDataSource)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) + if (_additionalBinaryDataProperties?.ContainsKey("parameters") != true) { writer.WritePropertyName("parameters"u8); writer.WriteObjectValue(InternalParameters, options); } } - AzureSearchChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AzureSearchChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AzureSearchChatDataSource)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ChatDataSource JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AzureSearchChatDataSource)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAzureSearchChatDataSource(document.RootElement, options); } - internal static AzureSearchChatDataSource DeserializeAzureSearchChatDataSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static AzureSearchChatDataSource DeserializeAzureSearchChatDataSource(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - InternalAzureSearchChatDataSourceParameters parameters = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string @type = "azure_search"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + InternalAzureSearchChatDataSourceParameters internalParameters = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("parameters"u8)) + if (prop.NameEquals("type"u8)) { - parameters = InternalAzureSearchChatDataSourceParameters.DeserializeInternalAzureSearchChatDataSourceParameters(property.Value, options); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("parameters"u8)) { - type = property.Value.GetString(); + internalParameters = InternalAzureSearchChatDataSourceParameters.DeserializeInternalAzureSearchChatDataSourceParameters(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AzureSearchChatDataSource(type, serializedAdditionalRawData, parameters); + return new AzureSearchChatDataSource(@type, additionalBinaryDataProperties, internalParameters); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -96,15 +97,18 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - AzureSearchChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + AzureSearchChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AzureSearchChatDataSource)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ChatDataSource PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeAzureSearchChatDataSource(document.RootElement, options); } default: @@ -114,18 +118,22 @@ AzureSearchChatDataSource IPersistableModel.Create(Bi string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new AzureSearchChatDataSource FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(AzureSearchChatDataSource azureSearchChatDataSource) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeAzureSearchChatDataSource(document.RootElement); + if (azureSearchChatDataSource == null) + { + return null; + } + return BinaryContent.Create(azureSearchChatDataSource, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator AzureSearchChatDataSource(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeAzureSearchChatDataSource(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs index 417a6abd7..98028c7fe 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs @@ -2,9 +2,6 @@ #nullable disable -using System; -using System.Collections.Generic; - namespace Azure.AI.OpenAI.Chat { /// Represents a data source configuration that will use an Azure Search resource. diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.Serialization.cs index a9ee56a9e..739dbc3ce 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.Serialization.cs @@ -7,11 +7,17 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { + /// public partial class ChatCitation : IJsonModel { + internal ChatCitation() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -23,45 +29,44 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ChatCitation)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("content") != true) + if (_additionalBinaryDataProperties?.ContainsKey("content") != true) { writer.WritePropertyName("content"u8); writer.WriteStringValue(Content); } - if (SerializedAdditionalRawData?.ContainsKey("title") != true && Optional.IsDefined(Title)) + if (Optional.IsDefined(Title) && _additionalBinaryDataProperties?.ContainsKey("title") != true) { writer.WritePropertyName("title"u8); writer.WriteStringValue(Title); } - if (SerializedAdditionalRawData?.ContainsKey("url") != true && Optional.IsDefined(Url)) + if (Optional.IsDefined(Url) && _additionalBinaryDataProperties?.ContainsKey("url") != true) { writer.WritePropertyName("url"u8); writer.WriteStringValue(Url); } - if (SerializedAdditionalRawData?.ContainsKey("filepath") != true && Optional.IsDefined(FilePath)) - { - writer.WritePropertyName("filepath"u8); - writer.WriteStringValue(FilePath); - } - if (SerializedAdditionalRawData?.ContainsKey("chunk_id") != true && Optional.IsDefined(ChunkId)) + if (Optional.IsDefined(ChunkId) && _additionalBinaryDataProperties?.ContainsKey("chunk_id") != true) { writer.WritePropertyName("chunk_id"u8); writer.WriteStringValue(ChunkId); } - if (SerializedAdditionalRawData?.ContainsKey("rerank_score") != true && Optional.IsDefined(RerankScore)) + if (Optional.IsDefined(RerankScore) && _additionalBinaryDataProperties?.ContainsKey("rerank_score") != true) { writer.WritePropertyName("rerank_score"u8); writer.WriteNumberValue(RerankScore.Value); } - if (SerializedAdditionalRawData != null) + if (Optional.IsDefined(FilePath) && _additionalBinaryDataProperties?.ContainsKey("filepath") != true) { - foreach (var item in SerializedAdditionalRawData) + writer.WritePropertyName("filepath"u8); + writer.WriteStringValue(FilePath); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -69,7 +74,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -80,22 +85,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ChatCitation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChatCitation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ChatCitation JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ChatCitation)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeChatCitation(document.RootElement, options); } - internal static ChatCitation DeserializeChatCitation(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChatCitation DeserializeChatCitation(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -103,68 +109,67 @@ internal static ChatCitation DeserializeChatCitation(JsonElement element, ModelR string content = default; string title = default; string url = default; - string filepath = default; string chunkId = default; double? rerankScore = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string filePath = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("content"u8)) + if (prop.NameEquals("content"u8)) { - content = property.Value.GetString(); + content = prop.Value.GetString(); continue; } - if (property.NameEquals("title"u8)) + if (prop.NameEquals("title"u8)) { - title = property.Value.GetString(); + title = prop.Value.GetString(); continue; } - if (property.NameEquals("url"u8)) + if (prop.NameEquals("url"u8)) { - url = property.Value.GetString(); + url = prop.Value.GetString(); continue; } - if (property.NameEquals("filepath"u8)) + if (prop.NameEquals("chunk_id"u8)) { - filepath = property.Value.GetString(); + chunkId = prop.Value.GetString(); continue; } - if (property.NameEquals("chunk_id"u8)) + if (prop.NameEquals("rerank_score"u8)) { - chunkId = property.Value.GetString(); - continue; - } - if (property.NameEquals("rerank_score"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - rerankScore = property.Value.GetDouble(); + rerankScore = prop.Value.GetDouble(); + continue; + } + if (prop.NameEquals("filepath"u8)) + { + filePath = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ChatCitation( content, title, url, - filepath, chunkId, rerankScore, - serializedAdditionalRawData); + filePath, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -174,15 +179,18 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions option } } - ChatCitation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + ChatCitation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ChatCitation PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeChatCitation(document.RootElement, options); } default: @@ -192,18 +200,22 @@ ChatCitation IPersistableModel.Create(BinaryData data, ModelReader string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ChatCitation FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(ChatCitation chatCitation) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeChatCitation(document.RootElement); + if (chatCitation == null) + { + return null; + } + return BinaryContent.Create(chatCitation, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator ChatCitation(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeChatCitation(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.cs index 74cd97091..f30bd799c 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.cs @@ -7,83 +7,47 @@ namespace Azure.AI.OpenAI.Chat { - /// The AzureChatMessageContextCitation. + /// The ChatCitation. public partial class ChatCitation { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// The content of the citation. - /// is null. + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal ChatCitation(string content) { - Argument.AssertNotNull(content, nameof(content)); - Content = content; } - /// Initializes a new instance of . - /// The content of the citation. - /// The title for the citation. - /// The URL of the citation. - /// The file path for the citation. - /// The chunk ID for the citation. - /// The rerank score for the retrieval. - /// Keeps track of any properties unknown to the library. - internal ChatCitation(string content, string title, string url, string filePath, string chunkId, double? rerankScore, IDictionary serializedAdditionalRawData) + internal ChatCitation(string content, string title, string url, string chunkId, double? rerankScore, string filePath, IDictionary additionalBinaryDataProperties) { Content = content; Title = title; Url = url; - FilePath = filePath; ChunkId = chunkId; RerankScore = rerankScore; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ChatCitation() - { + FilePath = filePath; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The content of the citation. public string Content { get; } + /// The title for the citation. public string Title { get; } + /// The URL of the citation. public string Url { get; } + /// The chunk ID for the citation. public string ChunkId { get; } + /// The rerank score for the retrieval. public double? RerankScore { get; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.Serialization.cs index 944c06cd3..603be85a6 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.Serialization.cs @@ -6,12 +6,18 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { + /// [PersistableModelProxy(typeof(InternalUnknownAzureChatDataSource))] - public partial class ChatDataSource : IJsonModel + public abstract partial class ChatDataSource : IJsonModel { + internal ChatDataSource() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -23,20 +29,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ChatDataSource)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("type") != true) + if (_additionalBinaryDataProperties?.ContainsKey("type") != true) { writer.WritePropertyName("type"u8); writer.WriteStringValue(Type); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -44,7 +49,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -55,44 +60,52 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ChatDataSource JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ChatDataSource)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeChatDataSource(document.RootElement, options); } - internal static ChatDataSource DeserializeChatDataSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChatDataSource DeserializeChatDataSource(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - if (element.TryGetProperty("type", out JsonElement discriminator)) + if (element.TryGetProperty("type"u8, out JsonElement discriminator)) { switch (discriminator.GetString()) { - case "azure_cosmos_db": return CosmosChatDataSource.DeserializeCosmosChatDataSource(element, options); - case "azure_search": return AzureSearchChatDataSource.DeserializeAzureSearchChatDataSource(element, options); - case "elasticsearch": return ElasticsearchChatDataSource.DeserializeElasticsearchChatDataSource(element, options); - case "mongo_db": return MongoDBChatDataSource.DeserializeMongoDBChatDataSource(element, options); - case "pinecone": return PineconeChatDataSource.DeserializePineconeChatDataSource(element, options); + case "azure_search": + return AzureSearchChatDataSource.DeserializeAzureSearchChatDataSource(element, options); + case "azure_cosmos_db": + return CosmosChatDataSource.DeserializeCosmosChatDataSource(element, options); + case "elasticsearch": + return ElasticsearchChatDataSource.DeserializeElasticsearchChatDataSource(element, options); + case "pinecone": + return PineconeChatDataSource.DeserializePineconeChatDataSource(element, options); + case "mongo_db": + return MongoDBChatDataSource.DeserializeMongoDBChatDataSource(element, options); } } return InternalUnknownAzureChatDataSource.DeserializeInternalUnknownAzureChatDataSource(element, options); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -102,15 +115,18 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions opti } } - ChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + ChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ChatDataSource PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeChatDataSource(document.RootElement, options); } default: @@ -120,18 +136,22 @@ ChatDataSource IPersistableModel.Create(BinaryData data, ModelRe string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ChatDataSource FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(ChatDataSource chatDataSource) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeChatDataSource(document.RootElement); + if (chatDataSource == null) + { + return null; + } + return BinaryContent.Create(chatDataSource, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator ChatDataSource(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeChatDataSource(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.cs index 35988a26e..055435963 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.cs @@ -12,57 +12,29 @@ namespace Azure.AI.OpenAI.Chat /// This will be used by a chat completions request that should use Azure OpenAI chat extensions to augment the /// response behavior. /// The use of this configuration is compatible only with Azure OpenAI. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . /// public abstract partial class ChatDataSource { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - protected ChatDataSource() + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + + private protected ChatDataSource(string @type) { + Type = @type; } - /// Initializes a new instance of . - /// The differentiating type identifier for the data source. - /// Keeps track of any properties unknown to the library. - internal ChatDataSource(string type, IDictionary serializedAdditionalRawData) + internal ChatDataSource(string @type, IDictionary additionalBinaryDataProperties) { - Type = type; - SerializedAdditionalRawData = serializedAdditionalRawData; + Type = @type; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// The differentiating type identifier for the data source. internal string Type { get; set; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDocumentFilterReason.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDocumentFilterReason.cs index 705d6a45f..7702be0f4 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDocumentFilterReason.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDocumentFilterReason.cs @@ -4,45 +4,59 @@ using System; using System.ComponentModel; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// The AzureChatMessageContextAllRetrievedDocumentsFilterReason. + /// public readonly partial struct ChatDocumentFilterReason : IEquatable { private readonly string _value; + private const string ScoreValue = "score"; + private const string RerankValue = "rerank"; /// Initializes a new instance of . + /// The value. /// is null. public ChatDocumentFilterReason(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string ScoreValue = "score"; - private const string RerankValue = "rerank"; + _value = value; + } - /// score. + /// Gets the Score. public static ChatDocumentFilterReason Score { get; } = new ChatDocumentFilterReason(ScoreValue); - /// rerank. + + /// Gets the Rerank. public static ChatDocumentFilterReason Rerank { get; } = new ChatDocumentFilterReason(RerankValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(ChatDocumentFilterReason left, ChatDocumentFilterReason right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(ChatDocumentFilterReason left, ChatDocumentFilterReason right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator ChatDocumentFilterReason(string value) => new ChatDocumentFilterReason(value); - /// + /// The object to compare. [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is ChatDocumentFilterReason other && Equals(other); - /// + + /// The instance to compare. public bool Equals(ChatDocumentFilterReason other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.Serialization.cs index 8df66fa4f..2998b71fa 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.Serialization.cs @@ -7,9 +7,11 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { + /// public partial class ChatMessageContext : IJsonModel { void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -23,35 +25,34 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ChatMessageContext)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("intent") != true && Optional.IsDefined(Intent)) + if (Optional.IsDefined(Intent) && _additionalBinaryDataProperties?.ContainsKey("intent") != true) { writer.WritePropertyName("intent"u8); writer.WriteStringValue(Intent); } - if (SerializedAdditionalRawData?.ContainsKey("citations") != true && Optional.IsCollectionDefined(Citations)) + if (Optional.IsCollectionDefined(Citations) && _additionalBinaryDataProperties?.ContainsKey("citations") != true) { writer.WritePropertyName("citations"u8); writer.WriteStartArray(); - foreach (var item in Citations) + foreach (ChatCitation item in Citations) { writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } - if (SerializedAdditionalRawData?.ContainsKey("all_retrieved_documents") != true && Optional.IsDefined(RetrievedDocuments)) + if (Optional.IsDefined(RetrievedDocuments) && _additionalBinaryDataProperties?.ContainsKey("all_retrieved_documents") != true) { writer.WritePropertyName("all_retrieved_documents"u8); writer.WriteObjectValue(RetrievedDocuments, options); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -59,7 +60,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -70,75 +71,75 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ChatMessageContext IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChatMessageContext IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ChatMessageContext JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ChatMessageContext)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeChatMessageContext(document.RootElement, options); } - internal static ChatMessageContext DeserializeChatMessageContext(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChatMessageContext DeserializeChatMessageContext(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string intent = default; - IReadOnlyList citations = default; - ChatRetrievedDocument allRetrievedDocuments = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IList citations = default; + ChatRetrievedDocument retrievedDocuments = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("intent"u8)) + if (prop.NameEquals("intent"u8)) { - intent = property.Value.GetString(); + intent = prop.Value.GetString(); continue; } - if (property.NameEquals("citations"u8)) + if (prop.NameEquals("citations"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(ChatCitation.DeserializeChatCitation(item, options)); } citations = array; continue; } - if (property.NameEquals("all_retrieved_documents"u8)) + if (prop.NameEquals("all_retrieved_documents"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - allRetrievedDocuments = ChatRetrievedDocument.DeserializeChatRetrievedDocument(property.Value, options); + retrievedDocuments = ChatRetrievedDocument.DeserializeChatRetrievedDocument(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ChatMessageContext(intent, citations ?? new ChangeTrackingList(), allRetrievedDocuments, serializedAdditionalRawData); + return new ChatMessageContext(intent, citations ?? new ChangeTrackingList(), retrievedDocuments, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -148,15 +149,18 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - ChatMessageContext IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + ChatMessageContext IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ChatMessageContext PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeChatMessageContext(document.RootElement, options); } default: @@ -166,18 +170,22 @@ ChatMessageContext IPersistableModel.Create(BinaryData data, string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ChatMessageContext FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(ChatMessageContext chatMessageContext) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeChatMessageContext(document.RootElement); + if (chatMessageContext == null) + { + return null; + } + return BinaryContent.Create(chatMessageContext, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator ChatMessageContext(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeChatMessageContext(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.cs index 7a117a45c..9b9b84359 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { @@ -13,59 +14,32 @@ namespace Azure.AI.OpenAI.Chat /// public partial class ChatMessageContext { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal ChatMessageContext() { Citations = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The detected intent from the chat history, which is used to carry conversation context between interactions. - /// The citations produced by the data retrieval. - /// Summary information about documents retrieved by the data retrieval operation. - /// Keeps track of any properties unknown to the library. - internal ChatMessageContext(string intent, IReadOnlyList citations, ChatRetrievedDocument retrievedDocuments, IDictionary serializedAdditionalRawData) + internal ChatMessageContext(string intent, IList citations, ChatRetrievedDocument retrievedDocuments, IDictionary additionalBinaryDataProperties) { Intent = intent; Citations = citations; RetrievedDocuments = retrievedDocuments; - SerializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The detected intent from the chat history, which is used to carry conversation context between interactions. public string Intent { get; } + /// The citations produced by the data retrieval. - public IReadOnlyList Citations { get; } + public IList Citations { get; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.Serialization.cs index 14db8c20b..7bfb3fcee 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.Serialization.cs @@ -7,11 +7,17 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { + /// public partial class ChatRetrievedDocument : IJsonModel { + internal ChatRetrievedDocument() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -23,70 +29,74 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ChatRetrievedDocument)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("content") != true) + if (_additionalBinaryDataProperties?.ContainsKey("content") != true) { writer.WritePropertyName("content"u8); writer.WriteStringValue(Content); } - if (SerializedAdditionalRawData?.ContainsKey("title") != true && Optional.IsDefined(Title)) + if (Optional.IsDefined(Title) && _additionalBinaryDataProperties?.ContainsKey("title") != true) { writer.WritePropertyName("title"u8); writer.WriteStringValue(Title); } - if (SerializedAdditionalRawData?.ContainsKey("url") != true && Optional.IsDefined(Url)) + if (Optional.IsDefined(Url) && _additionalBinaryDataProperties?.ContainsKey("url") != true) { writer.WritePropertyName("url"u8); writer.WriteStringValue(Url); } - if (SerializedAdditionalRawData?.ContainsKey("filepath") != true && Optional.IsDefined(FilePath)) - { - writer.WritePropertyName("filepath"u8); - writer.WriteStringValue(FilePath); - } - if (SerializedAdditionalRawData?.ContainsKey("chunk_id") != true && Optional.IsDefined(ChunkId)) + if (Optional.IsDefined(ChunkId) && _additionalBinaryDataProperties?.ContainsKey("chunk_id") != true) { writer.WritePropertyName("chunk_id"u8); writer.WriteStringValue(ChunkId); } - if (SerializedAdditionalRawData?.ContainsKey("rerank_score") != true && Optional.IsDefined(RerankScore)) + if (Optional.IsDefined(RerankScore) && _additionalBinaryDataProperties?.ContainsKey("rerank_score") != true) { writer.WritePropertyName("rerank_score"u8); writer.WriteNumberValue(RerankScore.Value); } - if (SerializedAdditionalRawData?.ContainsKey("search_queries") != true) + if (_additionalBinaryDataProperties?.ContainsKey("search_queries") != true) { writer.WritePropertyName("search_queries"u8); writer.WriteStartArray(); - foreach (var item in SearchQueries) + foreach (string item in SearchQueries) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); } - if (SerializedAdditionalRawData?.ContainsKey("data_source_index") != true) + if (_additionalBinaryDataProperties?.ContainsKey("data_source_index") != true) { writer.WritePropertyName("data_source_index"u8); writer.WriteNumberValue(DataSourceIndex); } - if (SerializedAdditionalRawData?.ContainsKey("original_search_score") != true && Optional.IsDefined(OriginalSearchScore)) + if (Optional.IsDefined(OriginalSearchScore) && _additionalBinaryDataProperties?.ContainsKey("original_search_score") != true) { writer.WritePropertyName("original_search_score"u8); writer.WriteNumberValue(OriginalSearchScore.Value); } - if (SerializedAdditionalRawData?.ContainsKey("filter_reason") != true && Optional.IsDefined(FilterReason)) + if (Optional.IsDefined(FilterReason) && _additionalBinaryDataProperties?.ContainsKey("filter_reason") != true) { writer.WritePropertyName("filter_reason"u8); writer.WriteStringValue(FilterReason.Value.ToString()); } - if (SerializedAdditionalRawData != null) + if (Optional.IsDefined(FilePath) && _additionalBinaryDataProperties?.ContainsKey("filepath") != true) + { + writer.WritePropertyName("filepath"u8); + writer.WriteStringValue(FilePath); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -94,7 +104,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -105,22 +115,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ChatRetrievedDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChatRetrievedDocument IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ChatRetrievedDocument JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ChatRetrievedDocument)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeChatRetrievedDocument(document.RootElement, options); } - internal static ChatRetrievedDocument DeserializeChatRetrievedDocument(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChatRetrievedDocument DeserializeChatRetrievedDocument(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -128,109 +139,115 @@ internal static ChatRetrievedDocument DeserializeChatRetrievedDocument(JsonEleme string content = default; string title = default; string url = default; - string filepath = default; string chunkId = default; double? rerankScore = default; - IReadOnlyList searchQueries = default; + IList searchQueries = default; int dataSourceIndex = default; double? originalSearchScore = default; ChatDocumentFilterReason? filterReason = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string filePath = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("content"u8)) - { - content = property.Value.GetString(); - continue; - } - if (property.NameEquals("title"u8)) + if (prop.NameEquals("content"u8)) { - title = property.Value.GetString(); + content = prop.Value.GetString(); continue; } - if (property.NameEquals("url"u8)) + if (prop.NameEquals("title"u8)) { - url = property.Value.GetString(); + title = prop.Value.GetString(); continue; } - if (property.NameEquals("filepath"u8)) + if (prop.NameEquals("url"u8)) { - filepath = property.Value.GetString(); + url = prop.Value.GetString(); continue; } - if (property.NameEquals("chunk_id"u8)) + if (prop.NameEquals("chunk_id"u8)) { - chunkId = property.Value.GetString(); + chunkId = prop.Value.GetString(); continue; } - if (property.NameEquals("rerank_score"u8)) + if (prop.NameEquals("rerank_score"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - rerankScore = property.Value.GetDouble(); + rerankScore = prop.Value.GetDouble(); continue; } - if (property.NameEquals("search_queries"u8)) + if (prop.NameEquals("search_queries"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } searchQueries = array; continue; } - if (property.NameEquals("data_source_index"u8)) + if (prop.NameEquals("data_source_index"u8)) { - dataSourceIndex = property.Value.GetInt32(); + dataSourceIndex = prop.Value.GetInt32(); continue; } - if (property.NameEquals("original_search_score"u8)) + if (prop.NameEquals("original_search_score"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - originalSearchScore = property.Value.GetDouble(); + originalSearchScore = prop.Value.GetDouble(); continue; } - if (property.NameEquals("filter_reason"u8)) + if (prop.NameEquals("filter_reason"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - filterReason = new ChatDocumentFilterReason(property.Value.GetString()); + filterReason = new ChatDocumentFilterReason(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("filepath"u8)) + { + filePath = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ChatRetrievedDocument( content, title, url, - filepath, chunkId, rerankScore, searchQueries, dataSourceIndex, originalSearchScore, filterReason, - serializedAdditionalRawData); + filePath, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -240,15 +257,18 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio } } - ChatRetrievedDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + ChatRetrievedDocument IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ChatRetrievedDocument PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeChatRetrievedDocument(document.RootElement, options); } default: @@ -258,18 +278,22 @@ ChatRetrievedDocument IPersistableModel.Create(BinaryData string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ChatRetrievedDocument FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(ChatRetrievedDocument chatRetrievedDocument) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeChatRetrievedDocument(document.RootElement); + if (chatRetrievedDocument == null) + { + return null; + } + return BinaryContent.Create(chatRetrievedDocument, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator ChatRetrievedDocument(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeChatRetrievedDocument(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.cs index 145d0be9a..f085ea01e 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.cs @@ -8,104 +8,65 @@ namespace Azure.AI.OpenAI.Chat { - /// The AzureChatMessageContextAllRetrievedDocuments. + /// The ChatRetrievedDocument. public partial class ChatRetrievedDocument { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// The content of the citation. - /// The search queries executed to retrieve documents. - /// The index of the data source used for retrieval. - /// or is null. + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal ChatRetrievedDocument(string content, IEnumerable searchQueries, int dataSourceIndex) { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNull(searchQueries, nameof(searchQueries)); - Content = content; SearchQueries = searchQueries.ToList(); DataSourceIndex = dataSourceIndex; } - /// Initializes a new instance of . - /// The content of the citation. - /// The title for the citation. - /// The URL of the citation. - /// The file path for the citation. - /// The chunk ID for the citation. - /// The rerank score for the retrieval. - /// The search queries executed to retrieve documents. - /// The index of the data source used for retrieval. - /// The original search score for the retrieval. - /// If applicable, an indication of why the document was filtered. - /// Keeps track of any properties unknown to the library. - internal ChatRetrievedDocument(string content, string title, string url, string filePath, string chunkId, double? rerankScore, IReadOnlyList searchQueries, int dataSourceIndex, double? originalSearchScore, ChatDocumentFilterReason? filterReason, IDictionary serializedAdditionalRawData) + internal ChatRetrievedDocument(string content, string title, string url, string chunkId, double? rerankScore, IList searchQueries, int dataSourceIndex, double? originalSearchScore, ChatDocumentFilterReason? filterReason, string filePath, IDictionary additionalBinaryDataProperties) { Content = content; Title = title; Url = url; - FilePath = filePath; ChunkId = chunkId; RerankScore = rerankScore; SearchQueries = searchQueries; DataSourceIndex = dataSourceIndex; OriginalSearchScore = originalSearchScore; FilterReason = filterReason; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ChatRetrievedDocument() - { + FilePath = filePath; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The content of the citation. public string Content { get; } + /// The title for the citation. public string Title { get; } + /// The URL of the citation. public string Url { get; } + /// The chunk ID for the citation. public string ChunkId { get; } + /// The rerank score for the retrieval. public double? RerankScore { get; } + /// The search queries executed to retrieve documents. - public IReadOnlyList SearchQueries { get; } + public IList SearchQueries { get; } + /// The index of the data source used for retrieval. public int DataSourceIndex { get; } + /// The original search score for the retrieval. public double? OriginalSearchScore { get; } + /// If applicable, an indication of why the document was filtered. public ChatDocumentFilterReason? FilterReason { get; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs index fd200aad3..8f858a40c 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs @@ -10,8 +10,13 @@ namespace Azure.AI.OpenAI { + /// public partial class ContentFilterBlocklistResult : IJsonModel { + internal ContentFilterBlocklistResult() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -23,30 +28,29 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContentFilterBlocklistResult)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) + if (_additionalBinaryDataProperties?.ContainsKey("filtered") != true) { writer.WritePropertyName("filtered"u8); writer.WriteBooleanValue(Filtered); } - if (SerializedAdditionalRawData?.ContainsKey("details") != true && Optional.IsCollectionDefined(InternalDetails)) + if (Optional.IsCollectionDefined(InternalDetails) && _additionalBinaryDataProperties?.ContainsKey("details") != true) { writer.WritePropertyName("details"u8); writer.WriteStartArray(); - foreach (var item in InternalDetails) + foreach (InternalAzureContentFilterBlocklistResultDetail item in InternalDetails) { - writer.WriteObjectValue(item, options); + writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -54,7 +58,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -65,65 +69,65 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContentFilterBlocklistResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ContentFilterBlocklistResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContentFilterBlocklistResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContentFilterBlocklistResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContentFilterBlocklistResult(document.RootElement, options); } - internal static ContentFilterBlocklistResult DeserializeContentFilterBlocklistResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static ContentFilterBlocklistResult DeserializeContentFilterBlocklistResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } bool filtered = default; - IReadOnlyList details = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IReadOnlyList internalDetails = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("filtered"u8)) + if (prop.NameEquals("filtered"u8)) { - filtered = property.Value.GetBoolean(); + filtered = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("details"u8)) + if (prop.NameEquals("details"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(InternalAzureContentFilterBlocklistResultDetail.DeserializeInternalAzureContentFilterBlocklistResultDetail(item, options)); } - details = array; + internalDetails = array; continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContentFilterBlocklistResult(filtered, details ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new ContentFilterBlocklistResult(filtered, internalDetails ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -133,15 +137,18 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - ContentFilterBlocklistResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + ContentFilterBlocklistResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContentFilterBlocklistResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeContentFilterBlocklistResult(document.RootElement, options); } default: @@ -151,18 +158,22 @@ ContentFilterBlocklistResult IPersistableModel.Cre string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ContentFilterBlocklistResult FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(ContentFilterBlocklistResult contentFilterBlocklistResult) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeContentFilterBlocklistResult(document.RootElement); + if (contentFilterBlocklistResult == null) + { + return null; + } + return BinaryContent.Create(contentFilterBlocklistResult, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator ContentFilterBlocklistResult(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeContentFilterBlocklistResult(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs index d033e0e34..4a8a0e0b6 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs @@ -10,62 +10,29 @@ namespace Azure.AI.OpenAI /// A collection of true/false filtering results for configured custom blocklists. public partial class ContentFilterBlocklistResult { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// A value indicating whether any of the detailed blocklists resulted in a filtering action. + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal ContentFilterBlocklistResult(bool filtered) { Filtered = filtered; InternalDetails = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// A value indicating whether any of the detailed blocklists resulted in a filtering action. - /// The pairs of individual blocklist IDs and whether they resulted in a filtering action. - /// Keeps track of any properties unknown to the library. - internal ContentFilterBlocklistResult(bool filtered, IReadOnlyList internalDetails, IDictionary serializedAdditionalRawData) + internal ContentFilterBlocklistResult(bool filtered, IReadOnlyList internalDetails, IDictionary additionalBinaryDataProperties) { Filtered = filtered; InternalDetails = internalDetails; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContentFilterBlocklistResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// A value indicating whether any of the detailed blocklists resulted in a filtering action. public bool Filtered { get; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs index 637de281c..81ac3f45f 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs @@ -10,8 +10,13 @@ namespace Azure.AI.OpenAI { + /// public partial class ContentFilterDetectionResult : IJsonModel { + internal ContentFilterDetectionResult() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -23,25 +28,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContentFilterDetectionResult)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) + if (_additionalBinaryDataProperties?.ContainsKey("filtered") != true) { writer.WritePropertyName("filtered"u8); writer.WriteBooleanValue(Filtered); } - if (SerializedAdditionalRawData?.ContainsKey("detected") != true) + if (_additionalBinaryDataProperties?.ContainsKey("detected") != true) { writer.WritePropertyName("detected"u8); writer.WriteBooleanValue(Detected); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -49,7 +53,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -60,56 +64,56 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContentFilterDetectionResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ContentFilterDetectionResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContentFilterDetectionResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContentFilterDetectionResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContentFilterDetectionResult(document.RootElement, options); } - internal static ContentFilterDetectionResult DeserializeContentFilterDetectionResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static ContentFilterDetectionResult DeserializeContentFilterDetectionResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } bool filtered = default; bool detected = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("filtered"u8)) + if (prop.NameEquals("filtered"u8)) { - filtered = property.Value.GetBoolean(); + filtered = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("detected"u8)) + if (prop.NameEquals("detected"u8)) { - detected = property.Value.GetBoolean(); + detected = prop.Value.GetBoolean(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContentFilterDetectionResult(filtered, detected, serializedAdditionalRawData); + return new ContentFilterDetectionResult(filtered, detected, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +123,18 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - ContentFilterDetectionResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + ContentFilterDetectionResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContentFilterDetectionResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeContentFilterDetectionResult(document.RootElement, options); } default: @@ -137,18 +144,22 @@ ContentFilterDetectionResult IPersistableModel.Cre string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ContentFilterDetectionResult FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(ContentFilterDetectionResult contentFilterDetectionResult) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeContentFilterDetectionResult(document.RootElement); + if (contentFilterDetectionResult == null) + { + return null; + } + return BinaryContent.Create(contentFilterDetectionResult, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator ContentFilterDetectionResult(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeContentFilterDetectionResult(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs index 34aab2400..4e1aff0ed 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs @@ -13,65 +13,32 @@ namespace Azure.AI.OpenAI /// public partial class ContentFilterDetectionResult { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// Whether the content detection resulted in a content filtering action. - /// Whether the labeled content category was detected in the content. + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal ContentFilterDetectionResult(bool filtered, bool detected) { Filtered = filtered; Detected = detected; } - /// Initializes a new instance of . - /// Whether the content detection resulted in a content filtering action. - /// Whether the labeled content category was detected in the content. - /// Keeps track of any properties unknown to the library. - internal ContentFilterDetectionResult(bool filtered, bool detected, IDictionary serializedAdditionalRawData) + internal ContentFilterDetectionResult(bool filtered, bool detected, IDictionary additionalBinaryDataProperties) { Filtered = filtered; Detected = detected; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContentFilterDetectionResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Whether the content detection resulted in a content filtering action. public bool Filtered { get; } + /// Whether the labeled content category was detected in the content. public bool Detected { get; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.Serialization.cs index 57c0e41d7..b9c36fc45 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.Serialization.cs @@ -10,6 +10,7 @@ namespace Azure.AI.OpenAI { + /// public partial class ContentFilterProtectedMaterialCitationResult : IJsonModel { void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -23,25 +24,24 @@ void IJsonModel.Write(Utf8JsonWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContentFilterProtectedMaterialCitationResult)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("license") != true && Optional.IsDefined(License)) + if (Optional.IsDefined(License) && _additionalBinaryDataProperties?.ContainsKey("license") != true) { writer.WritePropertyName("license"u8); writer.WriteStringValue(License); } - if (SerializedAdditionalRawData?.ContainsKey("URL") != true && Optional.IsDefined(Uri)) + if (Optional.IsDefined(Uri) && _additionalBinaryDataProperties?.ContainsKey("URL") != true) { writer.WritePropertyName("URL"u8); writer.WriteStringValue(Uri.AbsoluteUri); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -49,7 +49,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -60,60 +60,60 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContentFilterProtectedMaterialCitationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ContentFilterProtectedMaterialCitationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContentFilterProtectedMaterialCitationResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContentFilterProtectedMaterialCitationResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContentFilterProtectedMaterialCitationResult(document.RootElement, options); } - internal static ContentFilterProtectedMaterialCitationResult DeserializeContentFilterProtectedMaterialCitationResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static ContentFilterProtectedMaterialCitationResult DeserializeContentFilterProtectedMaterialCitationResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string license = default; - Uri url = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + Uri uri = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("license"u8)) + if (prop.NameEquals("license"u8)) { - license = property.Value.GetString(); + license = prop.Value.GetString(); continue; } - if (property.NameEquals("URL"u8)) + if (prop.NameEquals("URL"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - url = new Uri(property.Value.GetString()); + uri = new Uri(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContentFilterProtectedMaterialCitationResult(license, url, serializedAdditionalRawData); + return new ContentFilterProtectedMaterialCitationResult(license, uri, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -123,15 +123,18 @@ BinaryData IPersistableModel.Write } } - ContentFilterProtectedMaterialCitationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + ContentFilterProtectedMaterialCitationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContentFilterProtectedMaterialCitationResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeContentFilterProtectedMaterialCitationResult(document.RootElement, options); } default: @@ -141,18 +144,22 @@ ContentFilterProtectedMaterialCitationResult IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ContentFilterProtectedMaterialCitationResult FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(ContentFilterProtectedMaterialCitationResult contentFilterProtectedMaterialCitationResult) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeContentFilterProtectedMaterialCitationResult(document.RootElement); + if (contentFilterProtectedMaterialCitationResult == null) + { + return null; + } + return BinaryContent.Create(contentFilterProtectedMaterialCitationResult, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator ContentFilterProtectedMaterialCitationResult(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeContentFilterProtectedMaterialCitationResult(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.cs index 155740c21..4cf6e5c5b 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.cs @@ -7,57 +7,30 @@ namespace Azure.AI.OpenAI { - /// The AzureContentFilterResultForChoiceProtectedMaterialCodeCitation. + /// The ContentFilterProtectedMaterialCitationResult. public partial class ContentFilterProtectedMaterialCitationResult { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal ContentFilterProtectedMaterialCitationResult() { } - /// Initializes a new instance of . - /// The name or identifier of the license associated with the detection. - /// The URL associated with the license. - /// Keeps track of any properties unknown to the library. - internal ContentFilterProtectedMaterialCitationResult(string license, Uri uri, IDictionary serializedAdditionalRawData) + internal ContentFilterProtectedMaterialCitationResult(string license, Uri uri, IDictionary additionalBinaryDataProperties) { License = license; Uri = uri; - SerializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The name or identifier of the license associated with the detection. public string License { get; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs index 78e4b5f54..77ccd8be7 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs @@ -10,8 +10,13 @@ namespace Azure.AI.OpenAI { + /// public partial class ContentFilterProtectedMaterialResult : IJsonModel { + internal ContentFilterProtectedMaterialResult() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -23,30 +28,29 @@ void IJsonModel.Write(Utf8JsonWriter write /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContentFilterProtectedMaterialResult)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) + if (_additionalBinaryDataProperties?.ContainsKey("filtered") != true) { writer.WritePropertyName("filtered"u8); writer.WriteBooleanValue(Filtered); } - if (SerializedAdditionalRawData?.ContainsKey("detected") != true) + if (_additionalBinaryDataProperties?.ContainsKey("detected") != true) { writer.WritePropertyName("detected"u8); writer.WriteBooleanValue(Detected); } - if (SerializedAdditionalRawData?.ContainsKey("citation") != true && Optional.IsDefined(Citation)) + if (Optional.IsDefined(Citation) && _additionalBinaryDataProperties?.ContainsKey("citation") != true) { writer.WritePropertyName("citation"u8); writer.WriteObjectValue(Citation, options); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -54,7 +58,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -65,22 +69,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContentFilterProtectedMaterialResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ContentFilterProtectedMaterialResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContentFilterProtectedMaterialResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContentFilterProtectedMaterialResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContentFilterProtectedMaterialResult(document.RootElement, options); } - internal static ContentFilterProtectedMaterialResult DeserializeContentFilterProtectedMaterialResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static ContentFilterProtectedMaterialResult DeserializeContentFilterProtectedMaterialResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -88,43 +93,42 @@ internal static ContentFilterProtectedMaterialResult DeserializeContentFilterPro bool filtered = default; bool detected = default; ContentFilterProtectedMaterialCitationResult citation = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("filtered"u8)) + if (prop.NameEquals("filtered"u8)) { - filtered = property.Value.GetBoolean(); + filtered = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("detected"u8)) + if (prop.NameEquals("detected"u8)) { - detected = property.Value.GetBoolean(); + detected = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("citation"u8)) + if (prop.NameEquals("citation"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - citation = ContentFilterProtectedMaterialCitationResult.DeserializeContentFilterProtectedMaterialCitationResult(property.Value, options); + citation = ContentFilterProtectedMaterialCitationResult.DeserializeContentFilterProtectedMaterialCitationResult(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContentFilterProtectedMaterialResult(filtered, detected, citation, serializedAdditionalRawData); + return new ContentFilterProtectedMaterialResult(filtered, detected, citation, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -134,15 +138,18 @@ BinaryData IPersistableModel.Write(ModelRe } } - ContentFilterProtectedMaterialResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + ContentFilterProtectedMaterialResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContentFilterProtectedMaterialResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeContentFilterProtectedMaterialResult(document.RootElement, options); } default: @@ -152,18 +159,22 @@ ContentFilterProtectedMaterialResult IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ContentFilterProtectedMaterialResult FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(ContentFilterProtectedMaterialResult contentFilterProtectedMaterialResult) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeContentFilterProtectedMaterialResult(document.RootElement); + if (contentFilterProtectedMaterialResult == null) + { + return null; + } + return BinaryContent.Create(contentFilterProtectedMaterialResult, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator ContentFilterProtectedMaterialResult(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeContentFilterProtectedMaterialResult(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs index 533e4b11b..d3ac9291c 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs @@ -7,72 +7,39 @@ namespace Azure.AI.OpenAI { - /// The AzureContentFilterResultForChoiceProtectedMaterialCode. + /// The ContentFilterProtectedMaterialResult. public partial class ContentFilterProtectedMaterialResult { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// Whether the content detection resulted in a content filtering action. - /// Whether the labeled content category was detected in the content. + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal ContentFilterProtectedMaterialResult(bool filtered, bool detected) { Filtered = filtered; Detected = detected; } - /// Initializes a new instance of . - /// Whether the content detection resulted in a content filtering action. - /// Whether the labeled content category was detected in the content. - /// If available, the citation details describing the associated license and its location. - /// Keeps track of any properties unknown to the library. - internal ContentFilterProtectedMaterialResult(bool filtered, bool detected, ContentFilterProtectedMaterialCitationResult citation, IDictionary serializedAdditionalRawData) + internal ContentFilterProtectedMaterialResult(bool filtered, bool detected, ContentFilterProtectedMaterialCitationResult citation, IDictionary additionalBinaryDataProperties) { Filtered = filtered; Detected = detected; Citation = citation; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContentFilterProtectedMaterialResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Whether the content detection resulted in a content filtering action. public bool Filtered { get; } + /// Whether the labeled content category was detected in the content. public bool Detected { get; } + /// If available, the citation details describing the associated license and its location. public ContentFilterProtectedMaterialCitationResult Citation { get; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs index cbca38b68..634101bae 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs @@ -7,48 +7,63 @@ namespace Azure.AI.OpenAI { - /// The AzureContentFilterSeverityResultSeverity. + /// public readonly partial struct ContentFilterSeverity : IEquatable { private readonly string _value; + private const string SafeValue = "safe"; + private const string LowValue = "low"; + private const string MediumValue = "medium"; + private const string HighValue = "high"; /// Initializes a new instance of . + /// The value. /// is null. public ContentFilterSeverity(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string SafeValue = "safe"; - private const string LowValue = "low"; - private const string MediumValue = "medium"; - private const string HighValue = "high"; + _value = value; + } - /// safe. + /// Gets the Safe. public static ContentFilterSeverity Safe { get; } = new ContentFilterSeverity(SafeValue); - /// low. + + /// Gets the Low. public static ContentFilterSeverity Low { get; } = new ContentFilterSeverity(LowValue); - /// medium. + + /// Gets the Medium. public static ContentFilterSeverity Medium { get; } = new ContentFilterSeverity(MediumValue); - /// high. + + /// Gets the High. public static ContentFilterSeverity High { get; } = new ContentFilterSeverity(HighValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(ContentFilterSeverity left, ContentFilterSeverity right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(ContentFilterSeverity left, ContentFilterSeverity right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator ContentFilterSeverity(string value) => new ContentFilterSeverity(value); - /// + /// The object to compare. [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is ContentFilterSeverity other && Equals(other); - /// + + /// The instance to compare. public bool Equals(ContentFilterSeverity other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs index 92c48c5d2..39ccf9c5a 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs @@ -10,8 +10,13 @@ namespace Azure.AI.OpenAI { + /// public partial class ContentFilterSeverityResult : IJsonModel { + internal ContentFilterSeverityResult() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -23,25 +28,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContentFilterSeverityResult)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) + if (_additionalBinaryDataProperties?.ContainsKey("filtered") != true) { writer.WritePropertyName("filtered"u8); writer.WriteBooleanValue(Filtered); } - if (SerializedAdditionalRawData?.ContainsKey("severity") != true) + if (_additionalBinaryDataProperties?.ContainsKey("severity") != true) { writer.WritePropertyName("severity"u8); writer.WriteStringValue(Severity.ToString()); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -49,7 +53,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -60,56 +64,56 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContentFilterSeverityResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ContentFilterSeverityResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContentFilterSeverityResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContentFilterSeverityResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContentFilterSeverityResult(document.RootElement, options); } - internal static ContentFilterSeverityResult DeserializeContentFilterSeverityResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static ContentFilterSeverityResult DeserializeContentFilterSeverityResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } bool filtered = default; ContentFilterSeverity severity = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("filtered"u8)) + if (prop.NameEquals("filtered"u8)) { - filtered = property.Value.GetBoolean(); + filtered = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("severity"u8)) + if (prop.NameEquals("severity"u8)) { - severity = new ContentFilterSeverity(property.Value.GetString()); + severity = new ContentFilterSeverity(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContentFilterSeverityResult(filtered, severity, serializedAdditionalRawData); + return new ContentFilterSeverityResult(filtered, severity, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +123,18 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - ContentFilterSeverityResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + ContentFilterSeverityResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContentFilterSeverityResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeContentFilterSeverityResult(document.RootElement, options); } default: @@ -137,18 +144,22 @@ ContentFilterSeverityResult IPersistableModel.Creat string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ContentFilterSeverityResult FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(ContentFilterSeverityResult contentFilterSeverityResult) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeContentFilterSeverityResult(document.RootElement); + if (contentFilterSeverityResult == null) + { + return null; + } + return BinaryContent.Create(contentFilterSeverityResult, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator ContentFilterSeverityResult(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeContentFilterSeverityResult(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs index 95f0fa1bc..934f8b086 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs @@ -13,63 +13,29 @@ namespace Azure.AI.OpenAI /// public partial class ContentFilterSeverityResult { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// Whether the content severity resulted in a content filtering action. - /// The labeled severity of the content. + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal ContentFilterSeverityResult(bool filtered, ContentFilterSeverity severity) { Filtered = filtered; Severity = severity; } - /// Initializes a new instance of . - /// Whether the content severity resulted in a content filtering action. - /// The labeled severity of the content. - /// Keeps track of any properties unknown to the library. - internal ContentFilterSeverityResult(bool filtered, ContentFilterSeverity severity, IDictionary serializedAdditionalRawData) + internal ContentFilterSeverityResult(bool filtered, ContentFilterSeverity severity, IDictionary additionalBinaryDataProperties) { Filtered = filtered; Severity = severity; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContentFilterSeverityResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Whether the content severity resulted in a content filtering action. public bool Filtered { get; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.Serialization.cs index effcd8aea..4d8345ec0 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.Serialization.cs @@ -10,8 +10,13 @@ namespace Azure.AI.OpenAI { + /// public partial class ContentFilterTextSpan : IJsonModel { + internal ContentFilterTextSpan() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -23,25 +28,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContentFilterTextSpan)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("completion_start_offset") != true) + if (_additionalBinaryDataProperties?.ContainsKey("completion_start_offset") != true) { writer.WritePropertyName("completion_start_offset"u8); writer.WriteNumberValue(CompletionStartOffset); } - if (SerializedAdditionalRawData?.ContainsKey("completion_end_offset") != true) + if (_additionalBinaryDataProperties?.ContainsKey("completion_end_offset") != true) { writer.WritePropertyName("completion_end_offset"u8); writer.WriteNumberValue(CompletionEndOffset); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -49,7 +53,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -60,56 +64,56 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContentFilterTextSpan IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ContentFilterTextSpan IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContentFilterTextSpan JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContentFilterTextSpan)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContentFilterTextSpan(document.RootElement, options); } - internal static ContentFilterTextSpan DeserializeContentFilterTextSpan(JsonElement element, ModelReaderWriterOptions options = null) + internal static ContentFilterTextSpan DeserializeContentFilterTextSpan(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } int completionStartOffset = default; int completionEndOffset = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("completion_start_offset"u8)) + if (prop.NameEquals("completion_start_offset"u8)) { - completionStartOffset = property.Value.GetInt32(); + completionStartOffset = prop.Value.GetInt32(); continue; } - if (property.NameEquals("completion_end_offset"u8)) + if (prop.NameEquals("completion_end_offset"u8)) { - completionEndOffset = property.Value.GetInt32(); + completionEndOffset = prop.Value.GetInt32(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContentFilterTextSpan(completionStartOffset, completionEndOffset, serializedAdditionalRawData); + return new ContentFilterTextSpan(completionStartOffset, completionEndOffset, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +123,18 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio } } - ContentFilterTextSpan IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + ContentFilterTextSpan IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContentFilterTextSpan PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeContentFilterTextSpan(document.RootElement, options); } default: @@ -137,18 +144,22 @@ ContentFilterTextSpan IPersistableModel.Create(BinaryData string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ContentFilterTextSpan FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(ContentFilterTextSpan contentFilterTextSpan) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeContentFilterTextSpan(document.RootElement); + if (contentFilterTextSpan == null) + { + return null; + } + return BinaryContent.Create(contentFilterTextSpan, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator ContentFilterTextSpan(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeContentFilterTextSpan(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.cs index 2b04de8d0..b4579e6c0 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.cs @@ -10,65 +10,32 @@ namespace Azure.AI.OpenAI /// A representation of a span of completion text as used by Azure OpenAI content filter results. public partial class ContentFilterTextSpan { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// Offset of the UTF32 code point which begins the span. - /// Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans. + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal ContentFilterTextSpan(int completionStartOffset, int completionEndOffset) { CompletionStartOffset = completionStartOffset; CompletionEndOffset = completionEndOffset; } - /// Initializes a new instance of . - /// Offset of the UTF32 code point which begins the span. - /// Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans. - /// Keeps track of any properties unknown to the library. - internal ContentFilterTextSpan(int completionStartOffset, int completionEndOffset, IDictionary serializedAdditionalRawData) + internal ContentFilterTextSpan(int completionStartOffset, int completionEndOffset, IDictionary additionalBinaryDataProperties) { CompletionStartOffset = completionStartOffset; CompletionEndOffset = completionEndOffset; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContentFilterTextSpan() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Offset of the UTF32 code point which begins the span. public int CompletionStartOffset { get; } + /// Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans. public int CompletionEndOffset { get; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.Serialization.cs index 598694d7d..bdf88d163 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.Serialization.cs @@ -10,8 +10,13 @@ namespace Azure.AI.OpenAI { + /// public partial class ContentFilterTextSpanResult : IJsonModel { + internal ContentFilterTextSpanResult() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -23,35 +28,34 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContentFilterTextSpanResult)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) + if (_additionalBinaryDataProperties?.ContainsKey("filtered") != true) { writer.WritePropertyName("filtered"u8); writer.WriteBooleanValue(Filtered); } - if (SerializedAdditionalRawData?.ContainsKey("detected") != true) + if (_additionalBinaryDataProperties?.ContainsKey("detected") != true) { writer.WritePropertyName("detected"u8); writer.WriteBooleanValue(Detected); } - if (SerializedAdditionalRawData?.ContainsKey("details") != true) + if (_additionalBinaryDataProperties?.ContainsKey("details") != true) { writer.WritePropertyName("details"u8); writer.WriteStartArray(); - foreach (var item in Details) + foreach (ContentFilterTextSpan item in Details) { writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -59,7 +63,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -70,47 +74,47 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ContentFilterTextSpanResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ContentFilterTextSpanResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ContentFilterTextSpanResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ContentFilterTextSpanResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeContentFilterTextSpanResult(document.RootElement, options); } - internal static ContentFilterTextSpanResult DeserializeContentFilterTextSpanResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static ContentFilterTextSpanResult DeserializeContentFilterTextSpanResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } bool filtered = default; bool detected = default; - IReadOnlyList details = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IList details = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("filtered"u8)) + if (prop.NameEquals("filtered"u8)) { - filtered = property.Value.GetBoolean(); + filtered = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("detected"u8)) + if (prop.NameEquals("detected"u8)) { - detected = property.Value.GetBoolean(); + detected = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("details"u8)) + if (prop.NameEquals("details"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(ContentFilterTextSpan.DeserializeContentFilterTextSpan(item, options)); } @@ -119,18 +123,18 @@ internal static ContentFilterTextSpanResult DeserializeContentFilterTextSpanResu } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ContentFilterTextSpanResult(filtered, detected, details, serializedAdditionalRawData); + return new ContentFilterTextSpanResult(filtered, detected, details, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -140,15 +144,18 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - ContentFilterTextSpanResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + ContentFilterTextSpanResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ContentFilterTextSpanResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeContentFilterTextSpanResult(document.RootElement, options); } default: @@ -158,18 +165,22 @@ ContentFilterTextSpanResult IPersistableModel.Creat string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ContentFilterTextSpanResult FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(ContentFilterTextSpanResult contentFilterTextSpanResult) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeContentFilterTextSpanResult(document.RootElement); + if (contentFilterTextSpanResult == null) + { + return null; + } + return BinaryContent.Create(contentFilterTextSpanResult, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator ContentFilterTextSpanResult(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeContentFilterTextSpanResult(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.cs index 9f7a3dba1..a1c7e1c0b 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.cs @@ -8,77 +8,40 @@ namespace Azure.AI.OpenAI { - /// The AzureContentFilterCompletionTextSpanDetectionResult. + /// The ContentFilterTextSpanResult. public partial class ContentFilterTextSpanResult { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// Whether the content detection resulted in a content filtering action. - /// Whether the labeled content category was detected in the content. - /// Detailed information about the detected completion text spans. - /// is null. + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal ContentFilterTextSpanResult(bool filtered, bool detected, IEnumerable details) { - Argument.AssertNotNull(details, nameof(details)); - Filtered = filtered; Detected = detected; Details = details.ToList(); } - /// Initializes a new instance of . - /// Whether the content detection resulted in a content filtering action. - /// Whether the labeled content category was detected in the content. - /// Detailed information about the detected completion text spans. - /// Keeps track of any properties unknown to the library. - internal ContentFilterTextSpanResult(bool filtered, bool detected, IReadOnlyList details, IDictionary serializedAdditionalRawData) + internal ContentFilterTextSpanResult(bool filtered, bool detected, IList details, IDictionary additionalBinaryDataProperties) { Filtered = filtered; Detected = detected; Details = details; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ContentFilterTextSpanResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Whether the content detection resulted in a content filtering action. public bool Filtered { get; } + /// Whether the labeled content category was detected in the content. public bool Detected { get; } + /// Detailed information about the detected completion text spans. - public IReadOnlyList Details { get; } + public IList Details { get; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.Serialization.cs index e492d76ae..62a069964 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.Serialization.cs @@ -7,9 +7,11 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { + /// public partial class CosmosChatDataSource : IJsonModel { void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -23,70 +25,69 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CosmosChatDataSource)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) + if (_additionalBinaryDataProperties?.ContainsKey("parameters") != true) { writer.WritePropertyName("parameters"u8); writer.WriteObjectValue(InternalParameters, options); } } - CosmosChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + CosmosChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (CosmosChatDataSource)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ChatDataSource JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CosmosChatDataSource)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCosmosChatDataSource(document.RootElement, options); } - internal static CosmosChatDataSource DeserializeCosmosChatDataSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static CosmosChatDataSource DeserializeCosmosChatDataSource(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - InternalAzureCosmosDBChatDataSourceParameters parameters = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string @type = "azure_cosmos_db"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + InternalAzureCosmosDBChatDataSourceParameters internalParameters = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("parameters"u8)) + if (prop.NameEquals("type"u8)) { - parameters = InternalAzureCosmosDBChatDataSourceParameters.DeserializeInternalAzureCosmosDBChatDataSourceParameters(property.Value, options); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("parameters"u8)) { - type = property.Value.GetString(); + internalParameters = InternalAzureCosmosDBChatDataSourceParameters.DeserializeInternalAzureCosmosDBChatDataSourceParameters(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosChatDataSource(type, serializedAdditionalRawData, parameters); + return new CosmosChatDataSource(@type, additionalBinaryDataProperties, internalParameters); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -96,15 +97,18 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - CosmosChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + CosmosChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (CosmosChatDataSource)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ChatDataSource PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeCosmosChatDataSource(document.RootElement, options); } default: @@ -114,18 +118,22 @@ CosmosChatDataSource IPersistableModel.Create(BinaryData d string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new CosmosChatDataSource FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(CosmosChatDataSource cosmosChatDataSource) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeCosmosChatDataSource(document.RootElement); + if (cosmosChatDataSource == null) + { + return null; + } + return BinaryContent.Create(cosmosChatDataSource, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator CosmosChatDataSource(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeCosmosChatDataSource(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.cs index 779961ba9..58f84cf9e 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.cs @@ -2,9 +2,6 @@ #nullable disable -using System; -using System.Collections.Generic; - namespace Azure.AI.OpenAI.Chat { /// Represents a data source configuration that will use an Azure CosmosDB resource. diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs index d823d3ed9..08a200a07 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs @@ -6,12 +6,18 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { + /// [PersistableModelProxy(typeof(InternalUnknownAzureChatDataSourceAuthenticationOptions))] - public partial class DataSourceAuthentication : IJsonModel + public abstract partial class DataSourceAuthentication : IJsonModel { + internal DataSourceAuthentication() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -23,20 +29,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DataSourceAuthentication)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("type") != true) + if (_additionalBinaryDataProperties?.ContainsKey("type") != true) { writer.WritePropertyName("type"u8); writer.WriteStringValue(Type); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -44,7 +49,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -55,47 +60,58 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DataSourceAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DataSourceAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DataSourceAuthentication JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DataSourceAuthentication)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDataSourceAuthentication(document.RootElement, options); } - internal static DataSourceAuthentication DeserializeDataSourceAuthentication(JsonElement element, ModelReaderWriterOptions options = null) + internal static DataSourceAuthentication DeserializeDataSourceAuthentication(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - if (element.TryGetProperty("type", out JsonElement discriminator)) + if (element.TryGetProperty("type"u8, out JsonElement discriminator)) { switch (discriminator.GetString()) { - case "access_token": return InternalAzureChatDataSourceAccessTokenAuthenticationOptions.DeserializeInternalAzureChatDataSourceAccessTokenAuthenticationOptions(element, options); - case "api_key": return InternalAzureChatDataSourceApiKeyAuthenticationOptions.DeserializeInternalAzureChatDataSourceApiKeyAuthenticationOptions(element, options); - case "connection_string": return InternalAzureChatDataSourceConnectionStringAuthenticationOptions.DeserializeInternalAzureChatDataSourceConnectionStringAuthenticationOptions(element, options); - case "encoded_api_key": return InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.DeserializeInternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(element, options); - case "key_and_key_id": return InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.DeserializeInternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(element, options); - case "system_assigned_managed_identity": return InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.DeserializeInternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(element, options); - case "user_assigned_managed_identity": return InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.DeserializeInternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(element, options); - case "username_and_password": return InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.DeserializeInternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(element, options); + case "api_key": + return InternalAzureChatDataSourceApiKeyAuthenticationOptions.DeserializeInternalAzureChatDataSourceApiKeyAuthenticationOptions(element, options); + case "connection_string": + return InternalAzureChatDataSourceConnectionStringAuthenticationOptions.DeserializeInternalAzureChatDataSourceConnectionStringAuthenticationOptions(element, options); + case "system_assigned_managed_identity": + return InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.DeserializeInternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(element, options); + case "user_assigned_managed_identity": + return InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.DeserializeInternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(element, options); + case "key_and_key_id": + return InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.DeserializeInternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(element, options); + case "encoded_api_key": + return InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.DeserializeInternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(element, options); + case "access_token": + return InternalAzureChatDataSourceAccessTokenAuthenticationOptions.DeserializeInternalAzureChatDataSourceAccessTokenAuthenticationOptions(element, options); + case "username_and_password": + return InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.DeserializeInternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(element, options); } } return InternalUnknownAzureChatDataSourceAuthenticationOptions.DeserializeInternalUnknownAzureChatDataSourceAuthenticationOptions(element, options); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -105,15 +121,18 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp } } - DataSourceAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + DataSourceAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DataSourceAuthentication PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeDataSourceAuthentication(document.RootElement, options); } default: @@ -123,18 +142,22 @@ DataSourceAuthentication IPersistableModel.Create(Bina string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static DataSourceAuthentication FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(DataSourceAuthentication dataSourceAuthentication) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDataSourceAuthentication(document.RootElement); + if (dataSourceAuthentication == null) + { + return null; + } + return BinaryContent.Create(dataSourceAuthentication, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator DataSourceAuthentication(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeDataSourceAuthentication(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs index 6ef59cc56..b4166f59f 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs @@ -7,58 +7,29 @@ namespace Azure.AI.OpenAI.Chat { - /// - /// The AzureChatDataSourceAuthenticationOptions. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// + /// The DataSourceAuthentication. public abstract partial class DataSourceAuthentication { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - protected DataSourceAuthentication() + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + + private protected DataSourceAuthentication(string @type) { + Type = @type; } - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal DataSourceAuthentication(string type, IDictionary serializedAdditionalRawData) + internal DataSourceAuthentication(string @type, IDictionary additionalBinaryDataProperties) { - Type = type; - SerializedAdditionalRawData = serializedAdditionalRawData; + Type = @type; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets or sets the type. internal string Type { get; set; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs index 710c70afe..74cd1284b 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs @@ -7,9 +7,11 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { + /// public partial class DataSourceFieldMappings : IJsonModel { void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -23,65 +25,79 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DataSourceFieldMappings)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("title_field") != true && Optional.IsDefined(TitleFieldName)) + if (Optional.IsDefined(TitleFieldName) && _additionalBinaryDataProperties?.ContainsKey("title_field") != true) { writer.WritePropertyName("title_field"u8); writer.WriteStringValue(TitleFieldName); } - if (SerializedAdditionalRawData?.ContainsKey("url_field") != true && Optional.IsDefined(UrlFieldName)) + if (Optional.IsDefined(UrlFieldName) && _additionalBinaryDataProperties?.ContainsKey("url_field") != true) { writer.WritePropertyName("url_field"u8); writer.WriteStringValue(UrlFieldName); } - if (SerializedAdditionalRawData?.ContainsKey("filepath_field") != true && Optional.IsDefined(FilePathFieldName)) + if (Optional.IsDefined(FilePathFieldName) && _additionalBinaryDataProperties?.ContainsKey("filepath_field") != true) { writer.WritePropertyName("filepath_field"u8); writer.WriteStringValue(FilePathFieldName); } - if (SerializedAdditionalRawData?.ContainsKey("content_fields") != true && Optional.IsCollectionDefined(ContentFieldNames)) + if (Optional.IsCollectionDefined(ContentFieldNames) && _additionalBinaryDataProperties?.ContainsKey("content_fields") != true) { writer.WritePropertyName("content_fields"u8); writer.WriteStartArray(); - foreach (var item in ContentFieldNames) + foreach (string item in ContentFieldNames) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); } - if (SerializedAdditionalRawData?.ContainsKey("content_fields_separator") != true && Optional.IsDefined(ContentFieldSeparator)) + if (Optional.IsDefined(ContentFieldSeparator) && _additionalBinaryDataProperties?.ContainsKey("content_fields_separator") != true) { writer.WritePropertyName("content_fields_separator"u8); writer.WriteStringValue(ContentFieldSeparator); } - if (SerializedAdditionalRawData?.ContainsKey("vector_fields") != true && Optional.IsCollectionDefined(VectorFieldNames)) + if (Optional.IsCollectionDefined(VectorFieldNames) && _additionalBinaryDataProperties?.ContainsKey("vector_fields") != true) { writer.WritePropertyName("vector_fields"u8); writer.WriteStartArray(); - foreach (var item in VectorFieldNames) + foreach (string item in VectorFieldNames) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); } - if (SerializedAdditionalRawData?.ContainsKey("image_vector_fields") != true && Optional.IsCollectionDefined(ImageVectorFieldNames)) + if (Optional.IsCollectionDefined(ImageVectorFieldNames) && _additionalBinaryDataProperties?.ContainsKey("image_vector_fields") != true) { writer.WritePropertyName("image_vector_fields"u8); writer.WriteStartArray(); - foreach (var item in ImageVectorFieldNames) + foreach (string item in ImageVectorFieldNames) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -89,7 +105,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -100,121 +116,142 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DataSourceFieldMappings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DataSourceFieldMappings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DataSourceFieldMappings JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DataSourceFieldMappings)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDataSourceFieldMappings(document.RootElement, options); } - internal static DataSourceFieldMappings DeserializeDataSourceFieldMappings(JsonElement element, ModelReaderWriterOptions options = null) + internal static DataSourceFieldMappings DeserializeDataSourceFieldMappings(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string titleField = default; - string urlField = default; - string filepathField = default; - IList contentFields = default; - string contentFieldsSeparator = default; - IList vectorFields = default; - IList imageVectorFields = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string titleFieldName = default; + string urlFieldName = default; + string filePathFieldName = default; + IList contentFieldNames = default; + string contentFieldSeparator = default; + IList vectorFieldNames = default; + IList imageVectorFieldNames = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("title_field"u8)) + if (prop.NameEquals("title_field"u8)) { - titleField = property.Value.GetString(); + titleFieldName = prop.Value.GetString(); continue; } - if (property.NameEquals("url_field"u8)) + if (prop.NameEquals("url_field"u8)) { - urlField = property.Value.GetString(); + urlFieldName = prop.Value.GetString(); continue; } - if (property.NameEquals("filepath_field"u8)) + if (prop.NameEquals("filepath_field"u8)) { - filepathField = property.Value.GetString(); + filePathFieldName = prop.Value.GetString(); continue; } - if (property.NameEquals("content_fields"u8)) + if (prop.NameEquals("content_fields"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } - contentFields = array; + contentFieldNames = array; continue; } - if (property.NameEquals("content_fields_separator"u8)) + if (prop.NameEquals("content_fields_separator"u8)) { - contentFieldsSeparator = property.Value.GetString(); + contentFieldSeparator = prop.Value.GetString(); continue; } - if (property.NameEquals("vector_fields"u8)) + if (prop.NameEquals("vector_fields"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } - vectorFields = array; + vectorFieldNames = array; continue; } - if (property.NameEquals("image_vector_fields"u8)) + if (prop.NameEquals("image_vector_fields"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } - imageVectorFields = array; + imageVectorFieldNames = array; continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new DataSourceFieldMappings( - titleField, - urlField, - filepathField, - contentFields ?? new ChangeTrackingList(), - contentFieldsSeparator, - vectorFields ?? new ChangeTrackingList(), - imageVectorFields ?? new ChangeTrackingList(), - serializedAdditionalRawData); + titleFieldName, + urlFieldName, + filePathFieldName, + contentFieldNames ?? new ChangeTrackingList(), + contentFieldSeparator, + vectorFieldNames ?? new ChangeTrackingList(), + imageVectorFieldNames ?? new ChangeTrackingList(), + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -224,15 +261,18 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpt } } - DataSourceFieldMappings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + DataSourceFieldMappings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DataSourceFieldMappings PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeDataSourceFieldMappings(document.RootElement, options); } default: @@ -242,18 +282,22 @@ DataSourceFieldMappings IPersistableModel.Create(Binary string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static DataSourceFieldMappings FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(DataSourceFieldMappings dataSourceFieldMappings) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDataSourceFieldMappings(document.RootElement); + if (dataSourceFieldMappings == null) + { + return null; + } + return BinaryContent.Create(dataSourceFieldMappings, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator DataSourceFieldMappings(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeDataSourceFieldMappings(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs index 7a7d02231..55140853a 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs @@ -7,51 +7,13 @@ namespace Azure.AI.OpenAI.Chat { - /// The AzureSearchChatDataSourceParametersFieldsMapping. + /// The DataSourceFieldMappings. public partial class DataSourceFieldMappings { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; - /// Initializes a new instance of . - /// The name of the index field to use as a title. - /// The name of the index field to use as a URL. - /// The name of the index field to use as a filepath. - /// The names of index fields that should be treated as content. - /// The separator pattern that content fields should use. - /// The names of fields that represent vector data. - /// The names of fields that represent image vector data. - /// Keeps track of any properties unknown to the library. - internal DataSourceFieldMappings(string titleFieldName, string urlFieldName, string filePathFieldName, IList contentFieldNames, string contentFieldSeparator, IList vectorFieldNames, IList imageVectorFieldNames, IDictionary serializedAdditionalRawData) + internal DataSourceFieldMappings(string titleFieldName, string urlFieldName, string filePathFieldName, IList contentFieldNames, string contentFieldSeparator, IList vectorFieldNames, IList imageVectorFieldNames, IDictionary additionalBinaryDataProperties) { TitleFieldName = titleFieldName; UrlFieldName = urlFieldName; @@ -60,7 +22,13 @@ internal DataSourceFieldMappings(string titleFieldName, string urlFieldName, str ContentFieldSeparator = contentFieldSeparator; VectorFieldNames = vectorFieldNames; ImageVectorFieldNames = imageVectorFieldNames; - SerializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs index 90515d076..f21996d9a 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs @@ -4,54 +4,71 @@ using System; using System.ComponentModel; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// The AzureSearchChatDataSourceParametersQueryType. + /// public readonly partial struct DataSourceQueryType : IEquatable { private readonly string _value; + private const string SimpleValue = "simple"; + private const string SemanticValue = "semantic"; + private const string VectorValue = "vector"; + private const string VectorSimpleHybridValue = "vector_simple_hybrid"; + private const string VectorSemanticHybridValue = "vector_semantic_hybrid"; /// Initializes a new instance of . + /// The value. /// is null. public DataSourceQueryType(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string SimpleValue = "simple"; - private const string SemanticValue = "semantic"; - private const string VectorValue = "vector"; - private const string VectorSimpleHybridValue = "vector_simple_hybrid"; - private const string VectorSemanticHybridValue = "vector_semantic_hybrid"; + _value = value; + } - /// simple. + /// Gets the Simple. public static DataSourceQueryType Simple { get; } = new DataSourceQueryType(SimpleValue); - /// semantic. + + /// Gets the Semantic. public static DataSourceQueryType Semantic { get; } = new DataSourceQueryType(SemanticValue); - /// vector. + + /// Gets the Vector. public static DataSourceQueryType Vector { get; } = new DataSourceQueryType(VectorValue); - /// vector_simple_hybrid. + + /// Gets the VectorSimpleHybrid. public static DataSourceQueryType VectorSimpleHybrid { get; } = new DataSourceQueryType(VectorSimpleHybridValue); - /// vector_semantic_hybrid. + + /// Gets the VectorSemanticHybrid. public static DataSourceQueryType VectorSemanticHybrid { get; } = new DataSourceQueryType(VectorSemanticHybridValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(DataSourceQueryType left, DataSourceQueryType right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(DataSourceQueryType left, DataSourceQueryType right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator DataSourceQueryType(string value) => new DataSourceQueryType(value); - /// + /// The object to compare. [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is DataSourceQueryType other && Equals(other); - /// + + /// The instance to compare. public bool Equals(DataSourceQueryType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs index 44e5c7909..40cb27bd4 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs @@ -6,12 +6,18 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { + /// [PersistableModelProxy(typeof(InternalUnknownAzureChatDataSourceVectorizationSource))] - public partial class DataSourceVectorizer : IJsonModel + public abstract partial class DataSourceVectorizer : IJsonModel { + internal DataSourceVectorizer() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -23,20 +29,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DataSourceVectorizer)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("type") != true) + if (_additionalBinaryDataProperties?.ContainsKey("type") != true) { writer.WritePropertyName("type"u8); writer.WriteStringValue(Type); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -44,7 +49,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -55,43 +60,50 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DataSourceVectorizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DataSourceVectorizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DataSourceVectorizer JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DataSourceVectorizer)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDataSourceVectorizer(document.RootElement, options); } - internal static DataSourceVectorizer DeserializeDataSourceVectorizer(JsonElement element, ModelReaderWriterOptions options = null) + internal static DataSourceVectorizer DeserializeDataSourceVectorizer(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - if (element.TryGetProperty("type", out JsonElement discriminator)) + if (element.TryGetProperty("type"u8, out JsonElement discriminator)) { switch (discriminator.GetString()) { - case "deployment_name": return InternalAzureChatDataSourceDeploymentNameVectorizationSource.DeserializeInternalAzureChatDataSourceDeploymentNameVectorizationSource(element, options); - case "endpoint": return InternalAzureChatDataSourceEndpointVectorizationSource.DeserializeInternalAzureChatDataSourceEndpointVectorizationSource(element, options); - case "integrated": return InternalAzureChatDataSourceIntegratedVectorizationSource.DeserializeInternalAzureChatDataSourceIntegratedVectorizationSource(element, options); - case "model_id": return InternalAzureChatDataSourceModelIdVectorizationSource.DeserializeInternalAzureChatDataSourceModelIdVectorizationSource(element, options); + case "endpoint": + return InternalAzureChatDataSourceEndpointVectorizationSource.DeserializeInternalAzureChatDataSourceEndpointVectorizationSource(element, options); + case "deployment_name": + return InternalAzureChatDataSourceDeploymentNameVectorizationSource.DeserializeInternalAzureChatDataSourceDeploymentNameVectorizationSource(element, options); + case "model_id": + return InternalAzureChatDataSourceModelIdVectorizationSource.DeserializeInternalAzureChatDataSourceModelIdVectorizationSource(element, options); + case "integrated": + return InternalAzureChatDataSourceIntegratedVectorizationSource.DeserializeInternalAzureChatDataSourceIntegratedVectorizationSource(element, options); } } return InternalUnknownAzureChatDataSourceVectorizationSource.DeserializeInternalUnknownAzureChatDataSourceVectorizationSource(element, options); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -101,15 +113,18 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - DataSourceVectorizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + DataSourceVectorizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DataSourceVectorizer PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeDataSourceVectorizer(document.RootElement, options); } default: @@ -119,18 +134,22 @@ DataSourceVectorizer IPersistableModel.Create(BinaryData d string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static DataSourceVectorizer FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(DataSourceVectorizer dataSourceVectorizer) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeDataSourceVectorizer(document.RootElement); + if (dataSourceVectorizer == null) + { + return null; + } + return BinaryContent.Create(dataSourceVectorizer, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator DataSourceVectorizer(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeDataSourceVectorizer(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs index 474c24590..52b472d60 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs @@ -7,58 +7,29 @@ namespace Azure.AI.OpenAI.Chat { - /// - /// A representation of a data vectorization source usable as an embedding resource with a data source. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// + /// A representation of a data vectorization source usable as an embedding resource with a data source. public abstract partial class DataSourceVectorizer { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - protected DataSourceVectorizer() + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + + private protected DataSourceVectorizer(string @type) { + Type = @type; } - /// Initializes a new instance of . - /// The differentiating identifier for the concrete vectorization source. - /// Keeps track of any properties unknown to the library. - internal DataSourceVectorizer(string type, IDictionary serializedAdditionalRawData) + internal DataSourceVectorizer(string @type, IDictionary additionalBinaryDataProperties) { - Type = type; - SerializedAdditionalRawData = serializedAdditionalRawData; + Type = @type; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// The differentiating identifier for the concrete vectorization source. internal string Type { get; set; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs index 3a9a20cda..7c3ba933f 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs @@ -7,9 +7,11 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { + /// public partial class ElasticsearchChatDataSource : IJsonModel { void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -23,70 +25,69 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ElasticsearchChatDataSource)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) + if (_additionalBinaryDataProperties?.ContainsKey("parameters") != true) { writer.WritePropertyName("parameters"u8); writer.WriteObjectValue(InternalParameters, options); } } - ElasticsearchChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ElasticsearchChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (ElasticsearchChatDataSource)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ChatDataSource JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ElasticsearchChatDataSource)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeElasticsearchChatDataSource(document.RootElement, options); } - internal static ElasticsearchChatDataSource DeserializeElasticsearchChatDataSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static ElasticsearchChatDataSource DeserializeElasticsearchChatDataSource(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - InternalElasticsearchChatDataSourceParameters parameters = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string @type = "elasticsearch"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + InternalElasticsearchChatDataSourceParameters internalParameters = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("parameters"u8)) + if (prop.NameEquals("type"u8)) { - parameters = InternalElasticsearchChatDataSourceParameters.DeserializeInternalElasticsearchChatDataSourceParameters(property.Value, options); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("parameters"u8)) { - type = property.Value.GetString(); + internalParameters = InternalElasticsearchChatDataSourceParameters.DeserializeInternalElasticsearchChatDataSourceParameters(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ElasticsearchChatDataSource(type, serializedAdditionalRawData, parameters); + return new ElasticsearchChatDataSource(@type, additionalBinaryDataProperties, internalParameters); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -96,15 +97,18 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - ElasticsearchChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + ElasticsearchChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (ElasticsearchChatDataSource)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ChatDataSource PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeElasticsearchChatDataSource(document.RootElement, options); } default: @@ -114,18 +118,22 @@ ElasticsearchChatDataSource IPersistableModel.Creat string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new ElasticsearchChatDataSource FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(ElasticsearchChatDataSource elasticsearchChatDataSource) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeElasticsearchChatDataSource(document.RootElement); + if (elasticsearchChatDataSource == null) + { + return null; + } + return BinaryContent.Create(elasticsearchChatDataSource, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator ElasticsearchChatDataSource(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeElasticsearchChatDataSource(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs index a3c0db413..aa55edff6 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs @@ -2,9 +2,6 @@ #nullable disable -using System; -using System.Collections.Generic; - namespace Azure.AI.OpenAI.Chat { /// The ElasticsearchChatDataSource. diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Argument.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Argument.cs index 5a8ab138b..a7187a745 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Argument.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Argument.cs @@ -8,7 +8,7 @@ namespace Azure.AI.OpenAI { - internal static class Argument + internal static partial class Argument { public static void AssertNotNull(T value, string name) { @@ -19,7 +19,7 @@ public static void AssertNotNull(T value, string name) } public static void AssertNotNull(T? value, string name) - where T : struct + where T : struct { if (!value.HasValue) { @@ -73,7 +73,7 @@ public static void AssertNotNullOrWhiteSpace(string value, string name) } public static void AssertNotDefault(ref T value, string name) - where T : struct, IEquatable + where T : struct, IEquatable { if (value.Equals(default)) { @@ -82,7 +82,7 @@ public static void AssertNotDefault(ref T value, string name) } public static void AssertInRange(T value, T minimum, T maximum, string name) - where T : notnull, IComparable + where T : notnull, IComparable { if (minimum.CompareTo(value) > 0) { @@ -103,7 +103,7 @@ public static void AssertEnumDefined(Type enumType, object value, string name) } public static T CheckNotNull(T value, string name) - where T : class + where T : class { AssertNotNull(value, name); return value; diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/BinaryContentHelper.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/BinaryContentHelper.cs index 94ae48ee4..e5fd4d33e 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/BinaryContentHelper.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/BinaryContentHelper.cs @@ -9,10 +9,10 @@ namespace Azure.AI.OpenAI { - internal static class BinaryContentHelper + internal static partial class BinaryContentHelper { public static BinaryContent FromEnumerable(IEnumerable enumerable) - where T : notnull + where T : notnull { Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); content.JsonWriter.WriteStartArray(); @@ -38,7 +38,7 @@ public static BinaryContent FromEnumerable(IEnumerable enumerable) else { #if NET6_0_OR_GREATER - content.JsonWriter.WriteRawValue(item); + content.JsonWriter.WriteRawValue(item); #else using (JsonDocument document = JsonDocument.Parse(item)) { @@ -53,11 +53,12 @@ public static BinaryContent FromEnumerable(IEnumerable enumerable) } public static BinaryContent FromEnumerable(ReadOnlySpan span) - where T : notnull + where T : notnull { Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); content.JsonWriter.WriteStartArray(); - for (int i = 0; i < span.Length; i++) + int i = 0; + for (; i < span.Length; i++) { content.JsonWriter.WriteObjectValue(span[i], ModelSerializationExtensions.WireOptions); } @@ -67,7 +68,7 @@ public static BinaryContent FromEnumerable(ReadOnlySpan span) } public static BinaryContent FromDictionary(IDictionary dictionary) - where TValue : notnull + where TValue : notnull { Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); content.JsonWriter.WriteStartObject(); @@ -95,7 +96,7 @@ public static BinaryContent FromDictionary(IDictionary dicti else { #if NET6_0_OR_GREATER - content.JsonWriter.WriteRawValue(item.Value); + content.JsonWriter.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -120,7 +121,7 @@ public static BinaryContent FromObject(BinaryData value) { Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); #if NET6_0_OR_GREATER - content.JsonWriter.WriteRawValue(value); + content.JsonWriter.WriteRawValue(value); #else using (JsonDocument document = JsonDocument.Parse(value)) { diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ChangeTrackingDictionary.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ChangeTrackingDictionary.cs index 058e71abe..df2c9dea1 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ChangeTrackingDictionary.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -8,7 +8,8 @@ namespace Azure.AI.OpenAI { - internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + internal partial class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary + where TKey : notnull { private IDictionary _innerDictionary; diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ChangeTrackingList.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ChangeTrackingList.cs index 9c6986a3a..033bc49c6 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ChangeTrackingList.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ChangeTrackingList.cs @@ -9,7 +9,7 @@ namespace Azure.AI.OpenAI { - internal class ChangeTrackingList : IList, IReadOnlyList + internal partial class ChangeTrackingList : IList, IReadOnlyList { private IList _innerList; diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientUriBuilder.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientUriBuilder.cs index aa2ae4da3..5e8571d1e 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientUriBuilder.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientUriBuilder.cs @@ -19,11 +19,11 @@ public ClientUriBuilder() { } - private UriBuilder UriBuilder => _uriBuilder ??= new UriBuilder(); + private UriBuilder UriBuilder => _uriBuilder ??= new UriBuilder(); - private StringBuilder PathBuilder => _pathBuilder ??= new StringBuilder(UriBuilder.Path); + private StringBuilder PathBuilder => _pathBuilder ??= new StringBuilder(UriBuilder.Path); - private StringBuilder QueryBuilder => _queryBuilder ??= new StringBuilder(UriBuilder.Query); + private StringBuilder QueryBuilder => _queryBuilder ??= new StringBuilder(UriBuilder.Query); public void Reset(Uri uri) { @@ -34,156 +34,84 @@ public void Reset(Uri uri) public void AppendPath(string value, bool escape) { - Argument.AssertNotNullOrWhiteSpace(value, nameof(value)); - if (escape) { value = Uri.EscapeDataString(value); } - if (PathBuilder.Length > 0 && PathBuilder[PathBuilder.Length - 1] == '/' && value[0] == '/') { PathBuilder.Remove(PathBuilder.Length - 1, 1); } - PathBuilder.Append(value); UriBuilder.Path = PathBuilder.ToString(); } - public void AppendPath(bool value, bool escape = false) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } + public void AppendPath(bool value, bool escape = false) => AppendPath(TypeFormatters.ConvertToString(value), escape); - public void AppendPath(float value, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } + public void AppendPath(float value, bool escape = true) => AppendPath(TypeFormatters.ConvertToString(value), escape); - public void AppendPath(double value, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } + public void AppendPath(double value, bool escape = true) => AppendPath(TypeFormatters.ConvertToString(value), escape); - public void AppendPath(int value, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } + public void AppendPath(int value, bool escape = true) => AppendPath(TypeFormatters.ConvertToString(value), escape); - public void AppendPath(byte[] value, string format, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value, format), escape); - } + public void AppendPath(byte[] value, string format, bool escape = true) => AppendPath(TypeFormatters.ConvertToString(value, format), escape); - public void AppendPath(IEnumerable value, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } + public void AppendPath(DateTimeOffset value, string format, bool escape = true) => AppendPath(TypeFormatters.ConvertToString(value, format), escape); - public void AppendPath(DateTimeOffset value, string format, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value, format), escape); - } + public void AppendPath(TimeSpan value, string format, bool escape = true) => AppendPath(TypeFormatters.ConvertToString(value, format), escape); - public void AppendPath(TimeSpan value, string format, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value, format), escape); - } + public void AppendPath(Guid value, bool escape = true) => AppendPath(TypeFormatters.ConvertToString(value), escape); - public void AppendPath(Guid value, bool escape = true) - { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } + public void AppendPath(long value, bool escape = true) => AppendPath(TypeFormatters.ConvertToString(value), escape); - public void AppendPath(long value, bool escape = true) + public void AppendPathDelimited(IEnumerable value, string delimiter, string format = null, bool escape = true) { - AppendPath(ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); + delimiter ??= ","; + IEnumerable stringValues = value.Select(v => TypeFormatters.ConvertToString(v, format)); + AppendPath(string.Join(delimiter, stringValues), escape); } public void AppendQuery(string name, string value, bool escape) { - Argument.AssertNotNullOrWhiteSpace(name, nameof(name)); - Argument.AssertNotNullOrWhiteSpace(value, nameof(value)); - if (QueryBuilder.Length > 0) { QueryBuilder.Append('&'); } - if (escape) { value = Uri.EscapeDataString(value); } - QueryBuilder.Append(name); QueryBuilder.Append('='); QueryBuilder.Append(value); } - public void AppendQuery(string name, bool value, bool escape = false) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } - - public void AppendQuery(string name, float value, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } + public void AppendQuery(string name, bool value, bool escape = false) => AppendQuery(name, TypeFormatters.ConvertToString(value), escape); - public void AppendQuery(string name, DateTimeOffset value, string format, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value, format), escape); - } + public void AppendQuery(string name, float value, bool escape = true) => AppendQuery(name, TypeFormatters.ConvertToString(value), escape); - public void AppendQuery(string name, TimeSpan value, string format, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value, format), escape); - } + public void AppendQuery(string name, DateTimeOffset value, string format, bool escape = true) => AppendQuery(name, TypeFormatters.ConvertToString(value, format), escape); - public void AppendQuery(string name, double value, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } + public void AppendQuery(string name, TimeSpan value, string format, bool escape = true) => AppendQuery(name, TypeFormatters.ConvertToString(value, format), escape); - public void AppendQuery(string name, decimal value, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } + public void AppendQuery(string name, double value, bool escape = true) => AppendQuery(name, TypeFormatters.ConvertToString(value), escape); - public void AppendQuery(string name, int value, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } + public void AppendQuery(string name, decimal value, bool escape = true) => AppendQuery(name, TypeFormatters.ConvertToString(value), escape); - public void AppendQuery(string name, long value, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } + public void AppendQuery(string name, int value, bool escape = true) => AppendQuery(name, TypeFormatters.ConvertToString(value), escape); - public void AppendQuery(string name, TimeSpan value, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } + public void AppendQuery(string name, long value, bool escape = true) => AppendQuery(name, TypeFormatters.ConvertToString(value), escape); - public void AppendQuery(string name, byte[] value, string format, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value, format), escape); - } + public void AppendQuery(string name, TimeSpan value, bool escape = true) => AppendQuery(name, TypeFormatters.ConvertToString(value), escape); - public void AppendQuery(string name, Guid value, bool escape = true) - { - AppendQuery(name, ModelSerializationExtensions.TypeFormatters.ConvertToString(value), escape); - } + public void AppendQuery(string name, byte[] value, string format, bool escape = true) => AppendQuery(name, TypeFormatters.ConvertToString(value, format), escape); - public void AppendQueryDelimited(string name, IEnumerable value, string delimiter, bool escape = true) - { - var stringValues = value.Select(v => ModelSerializationExtensions.TypeFormatters.ConvertToString(v)); - AppendQuery(name, string.Join(delimiter, stringValues), escape); - } + public void AppendQuery(string name, Guid value, bool escape = true) => AppendQuery(name, TypeFormatters.ConvertToString(value), escape); - public void AppendQueryDelimited(string name, IEnumerable value, string delimiter, string format, bool escape = true) + public void AppendQueryDelimited(string name, IEnumerable value, string delimiter, string format = null, bool escape = true) { - var stringValues = value.Select(v => ModelSerializationExtensions.TypeFormatters.ConvertToString(v, format)); + delimiter ??= ","; + IEnumerable stringValues = value.Select(v => TypeFormatters.ConvertToString(v, format)); AppendQuery(name, string.Join(delimiter, stringValues), escape); } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ErrorResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ErrorResult.cs index f9ea3276e..8f71d7aff 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ErrorResult.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ErrorResult.cs @@ -7,7 +7,7 @@ namespace Azure.AI.OpenAI { - internal class ErrorResult : ClientResult + internal partial class ErrorResult : ClientResult { private readonly PipelineResponse _response; private readonly ClientResultException _exception; diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ModelSerializationExtensions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ModelSerializationExtensions.cs index f6ab935f1..a5ecbaef5 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ModelSerializationExtensions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ModelSerializationExtensions.cs @@ -8,14 +8,14 @@ using System.Diagnostics; using System.Globalization; using System.Text.Json; -using System.Xml; namespace Azure.AI.OpenAI { - internal static class ModelSerializationExtensions + internal static partial class ModelSerializationExtensions { internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); - internal static readonly BinaryData SentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray()); + /// + private static readonly BinaryData _sentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray()); public static object GetObject(this JsonElement element) { @@ -41,14 +41,14 @@ public static object GetObject(this JsonElement element) case JsonValueKind.Null: return null; case JsonValueKind.Object: - var dictionary = new Dictionary(); + Dictionary dictionary = new Dictionary(); foreach (var jsonProperty in element.EnumerateObject()) { dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); } return dictionary; case JsonValueKind.Array: - var list = new List(); + List list = new List(); foreach (var item in element.EnumerateArray()) { list.Add(item.GetObject()); @@ -86,7 +86,7 @@ public static char GetChar(this JsonElement element) { if (element.ValueKind == JsonValueKind.String) { - var text = element.GetString(); + string text = element.GetString(); if (text == null || text.Length != 1) { throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); @@ -100,14 +100,14 @@ public static char GetChar(this JsonElement element) } [Conditional("DEBUG")] - public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + public static void ThrowNonNullablePropertyIsNull(this JsonProperty @property) { - throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + throw new JsonException($"A property '{@property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); } public static string GetRequiredString(this JsonElement element) { - var value = element.GetString(); + string value = element.GetString(); if (value == null) { throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); @@ -252,148 +252,9 @@ public static void WriteObjectValue(this Utf8JsonWriter writer, object value, Mo internal static bool IsSentinelValue(BinaryData value) { - ReadOnlySpan sentinelSpan = SentinelValue.ToMemory().Span; + ReadOnlySpan sentinelSpan = _sentinelValue.ToMemory().Span; ReadOnlySpan valueSpan = value.ToMemory().Span; return sentinelSpan.SequenceEqual(valueSpan); } - - internal static class TypeFormatters - { - private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; - public const string DefaultNumberFormat = "G"; - - public static string ToString(bool value) => value ? "true" : "false"; - - public static string ToString(DateTime value, string format) => value.Kind switch - { - DateTimeKind.Utc => ToString((DateTimeOffset)value, format), - _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Generated clients require it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") - }; - - public static string ToString(DateTimeOffset value, string format) => format switch - { - "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), - "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), - "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), - "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), - "R" => value.ToString("r", CultureInfo.InvariantCulture), - _ => value.ToString(format, CultureInfo.InvariantCulture) - }; - - public static string ToString(TimeSpan value, string format) => format switch - { - "P" => XmlConvert.ToString(value), - _ => value.ToString(format, CultureInfo.InvariantCulture) - }; - - public static string ToString(byte[] value, string format) => format switch - { - "U" => ToBase64UrlString(value), - "D" => Convert.ToBase64String(value), - _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) - }; - - public static string ToBase64UrlString(byte[] value) - { - int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; - int size = checked(numWholeOrPartialInputBlocks * 4); - char[] output = new char[size]; - - int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); - - int i = 0; - for (; i < numBase64Chars; i++) - { - char ch = output[i]; - if (ch == '+') - { - output[i] = '-'; - } - else - { - if (ch == '/') - { - output[i] = '_'; - } - else - { - if (ch == '=') - { - break; - } - } - } - } - - return new string(output, 0, i); - } - - public static byte[] FromBase64UrlString(string value) - { - int paddingCharsToAdd = (value.Length % 4) switch - { - 0 => 0, - 2 => 2, - 3 => 1, - _ => throw new InvalidOperationException("Malformed input") - }; - char[] output = new char[(value.Length + paddingCharsToAdd)]; - int i = 0; - for (; i < value.Length; i++) - { - char ch = value[i]; - if (ch == '-') - { - output[i] = '+'; - } - else - { - if (ch == '_') - { - output[i] = '/'; - } - else - { - output[i] = ch; - } - } - } - - for (; i < output.Length; i++) - { - output[i] = '='; - } - - return Convert.FromBase64CharArray(output, 0, output.Length); - } - - public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch - { - "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), - _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) - }; - - public static TimeSpan ParseTimeSpan(string value, string format) => format switch - { - "P" => XmlConvert.ToTimeSpan(value), - _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) - }; - - public static string ConvertToString(object value, string format = null) => value switch - { - null => "null", - string s => s, - bool b => ToString(b), - int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), - byte[] b0 when format != null => ToString(b0, format), - IEnumerable s0 => string.Join(",", s0), - DateTimeOffset dateTime when format != null => ToString(dateTime, format), - TimeSpan timeSpan when format != null => ToString(timeSpan, format), - TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), - Guid guid => guid.ToString(), - BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), - _ => value.ToString() - }; - } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/MultipartFormDataBinaryContent.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/MultipartFormDataBinaryContent.cs deleted file mode 100644 index 43825f6b4..000000000 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/MultipartFormDataBinaryContent.cs +++ /dev/null @@ -1,197 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.Globalization; -using System.IO; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Threading; -using System.Threading.Tasks; - -namespace Azure.AI.OpenAI -{ - internal class MultipartFormDataBinaryContent : BinaryContent - { - private readonly MultipartFormDataContent _multipartContent; - private static readonly Random _random = new Random(); - private static readonly char[] _boundaryValues = "0123456789=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".ToCharArray(); - - public MultipartFormDataBinaryContent() - { - _multipartContent = new MultipartFormDataContent(CreateBoundary()); - } - - public string ContentType - { - get - { - return _multipartContent.Headers.ContentType.ToString(); - } - } - - internal HttpContent HttpContent => _multipartContent; - - private static string CreateBoundary() - { - Span chars = new char[70]; - byte[] random = new byte[70]; - _random.NextBytes(random); - int mask = 255 >> 2; - for (int i = 0; i < 70; i++) - { - chars[i] = _boundaryValues[random[i] & mask]; - } - return chars.ToString(); - } - - public void Add(string content, string name, string filename = null, string contentType = null) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - Add(new StringContent(content), name, filename, contentType); - } - - public void Add(int content, string name, string filename = null, string contentType = null) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - string value = content.ToString("G", CultureInfo.InvariantCulture); - Add(new StringContent(value), name, filename, contentType); - } - - public void Add(long content, string name, string filename = null, string contentType = null) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - string value = content.ToString("G", CultureInfo.InvariantCulture); - Add(new StringContent(value), name, filename, contentType); - } - - public void Add(float content, string name, string filename = null, string contentType = null) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - string value = content.ToString("G", CultureInfo.InvariantCulture); - Add(new StringContent(value), name, filename, contentType); - } - - public void Add(double content, string name, string filename = null, string contentType = null) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - string value = content.ToString("G", CultureInfo.InvariantCulture); - Add(new StringContent(value), name, filename, contentType); - } - - public void Add(decimal content, string name, string filename = null, string contentType = null) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - string value = content.ToString("G", CultureInfo.InvariantCulture); - Add(new StringContent(value), name, filename, contentType); - } - - public void Add(bool content, string name, string filename = null, string contentType = null) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - string value = content ? "true" : "false"; - Add(new StringContent(value), name, filename, contentType); - } - - public void Add(Stream content, string name, string filename = null, string contentType = null) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - Add(new StreamContent(content), name, filename, contentType); - } - - public void Add(byte[] content, string name, string filename = null, string contentType = null) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - Add(new ByteArrayContent(content), name, filename, contentType); - } - - public void Add(BinaryData content, string name, string filename = null, string contentType = null) - { - Argument.AssertNotNull(content, nameof(content)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - Add(new ByteArrayContent(content.ToArray()), name, filename, contentType); - } - - private void Add(HttpContent content, string name, string filename, string contentType) - { - if (filename != null) - { - Argument.AssertNotNullOrEmpty(filename, nameof(filename)); - AddFilenameHeader(content, name, filename); - } - if (contentType != null) - { - Argument.AssertNotNullOrEmpty(contentType, nameof(contentType)); - AddContentTypeHeader(content, contentType); - } - _multipartContent.Add(content, name); - } - - public static void AddFilenameHeader(HttpContent content, string name, string filename) - { - ContentDispositionHeaderValue header = new ContentDispositionHeaderValue("form-data") { Name = name, FileName = filename }; - content.Headers.ContentDisposition = header; - } - - public static void AddContentTypeHeader(HttpContent content, string contentType) - { - MediaTypeHeaderValue header = new MediaTypeHeaderValue(contentType); - content.Headers.ContentType = header; - } - - public override bool TryComputeLength(out long length) - { - if (_multipartContent.Headers.ContentLength is long contentLength) - { - length = contentLength; - return true; - } - length = 0; - return false; - } - - public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) - { -#if NET6_0_OR_GREATER - _multipartContent.CopyTo(stream, default, cancellationToken); -#else - _multipartContent.CopyToAsync(stream).GetAwaiter().GetResult(); -#endif - } - - public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) - { -#if NET6_0_OR_GREATER - await _multipartContent.CopyToAsync(stream, cancellationToken).ConfigureAwait(false); -#else - await _multipartContent.CopyToAsync(stream).ConfigureAwait(false); -#endif - } - - public override void Dispose() - { - _multipartContent.Dispose(); - } - } -} diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Optional.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Optional.cs index 56bba5f65..4ea4dafd0 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Optional.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Optional.cs @@ -7,7 +7,7 @@ namespace Azure.AI.OpenAI { - internal static class Optional + internal static partial class Optional { public static bool IsCollectionDefined(IEnumerable collection) { @@ -25,7 +25,7 @@ public static bool IsCollectionDefined(IReadOnlyDictionary(T? value) - where T : struct + where T : struct { return value.HasValue; } @@ -35,14 +35,14 @@ public static bool IsDefined(object value) return value != null; } - public static bool IsDefined(JsonElement value) + public static bool IsDefined(string value) { - return value.ValueKind != JsonValueKind.Undefined; + return value != null; } - public static bool IsDefined(string value) + public static bool IsDefined(JsonElement value) { - return value != null; + return value.ValueKind != JsonValueKind.Undefined; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/PipelineRequestHeadersExtensions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/PipelineRequestHeadersExtensions.cs new file mode 100644 index 000000000..1fbb4104a --- /dev/null +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/PipelineRequestHeadersExtensions.cs @@ -0,0 +1,25 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.OpenAI +{ + internal static partial class PipelineRequestHeadersExtensions + { + public static void SetDelimited(this PipelineRequestHeaders headers, string name, IEnumerable value, string delimiter) + { + IEnumerable stringValues = value.Select(v => TypeFormatters.ConvertToString(v)); + headers.Set(name, string.Join(delimiter, stringValues)); + } + + public static void SetDelimited(this PipelineRequestHeaders headers, string name, IEnumerable value, string delimiter, string format) + { + IEnumerable stringValues = value.Select(v => TypeFormatters.ConvertToString(v, format)); + headers.Set(name, string.Join(delimiter, stringValues)); + } + } +} diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/TypeFormatters.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/TypeFormatters.cs new file mode 100644 index 000000000..c2d0f67ca --- /dev/null +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/TypeFormatters.cs @@ -0,0 +1,150 @@ +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Xml; + +namespace Azure.AI.OpenAI +{ + internal static partial class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Generated clients require it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => System.Xml.XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked (value.Length + 2) / 3; + int size = checked (numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => System.Xml.XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => System.Xml.XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } +} diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Utf8JsonBinaryContent.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Utf8JsonBinaryContent.cs index 7f70307bf..46857c303 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Utf8JsonBinaryContent.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/Utf8JsonBinaryContent.cs @@ -10,7 +10,7 @@ namespace Azure.AI.OpenAI { - internal class Utf8JsonBinaryContent : BinaryContent + internal partial class Utf8JsonBinaryContent : BinaryContent { private readonly MemoryStream _stream; private readonly BinaryContent _content; diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs index cd0fc5e51..60d260159 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs @@ -7,11 +7,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalAzureChatDataSourceAccessTokenAuthenticationOptions : IJsonModel { + internal InternalAzureChatDataSourceAccessTokenAuthenticationOptions() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,74 +24,68 @@ void IJsonModel.Wri writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceAccessTokenAuthenticationOptions)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (SerializedAdditionalRawData?.ContainsKey("access_token") != true) + if (_additionalBinaryDataProperties?.ContainsKey("access_token") != true) { writer.WritePropertyName("access_token"u8); writer.WriteStringValue(AccessToken); } } - InternalAzureChatDataSourceAccessTokenAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureChatDataSourceAccessTokenAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceAccessTokenAuthenticationOptions)JsonModelCreateCore(ref reader, options); + + protected override DataSourceAuthentication JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceAccessTokenAuthenticationOptions)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureChatDataSourceAccessTokenAuthenticationOptions(document.RootElement, options); } - internal static InternalAzureChatDataSourceAccessTokenAuthenticationOptions DeserializeInternalAzureChatDataSourceAccessTokenAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureChatDataSourceAccessTokenAuthenticationOptions DeserializeInternalAzureChatDataSourceAccessTokenAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string @type = "access_token"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string accessToken = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("access_token"u8)) + if (prop.NameEquals("type"u8)) { - accessToken = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("access_token"u8)) { - type = property.Value.GetString(); + accessToken = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceAccessTokenAuthenticationOptions(type, serializedAdditionalRawData, accessToken); + return new InternalAzureChatDataSourceAccessTokenAuthenticationOptions(@type, additionalBinaryDataProperties, accessToken); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -96,15 +95,16 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureChatDataSourceAccessTokenAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceAccessTokenAuthenticationOptions)PersistableModelCreateCore(data, options); + protected override DataSourceAuthentication PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureChatDataSourceAccessTokenAuthenticationOptions(document.RootElement, options); } default: @@ -114,18 +114,20 @@ InternalAzureChatDataSourceAccessTokenAuthenticationOptions IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceAccessTokenAuthenticationOptions FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureChatDataSourceAccessTokenAuthenticationOptions internalAzureChatDataSourceAccessTokenAuthenticationOptions) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceAccessTokenAuthenticationOptions(document.RootElement); + if (internalAzureChatDataSourceAccessTokenAuthenticationOptions == null) + { + return null; + } + return BinaryContent.Create(internalAzureChatDataSourceAccessTokenAuthenticationOptions, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + public static explicit operator InternalAzureChatDataSourceAccessTokenAuthenticationOptions(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureChatDataSourceAccessTokenAuthenticationOptions(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs index f112ad6ad..7be771ec0 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs @@ -4,38 +4,24 @@ using System; using System.Collections.Generic; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// The AzureChatDataSourceAccessTokenAuthenticationOptions. internal partial class InternalAzureChatDataSourceAccessTokenAuthenticationOptions : DataSourceAuthentication { - /// Initializes a new instance of . - /// - /// is null. - public InternalAzureChatDataSourceAccessTokenAuthenticationOptions(string accessToken) + public InternalAzureChatDataSourceAccessTokenAuthenticationOptions(string accessToken) : base("access_token") { Argument.AssertNotNull(accessToken, nameof(accessToken)); - Type = "access_token"; AccessToken = accessToken; } - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - internal InternalAzureChatDataSourceAccessTokenAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string accessToken) : base(type, serializedAdditionalRawData) + internal InternalAzureChatDataSourceAccessTokenAuthenticationOptions(string @type, IDictionary additionalBinaryDataProperties, string accessToken) : base(@type, additionalBinaryDataProperties) { AccessToken = accessToken; } - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceAccessTokenAuthenticationOptions() - { - } - - /// Gets the access token. internal string AccessToken { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs index 38b1824ec..7b25e63c2 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs @@ -7,11 +7,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalAzureChatDataSourceApiKeyAuthenticationOptions : IJsonModel { + internal InternalAzureChatDataSourceApiKeyAuthenticationOptions() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,74 +24,68 @@ void IJsonModel.Write(Ut writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceApiKeyAuthenticationOptions)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (SerializedAdditionalRawData?.ContainsKey("key") != true) + if (_additionalBinaryDataProperties?.ContainsKey("key") != true) { writer.WritePropertyName("key"u8); writer.WriteStringValue(Key); } } - InternalAzureChatDataSourceApiKeyAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureChatDataSourceApiKeyAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceApiKeyAuthenticationOptions)JsonModelCreateCore(ref reader, options); + + protected override DataSourceAuthentication JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceApiKeyAuthenticationOptions)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureChatDataSourceApiKeyAuthenticationOptions(document.RootElement, options); } - internal static InternalAzureChatDataSourceApiKeyAuthenticationOptions DeserializeInternalAzureChatDataSourceApiKeyAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureChatDataSourceApiKeyAuthenticationOptions DeserializeInternalAzureChatDataSourceApiKeyAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string @type = "api_key"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string key = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("key"u8)) + if (prop.NameEquals("type"u8)) { - key = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("key"u8)) { - type = property.Value.GetString(); + key = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceApiKeyAuthenticationOptions(type, serializedAdditionalRawData, key); + return new InternalAzureChatDataSourceApiKeyAuthenticationOptions(@type, additionalBinaryDataProperties, key); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -96,15 +95,16 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureChatDataSourceApiKeyAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceApiKeyAuthenticationOptions)PersistableModelCreateCore(data, options); + protected override DataSourceAuthentication PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureChatDataSourceApiKeyAuthenticationOptions(document.RootElement, options); } default: @@ -114,18 +114,20 @@ InternalAzureChatDataSourceApiKeyAuthenticationOptions IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceApiKeyAuthenticationOptions FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureChatDataSourceApiKeyAuthenticationOptions internalAzureChatDataSourceApiKeyAuthenticationOptions) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceApiKeyAuthenticationOptions(document.RootElement); + if (internalAzureChatDataSourceApiKeyAuthenticationOptions == null) + { + return null; + } + return BinaryContent.Create(internalAzureChatDataSourceApiKeyAuthenticationOptions, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + public static explicit operator InternalAzureChatDataSourceApiKeyAuthenticationOptions(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureChatDataSourceApiKeyAuthenticationOptions(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs index 30da6760d..60fd30256 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs @@ -4,38 +4,24 @@ using System; using System.Collections.Generic; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// The AzureChatDataSourceApiKeyAuthenticationOptions. internal partial class InternalAzureChatDataSourceApiKeyAuthenticationOptions : DataSourceAuthentication { - /// Initializes a new instance of . - /// - /// is null. - public InternalAzureChatDataSourceApiKeyAuthenticationOptions(string key) + public InternalAzureChatDataSourceApiKeyAuthenticationOptions(string key) : base("api_key") { Argument.AssertNotNull(key, nameof(key)); - Type = "api_key"; Key = key; } - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - internal InternalAzureChatDataSourceApiKeyAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string key) : base(type, serializedAdditionalRawData) + internal InternalAzureChatDataSourceApiKeyAuthenticationOptions(string @type, IDictionary additionalBinaryDataProperties, string key) : base(@type, additionalBinaryDataProperties) { Key = key; } - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceApiKeyAuthenticationOptions() - { - } - - /// Gets the key. internal string Key { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs index c69efc08d..68b5fe909 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs @@ -7,11 +7,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalAzureChatDataSourceConnectionStringAuthenticationOptions : IJsonModel { + internal InternalAzureChatDataSourceConnectionStringAuthenticationOptions() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,74 +24,68 @@ void IJsonModel The JSON writer. - /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceConnectionStringAuthenticationOptions)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (SerializedAdditionalRawData?.ContainsKey("connection_string") != true) + if (_additionalBinaryDataProperties?.ContainsKey("connection_string") != true) { writer.WritePropertyName("connection_string"u8); writer.WriteStringValue(ConnectionString); } } - InternalAzureChatDataSourceConnectionStringAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureChatDataSourceConnectionStringAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceConnectionStringAuthenticationOptions)JsonModelCreateCore(ref reader, options); + + protected override DataSourceAuthentication JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceConnectionStringAuthenticationOptions)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureChatDataSourceConnectionStringAuthenticationOptions(document.RootElement, options); } - internal static InternalAzureChatDataSourceConnectionStringAuthenticationOptions DeserializeInternalAzureChatDataSourceConnectionStringAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureChatDataSourceConnectionStringAuthenticationOptions DeserializeInternalAzureChatDataSourceConnectionStringAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string @type = "connection_string"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string connectionString = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("connection_string"u8)) + if (prop.NameEquals("type"u8)) { - connectionString = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("connection_string"u8)) { - type = property.Value.GetString(); + connectionString = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceConnectionStringAuthenticationOptions(type, serializedAdditionalRawData, connectionString); + return new InternalAzureChatDataSourceConnectionStringAuthenticationOptions(@type, additionalBinaryDataProperties, connectionString); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -96,15 +95,16 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureChatDataSourceConnectionStringAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceConnectionStringAuthenticationOptions)PersistableModelCreateCore(data, options); + protected override DataSourceAuthentication PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureChatDataSourceConnectionStringAuthenticationOptions(document.RootElement, options); } default: @@ -114,18 +114,20 @@ InternalAzureChatDataSourceConnectionStringAuthenticationOptions IPersistableMod string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceConnectionStringAuthenticationOptions FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureChatDataSourceConnectionStringAuthenticationOptions internalAzureChatDataSourceConnectionStringAuthenticationOptions) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceConnectionStringAuthenticationOptions(document.RootElement); + if (internalAzureChatDataSourceConnectionStringAuthenticationOptions == null) + { + return null; + } + return BinaryContent.Create(internalAzureChatDataSourceConnectionStringAuthenticationOptions, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + public static explicit operator InternalAzureChatDataSourceConnectionStringAuthenticationOptions(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureChatDataSourceConnectionStringAuthenticationOptions(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs index 33a3b61f0..262ebfcb9 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs @@ -4,38 +4,24 @@ using System; using System.Collections.Generic; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// The AzureChatDataSourceConnectionStringAuthenticationOptions. internal partial class InternalAzureChatDataSourceConnectionStringAuthenticationOptions : DataSourceAuthentication { - /// Initializes a new instance of . - /// - /// is null. - public InternalAzureChatDataSourceConnectionStringAuthenticationOptions(string connectionString) + public InternalAzureChatDataSourceConnectionStringAuthenticationOptions(string connectionString) : base("connection_string") { Argument.AssertNotNull(connectionString, nameof(connectionString)); - Type = "connection_string"; ConnectionString = connectionString; } - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - internal InternalAzureChatDataSourceConnectionStringAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string connectionString) : base(type, serializedAdditionalRawData) + internal InternalAzureChatDataSourceConnectionStringAuthenticationOptions(string @type, IDictionary additionalBinaryDataProperties, string connectionString) : base(@type, additionalBinaryDataProperties) { ConnectionString = connectionString; } - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceConnectionStringAuthenticationOptions() - { - } - - /// Gets the connection string. internal string ConnectionString { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs index 99098670d..f23f38e47 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs @@ -7,11 +7,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalAzureChatDataSourceDeploymentNameVectorizationSource : IJsonModel { + internal InternalAzureChatDataSourceDeploymentNameVectorizationSource() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,89 +24,83 @@ void IJsonModel.Wr writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceDeploymentNameVectorizationSource)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (SerializedAdditionalRawData?.ContainsKey("deployment_name") != true) + if (_additionalBinaryDataProperties?.ContainsKey("deployment_name") != true) { writer.WritePropertyName("deployment_name"u8); writer.WriteStringValue(DeploymentName); } - if (SerializedAdditionalRawData?.ContainsKey("dimensions") != true && Optional.IsDefined(Dimensions)) + if (Optional.IsDefined(Dimensions) && _additionalBinaryDataProperties?.ContainsKey("dimensions") != true) { writer.WritePropertyName("dimensions"u8); writer.WriteNumberValue(Dimensions.Value); } } - InternalAzureChatDataSourceDeploymentNameVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureChatDataSourceDeploymentNameVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceDeploymentNameVectorizationSource)JsonModelCreateCore(ref reader, options); + + protected override DataSourceVectorizer JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceDeploymentNameVectorizationSource)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureChatDataSourceDeploymentNameVectorizationSource(document.RootElement, options); } - internal static InternalAzureChatDataSourceDeploymentNameVectorizationSource DeserializeInternalAzureChatDataSourceDeploymentNameVectorizationSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureChatDataSourceDeploymentNameVectorizationSource DeserializeInternalAzureChatDataSourceDeploymentNameVectorizationSource(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string @type = "deployment_name"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string deploymentName = default; int? dimensions = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("deployment_name"u8)) + if (prop.NameEquals("type"u8)) { - deploymentName = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("dimensions"u8)) + if (prop.NameEquals("deployment_name"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - dimensions = property.Value.GetInt32(); + deploymentName = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("dimensions"u8)) { - type = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dimensions = prop.Value.GetInt32(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceDeploymentNameVectorizationSource(type, serializedAdditionalRawData, deploymentName, dimensions); + return new InternalAzureChatDataSourceDeploymentNameVectorizationSource(@type, additionalBinaryDataProperties, deploymentName, dimensions); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -111,15 +110,16 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureChatDataSourceDeploymentNameVectorizationSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceDeploymentNameVectorizationSource)PersistableModelCreateCore(data, options); + protected override DataSourceVectorizer PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureChatDataSourceDeploymentNameVectorizationSource(document.RootElement, options); } default: @@ -129,18 +129,20 @@ InternalAzureChatDataSourceDeploymentNameVectorizationSource IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceDeploymentNameVectorizationSource FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureChatDataSourceDeploymentNameVectorizationSource internalAzureChatDataSourceDeploymentNameVectorizationSource) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceDeploymentNameVectorizationSource(document.RootElement); + if (internalAzureChatDataSourceDeploymentNameVectorizationSource == null) + { + return null; + } + return BinaryContent.Create(internalAzureChatDataSourceDeploymentNameVectorizationSource, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + public static explicit operator InternalAzureChatDataSourceDeploymentNameVectorizationSource(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureChatDataSourceDeploymentNameVectorizationSource(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs index f900a3451..501a7101c 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs @@ -4,61 +4,27 @@ using System; using System.Collections.Generic; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// - /// Represents a vectorization source that makes internal service calls against an Azure OpenAI embedding model - /// deployment. In contrast with the endpoint-based vectorization source, a deployment-name-based vectorization source - /// must be part of the same Azure OpenAI resource but can be used even in private networks. - /// internal partial class InternalAzureChatDataSourceDeploymentNameVectorizationSource : DataSourceVectorizer { - /// Initializes a new instance of . - /// - /// The embedding model deployment to use for vectorization. This deployment must exist within the same Azure OpenAI - /// resource as the model deployment being used for chat completions. - /// - /// is null. - public InternalAzureChatDataSourceDeploymentNameVectorizationSource(string deploymentName) + public InternalAzureChatDataSourceDeploymentNameVectorizationSource(string deploymentName) : base("deployment_name") { Argument.AssertNotNull(deploymentName, nameof(deploymentName)); - Type = "deployment_name"; DeploymentName = deploymentName; } - /// Initializes a new instance of . - /// The differentiating identifier for the concrete vectorization source. - /// Keeps track of any properties unknown to the library. - /// - /// The embedding model deployment to use for vectorization. This deployment must exist within the same Azure OpenAI - /// resource as the model deployment being used for chat completions. - /// - /// - /// The number of dimensions to request on embeddings. - /// Only supported in 'text-embedding-3' and later models. - /// - internal InternalAzureChatDataSourceDeploymentNameVectorizationSource(string type, IDictionary serializedAdditionalRawData, string deploymentName, int? dimensions) : base(type, serializedAdditionalRawData) + internal InternalAzureChatDataSourceDeploymentNameVectorizationSource(string @type, IDictionary additionalBinaryDataProperties, string deploymentName, int? dimensions) : base(@type, additionalBinaryDataProperties) { DeploymentName = deploymentName; Dimensions = dimensions; } - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceDeploymentNameVectorizationSource() - { - } - - /// - /// The embedding model deployment to use for vectorization. This deployment must exist within the same Azure OpenAI - /// resource as the model deployment being used for chat completions. - /// internal string DeploymentName { get; set; } - /// - /// The number of dimensions to request on embeddings. - /// Only supported in 'text-embedding-3' and later models. - /// + public int? Dimensions { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs index 2a8cc7bd3..a51f8c9f9 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs @@ -7,11 +7,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions : IJsonModel { + internal InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,74 +24,68 @@ void IJsonModel.W writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (SerializedAdditionalRawData?.ContainsKey("encoded_api_key") != true) + if (_additionalBinaryDataProperties?.ContainsKey("encoded_api_key") != true) { writer.WritePropertyName("encoded_api_key"u8); writer.WriteStringValue(EncodedApiKey); } } - InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions)JsonModelCreateCore(ref reader, options); + + protected override DataSourceAuthentication JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(document.RootElement, options); } - internal static InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions DeserializeInternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions DeserializeInternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string @type = "encoded_api_key"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string encodedApiKey = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("encoded_api_key"u8)) + if (prop.NameEquals("type"u8)) { - encodedApiKey = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("encoded_api_key"u8)) { - type = property.Value.GetString(); + encodedApiKey = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(type, serializedAdditionalRawData, encodedApiKey); + return new InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(@type, additionalBinaryDataProperties, encodedApiKey); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -96,15 +95,16 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions)PersistableModelCreateCore(data, options); + protected override DataSourceAuthentication PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(document.RootElement, options); } default: @@ -114,18 +114,20 @@ InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions IPersistableModel< string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions internalAzureChatDataSourceEncodedApiKeyAuthenticationOptions) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(document.RootElement); + if (internalAzureChatDataSourceEncodedApiKeyAuthenticationOptions == null) + { + return null; + } + return BinaryContent.Create(internalAzureChatDataSourceEncodedApiKeyAuthenticationOptions, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + public static explicit operator InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs index 19b3e45dd..026156e43 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs @@ -4,38 +4,24 @@ using System; using System.Collections.Generic; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// The AzureChatDataSourceEncodedApiKeyAuthenticationOptions. internal partial class InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions : DataSourceAuthentication { - /// Initializes a new instance of . - /// - /// is null. - public InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(string encodedApiKey) + public InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(string encodedApiKey) : base("encoded_api_key") { Argument.AssertNotNull(encodedApiKey, nameof(encodedApiKey)); - Type = "encoded_api_key"; EncodedApiKey = encodedApiKey; } - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - internal InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string encodedApiKey) : base(type, serializedAdditionalRawData) + internal InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(string @type, IDictionary additionalBinaryDataProperties, string encodedApiKey) : base(@type, additionalBinaryDataProperties) { EncodedApiKey = encodedApiKey; } - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions() - { - } - - /// Gets the encoded api key. internal string EncodedApiKey { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs index 85b3e5e7b..ebe91e98c 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs @@ -7,11 +7,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalAzureChatDataSourceEndpointVectorizationSource : IJsonModel { + internal InternalAzureChatDataSourceEndpointVectorizationSource() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,100 +24,94 @@ void IJsonModel.Write(Ut writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceEndpointVectorizationSource)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (SerializedAdditionalRawData?.ContainsKey("endpoint") != true) + if (_additionalBinaryDataProperties?.ContainsKey("endpoint") != true) { writer.WritePropertyName("endpoint"u8); writer.WriteStringValue(Endpoint.AbsoluteUri); } - if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) - { - writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); - } - if (SerializedAdditionalRawData?.ContainsKey("dimensions") != true && Optional.IsDefined(Dimensions)) + if (Optional.IsDefined(Dimensions) && _additionalBinaryDataProperties?.ContainsKey("dimensions") != true) { writer.WritePropertyName("dimensions"u8); writer.WriteNumberValue(Dimensions.Value); } + if (_additionalBinaryDataProperties?.ContainsKey("authentication") != true) + { + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + } } - InternalAzureChatDataSourceEndpointVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureChatDataSourceEndpointVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceEndpointVectorizationSource)JsonModelCreateCore(ref reader, options); + + protected override DataSourceVectorizer JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceEndpointVectorizationSource)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureChatDataSourceEndpointVectorizationSource(document.RootElement, options); } - internal static InternalAzureChatDataSourceEndpointVectorizationSource DeserializeInternalAzureChatDataSourceEndpointVectorizationSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureChatDataSourceEndpointVectorizationSource DeserializeInternalAzureChatDataSourceEndpointVectorizationSource(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string @type = "endpoint"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); Uri endpoint = default; - DataSourceAuthentication authentication = default; int? dimensions = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + DataSourceAuthentication authentication = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("endpoint"u8)) + if (prop.NameEquals("type"u8)) { - endpoint = new Uri(property.Value.GetString()); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("authentication"u8)) + if (prop.NameEquals("endpoint"u8)) { - authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(property.Value, options); + endpoint = new Uri(prop.Value.GetString()); continue; } - if (property.NameEquals("dimensions"u8)) + if (prop.NameEquals("dimensions"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - dimensions = property.Value.GetInt32(); + dimensions = prop.Value.GetInt32(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("authentication"u8)) { - type = property.Value.GetString(); + authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceEndpointVectorizationSource(type, serializedAdditionalRawData, endpoint, authentication, dimensions); + return new InternalAzureChatDataSourceEndpointVectorizationSource(@type, additionalBinaryDataProperties, endpoint, dimensions, authentication); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -122,15 +121,16 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureChatDataSourceEndpointVectorizationSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceEndpointVectorizationSource)PersistableModelCreateCore(data, options); + protected override DataSourceVectorizer PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureChatDataSourceEndpointVectorizationSource(document.RootElement, options); } default: @@ -140,18 +140,20 @@ InternalAzureChatDataSourceEndpointVectorizationSource IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceEndpointVectorizationSource FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureChatDataSourceEndpointVectorizationSource internalAzureChatDataSourceEndpointVectorizationSource) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceEndpointVectorizationSource(document.RootElement); + if (internalAzureChatDataSourceEndpointVectorizationSource == null) + { + return null; + } + return BinaryContent.Create(internalAzureChatDataSourceEndpointVectorizationSource, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + public static explicit operator InternalAzureChatDataSourceEndpointVectorizationSource(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureChatDataSourceEndpointVectorizationSource(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.cs index c66ca6f73..652e67943 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.cs @@ -4,76 +4,30 @@ using System; using System.Collections.Generic; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// Represents a vectorization source that makes public service calls against an Azure OpenAI embedding model deployment. internal partial class InternalAzureChatDataSourceEndpointVectorizationSource : DataSourceVectorizer { - /// Initializes a new instance of . - /// - /// Specifies the resource endpoint URL from which embeddings should be retrieved. - /// It should be in the format of: - /// https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings. - /// The api-version query parameter is not allowed. - /// - /// - /// The authentication mechanism to use with the endpoint-based vectorization source. - /// Endpoint authentication supports API key and access token mechanisms. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// or is null. - public InternalAzureChatDataSourceEndpointVectorizationSource(Uri endpoint, DataSourceAuthentication authentication) + public InternalAzureChatDataSourceEndpointVectorizationSource(Uri endpoint, DataSourceAuthentication authentication) : base("endpoint") { Argument.AssertNotNull(endpoint, nameof(endpoint)); Argument.AssertNotNull(authentication, nameof(authentication)); - Type = "endpoint"; Endpoint = endpoint; Authentication = authentication; } - /// Initializes a new instance of . - /// The differentiating identifier for the concrete vectorization source. - /// Keeps track of any properties unknown to the library. - /// - /// Specifies the resource endpoint URL from which embeddings should be retrieved. - /// It should be in the format of: - /// https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings. - /// The api-version query parameter is not allowed. - /// - /// - /// The authentication mechanism to use with the endpoint-based vectorization source. - /// Endpoint authentication supports API key and access token mechanisms. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// The number of dimensions to request on embeddings. - /// Only supported in 'text-embedding-3' and later models. - /// - internal InternalAzureChatDataSourceEndpointVectorizationSource(string type, IDictionary serializedAdditionalRawData, Uri endpoint, DataSourceAuthentication authentication, int? dimensions) : base(type, serializedAdditionalRawData) + internal InternalAzureChatDataSourceEndpointVectorizationSource(string @type, IDictionary additionalBinaryDataProperties, Uri endpoint, int? dimensions, DataSourceAuthentication authentication) : base(@type, additionalBinaryDataProperties) { Endpoint = endpoint; - Authentication = authentication; Dimensions = dimensions; + Authentication = authentication; } - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceEndpointVectorizationSource() - { - } - - /// - /// Specifies the resource endpoint URL from which embeddings should be retrieved. - /// It should be in the format of: - /// https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings. - /// The api-version query parameter is not allowed. - /// internal Uri Endpoint { get; set; } - /// - /// The number of dimensions to request on embeddings. - /// Only supported in 'text-embedding-3' and later models. - /// + public int? Dimensions { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs index 6862500ff..4064a304e 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs @@ -7,6 +7,7 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { @@ -19,63 +20,57 @@ void IJsonModel.Write( writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceIntegratedVectorizationSource)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - InternalAzureChatDataSourceIntegratedVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureChatDataSourceIntegratedVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceIntegratedVectorizationSource)JsonModelCreateCore(ref reader, options); + + protected override DataSourceVectorizer JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceIntegratedVectorizationSource)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureChatDataSourceIntegratedVectorizationSource(document.RootElement, options); } - internal static InternalAzureChatDataSourceIntegratedVectorizationSource DeserializeInternalAzureChatDataSourceIntegratedVectorizationSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureChatDataSourceIntegratedVectorizationSource DeserializeInternalAzureChatDataSourceIntegratedVectorizationSource(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string @type = "integrated"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceIntegratedVectorizationSource(type, serializedAdditionalRawData); + return new InternalAzureChatDataSourceIntegratedVectorizationSource(@type, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -85,15 +80,16 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureChatDataSourceIntegratedVectorizationSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceIntegratedVectorizationSource)PersistableModelCreateCore(data, options); + protected override DataSourceVectorizer PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureChatDataSourceIntegratedVectorizationSource(document.RootElement, options); } default: @@ -103,18 +99,20 @@ InternalAzureChatDataSourceIntegratedVectorizationSource IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceIntegratedVectorizationSource FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureChatDataSourceIntegratedVectorizationSource internalAzureChatDataSourceIntegratedVectorizationSource) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceIntegratedVectorizationSource(document.RootElement); + if (internalAzureChatDataSourceIntegratedVectorizationSource == null) + { + return null; + } + return BinaryContent.Create(internalAzureChatDataSourceIntegratedVectorizationSource, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + public static explicit operator InternalAzureChatDataSourceIntegratedVectorizationSource(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureChatDataSourceIntegratedVectorizationSource(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.cs index d72e6eda8..b1a7e7e61 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.cs @@ -7,19 +7,13 @@ namespace Azure.AI.OpenAI.Chat { - /// Represents an integrated vectorization source as defined within the supporting search resource. internal partial class InternalAzureChatDataSourceIntegratedVectorizationSource : DataSourceVectorizer { - /// Initializes a new instance of . - public InternalAzureChatDataSourceIntegratedVectorizationSource() + public InternalAzureChatDataSourceIntegratedVectorizationSource() : base("integrated") { - Type = "integrated"; } - /// Initializes a new instance of . - /// The differentiating identifier for the concrete vectorization source. - /// Keeps track of any properties unknown to the library. - internal InternalAzureChatDataSourceIntegratedVectorizationSource(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + internal InternalAzureChatDataSourceIntegratedVectorizationSource(string @type, IDictionary additionalBinaryDataProperties) : base(@type, additionalBinaryDataProperties) { } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs index f632ed00b..b5754f58c 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs @@ -7,11 +7,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions : IJsonModel { + internal InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,85 +24,79 @@ void IJsonModel.Wri writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (SerializedAdditionalRawData?.ContainsKey("key") != true) + if (_additionalBinaryDataProperties?.ContainsKey("key") != true) { writer.WritePropertyName("key"u8); writer.WriteStringValue(Key); } - if (SerializedAdditionalRawData?.ContainsKey("key_id") != true) + if (_additionalBinaryDataProperties?.ContainsKey("key_id") != true) { writer.WritePropertyName("key_id"u8); writer.WriteStringValue(KeyId); } } - InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions)JsonModelCreateCore(ref reader, options); + + protected override DataSourceAuthentication JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(document.RootElement, options); } - internal static InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions DeserializeInternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions DeserializeInternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string @type = "key_and_key_id"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string key = default; string keyId = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("key"u8)) + if (prop.NameEquals("type"u8)) { - key = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("key_id"u8)) + if (prop.NameEquals("key"u8)) { - keyId = property.Value.GetString(); + key = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("key_id"u8)) { - type = property.Value.GetString(); + keyId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(type, serializedAdditionalRawData, key, keyId); + return new InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(@type, additionalBinaryDataProperties, key, keyId); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -107,15 +106,16 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions)PersistableModelCreateCore(data, options); + protected override DataSourceAuthentication PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(document.RootElement, options); } default: @@ -125,18 +125,20 @@ InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions internalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(document.RootElement); + if (internalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions == null) + { + return null; + } + return BinaryContent.Create(internalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + public static explicit operator InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs index c25b1144c..8cf84e008 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs @@ -4,45 +4,29 @@ using System; using System.Collections.Generic; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// The AzureChatDataSourceKeyAndKeyIdAuthenticationOptions. internal partial class InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions : DataSourceAuthentication { - /// Initializes a new instance of . - /// - /// - /// or is null. - public InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(string key, string keyId) + public InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(string key, string keyId) : base("key_and_key_id") { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(keyId, nameof(keyId)); - Type = "key_and_key_id"; Key = key; KeyId = keyId; } - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - /// - internal InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string key, string keyId) : base(type, serializedAdditionalRawData) + internal InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(string @type, IDictionary additionalBinaryDataProperties, string key, string keyId) : base(@type, additionalBinaryDataProperties) { Key = key; KeyId = keyId; } - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions() - { - } - - /// Gets the key. internal string Key { get; set; } - /// Gets the key id. + internal string KeyId { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs index 740899e3c..5e19ad8de 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs @@ -7,11 +7,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalAzureChatDataSourceModelIdVectorizationSource : IJsonModel { + internal InternalAzureChatDataSourceModelIdVectorizationSource() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,74 +24,68 @@ void IJsonModel.Write(Utf writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceModelIdVectorizationSource)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (SerializedAdditionalRawData?.ContainsKey("model_id") != true) + if (_additionalBinaryDataProperties?.ContainsKey("model_id") != true) { writer.WritePropertyName("model_id"u8); writer.WriteStringValue(ModelId); } } - InternalAzureChatDataSourceModelIdVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureChatDataSourceModelIdVectorizationSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceModelIdVectorizationSource)JsonModelCreateCore(ref reader, options); + + protected override DataSourceVectorizer JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceModelIdVectorizationSource)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureChatDataSourceModelIdVectorizationSource(document.RootElement, options); } - internal static InternalAzureChatDataSourceModelIdVectorizationSource DeserializeInternalAzureChatDataSourceModelIdVectorizationSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureChatDataSourceModelIdVectorizationSource DeserializeInternalAzureChatDataSourceModelIdVectorizationSource(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string @type = "model_id"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string modelId = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("model_id"u8)) + if (prop.NameEquals("type"u8)) { - modelId = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("model_id"u8)) { - type = property.Value.GetString(); + modelId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceModelIdVectorizationSource(type, serializedAdditionalRawData, modelId); + return new InternalAzureChatDataSourceModelIdVectorizationSource(@type, additionalBinaryDataProperties, modelId); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -96,15 +95,16 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureChatDataSourceModelIdVectorizationSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceModelIdVectorizationSource)PersistableModelCreateCore(data, options); + protected override DataSourceVectorizer PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureChatDataSourceModelIdVectorizationSource(document.RootElement, options); } default: @@ -114,18 +114,20 @@ InternalAzureChatDataSourceModelIdVectorizationSource IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceModelIdVectorizationSource FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureChatDataSourceModelIdVectorizationSource internalAzureChatDataSourceModelIdVectorizationSource) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceModelIdVectorizationSource(document.RootElement); + if (internalAzureChatDataSourceModelIdVectorizationSource == null) + { + return null; + } + return BinaryContent.Create(internalAzureChatDataSourceModelIdVectorizationSource, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + public static explicit operator InternalAzureChatDataSourceModelIdVectorizationSource(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureChatDataSourceModelIdVectorizationSource(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.cs index cfc74a0b9..a0767cfd2 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.cs @@ -4,41 +4,24 @@ using System; using System.Collections.Generic; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// - /// Represents a vectorization source that makes service calls based on a search service model ID. - /// This source type is currently only supported by Elasticsearch. - /// internal partial class InternalAzureChatDataSourceModelIdVectorizationSource : DataSourceVectorizer { - /// Initializes a new instance of . - /// The embedding model build ID to use for vectorization. - /// is null. - public InternalAzureChatDataSourceModelIdVectorizationSource(string modelId) + public InternalAzureChatDataSourceModelIdVectorizationSource(string modelId) : base("model_id") { Argument.AssertNotNull(modelId, nameof(modelId)); - Type = "model_id"; ModelId = modelId; } - /// Initializes a new instance of . - /// The differentiating identifier for the concrete vectorization source. - /// Keeps track of any properties unknown to the library. - /// The embedding model build ID to use for vectorization. - internal InternalAzureChatDataSourceModelIdVectorizationSource(string type, IDictionary serializedAdditionalRawData, string modelId) : base(type, serializedAdditionalRawData) + internal InternalAzureChatDataSourceModelIdVectorizationSource(string @type, IDictionary additionalBinaryDataProperties, string modelId) : base(@type, additionalBinaryDataProperties) { ModelId = modelId; } - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceModelIdVectorizationSource() - { - } - - /// The embedding model build ID to use for vectorization. internal string ModelId { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs index 58c3fbc4f..4bb24ad42 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs @@ -7,6 +7,7 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { @@ -19,63 +20,57 @@ void IJsonModel The JSON writer. - /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions)JsonModelCreateCore(ref reader, options); + + protected override DataSourceAuthentication JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(document.RootElement, options); } - internal static InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions DeserializeInternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions DeserializeInternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string @type = "system_assigned_managed_identity"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(type, serializedAdditionalRawData); + return new InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(@type, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -85,15 +80,16 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions)PersistableModelCreateCore(data, options); + protected override DataSourceAuthentication PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(document.RootElement, options); } default: @@ -103,18 +99,20 @@ InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions IP string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions internalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(document.RootElement); + if (internalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions == null) + { + return null; + } + return BinaryContent.Create(internalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + public static explicit operator InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs index c895b5b4f..2e6ddffbb 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs @@ -7,19 +7,13 @@ namespace Azure.AI.OpenAI.Chat { - /// The AzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions. internal partial class InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions : DataSourceAuthentication { - /// Initializes a new instance of . - public InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions() + public InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions() : base("system_assigned_managed_identity") { - Type = "system_assigned_managed_identity"; } - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + internal InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(string @type, IDictionary additionalBinaryDataProperties) : base(@type, additionalBinaryDataProperties) { } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs index 49a3ef963..d34ec6de6 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs @@ -7,11 +7,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions : IJsonModel { + internal InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,74 +24,68 @@ void IJsonModel The JSON writer. - /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (SerializedAdditionalRawData?.ContainsKey("managed_identity_resource_id") != true) + if (_additionalBinaryDataProperties?.ContainsKey("managed_identity_resource_id") != true) { writer.WritePropertyName("managed_identity_resource_id"u8); writer.WriteStringValue(ManagedIdentityResourceId); } } - InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions)JsonModelCreateCore(ref reader, options); + + protected override DataSourceAuthentication JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(document.RootElement, options); } - internal static InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions DeserializeInternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions DeserializeInternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string @type = "user_assigned_managed_identity"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string managedIdentityResourceId = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("managed_identity_resource_id"u8)) + if (prop.NameEquals("type"u8)) { - managedIdentityResourceId = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("managed_identity_resource_id"u8)) { - type = property.Value.GetString(); + managedIdentityResourceId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(type, serializedAdditionalRawData, managedIdentityResourceId); + return new InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(@type, additionalBinaryDataProperties, managedIdentityResourceId); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -96,15 +95,16 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions)PersistableModelCreateCore(data, options); + protected override DataSourceAuthentication PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(document.RootElement, options); } default: @@ -114,18 +114,20 @@ InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions IPer string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions internalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(document.RootElement); + if (internalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions == null) + { + return null; + } + return BinaryContent.Create(internalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + public static explicit operator InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs index 041e0145d..3b3085dca 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs @@ -4,38 +4,24 @@ using System; using System.Collections.Generic; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// The AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions. internal partial class InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions : DataSourceAuthentication { - /// Initializes a new instance of . - /// - /// is null. - public InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(string managedIdentityResourceId) + public InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(string managedIdentityResourceId) : base("user_assigned_managed_identity") { Argument.AssertNotNull(managedIdentityResourceId, nameof(managedIdentityResourceId)); - Type = "user_assigned_managed_identity"; ManagedIdentityResourceId = managedIdentityResourceId; } - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - internal InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string managedIdentityResourceId) : base(type, serializedAdditionalRawData) + internal InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(string @type, IDictionary additionalBinaryDataProperties, string managedIdentityResourceId) : base(@type, additionalBinaryDataProperties) { ManagedIdentityResourceId = managedIdentityResourceId; } - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions() - { - } - - /// Gets the managed identity resource id. internal string ManagedIdentityResourceId { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs index 8042b13b3..c9ceed3e6 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs @@ -7,11 +7,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions : IJsonModel { + internal InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,85 +24,79 @@ void IJsonModel The JSON writer. - /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (SerializedAdditionalRawData?.ContainsKey("username") != true) + if (_additionalBinaryDataProperties?.ContainsKey("username") != true) { writer.WritePropertyName("username"u8); writer.WriteStringValue(Username); } - if (SerializedAdditionalRawData?.ContainsKey("password") != true) + if (_additionalBinaryDataProperties?.ContainsKey("password") != true) { writer.WritePropertyName("password"u8); writer.WriteStringValue(Password); } } - InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions)JsonModelCreateCore(ref reader, options); + + protected override DataSourceAuthentication JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(document.RootElement, options); } - internal static InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions DeserializeInternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions DeserializeInternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string @type = "username_and_password"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); string username = default; string password = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("username"u8)) + if (prop.NameEquals("type"u8)) { - username = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("password"u8)) + if (prop.NameEquals("username"u8)) { - password = property.Value.GetString(); + username = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("password"u8)) { - type = property.Value.GetString(); + password = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(type, serializedAdditionalRawData, username, password); + return new InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(@type, additionalBinaryDataProperties, username, password); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -107,15 +106,16 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions)PersistableModelCreateCore(data, options); + protected override DataSourceAuthentication PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(document.RootElement, options); } default: @@ -125,18 +125,20 @@ InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions IPersistable string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions internalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(document.RootElement); + if (internalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions == null) + { + return null; + } + return BinaryContent.Create(internalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + public static explicit operator InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs index 2c5af490f..993e8897b 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs @@ -4,45 +4,29 @@ using System; using System.Collections.Generic; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// The AzureChatDataSourceUsernameAndPasswordAuthenticationOptions. internal partial class InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions : DataSourceAuthentication { - /// Initializes a new instance of . - /// - /// - /// or is null. - public InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(string username, string password) + public InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(string username, string password) : base("username_and_password") { Argument.AssertNotNull(username, nameof(username)); Argument.AssertNotNull(password, nameof(password)); - Type = "username_and_password"; Username = username; Password = password; } - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - /// - internal InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string username, string password) : base(type, serializedAdditionalRawData) + internal InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(string @type, IDictionary additionalBinaryDataProperties, string username, string password) : base(@type, additionalBinaryDataProperties) { Username = username; Password = password; } - /// Initializes a new instance of for deserialization. - internal InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions() - { - } - - /// Gets the username. internal string Username { get; set; } - /// Gets the password. + internal string Password { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs index 62c1baf6d..d57188f99 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs @@ -12,6 +12,10 @@ namespace Azure.AI.OpenAI { internal partial class InternalAzureContentFilterBlocklistIdResult : IJsonModel { + internal InternalAzureContentFilterBlocklistIdResult() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,29 +23,26 @@ void IJsonModel.Write(Utf8JsonWrite writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureContentFilterBlocklistIdResult)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("id") != true) + if (_additionalBinaryDataProperties?.ContainsKey("id") != true) { writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); } - if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) + if (_additionalBinaryDataProperties?.ContainsKey("filtered") != true) { writer.WritePropertyName("filtered"u8); writer.WriteBooleanValue(Filtered); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -49,7 +50,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -60,56 +61,53 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - InternalAzureContentFilterBlocklistIdResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureContentFilterBlocklistIdResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected virtual InternalAzureContentFilterBlocklistIdResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureContentFilterBlocklistIdResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureContentFilterBlocklistIdResult(document.RootElement, options); } - internal static InternalAzureContentFilterBlocklistIdResult DeserializeInternalAzureContentFilterBlocklistIdResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureContentFilterBlocklistIdResult DeserializeInternalAzureContentFilterBlocklistIdResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string id = default; bool filtered = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("filtered"u8)) + if (prop.NameEquals("filtered"u8)) { - filtered = property.Value.GetBoolean(); + filtered = prop.Value.GetBoolean(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureContentFilterBlocklistIdResult(id, filtered, serializedAdditionalRawData); + return new InternalAzureContentFilterBlocklistIdResult(id, filtered, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +117,16 @@ BinaryData IPersistableModel.Write( } } - InternalAzureContentFilterBlocklistIdResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureContentFilterBlocklistIdResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected virtual InternalAzureContentFilterBlocklistIdResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureContentFilterBlocklistIdResult(document.RootElement, options); } default: @@ -137,18 +136,20 @@ InternalAzureContentFilterBlocklistIdResult IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalAzureContentFilterBlocklistIdResult FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureContentFilterBlocklistIdResult internalAzureContentFilterBlocklistIdResult) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureContentFilterBlocklistIdResult(document.RootElement); + if (internalAzureContentFilterBlocklistIdResult == null) + { + return null; + } + return BinaryContent.Create(internalAzureContentFilterBlocklistIdResult, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + public static explicit operator InternalAzureContentFilterBlocklistIdResult(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureContentFilterBlocklistIdResult(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs index 6a0b6cacc..43d5826e5 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs @@ -7,74 +7,32 @@ namespace Azure.AI.OpenAI { - /// - /// A content filter result item that associates an existing custom blocklist ID with a value indicating whether or not - /// the corresponding blocklist resulted in content being filtered. - /// internal partial class InternalAzureContentFilterBlocklistIdResult { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// The ID of the custom blocklist associated with the filtered status. - /// Whether the associated blocklist resulted in the content being filtered. - /// is null. + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal InternalAzureContentFilterBlocklistIdResult(string id, bool filtered) { - Argument.AssertNotNull(id, nameof(id)); - Id = id; Filtered = filtered; } - /// Initializes a new instance of . - /// The ID of the custom blocklist associated with the filtered status. - /// Whether the associated blocklist resulted in the content being filtered. - /// Keeps track of any properties unknown to the library. - internal InternalAzureContentFilterBlocklistIdResult(string id, bool filtered, IDictionary serializedAdditionalRawData) + internal InternalAzureContentFilterBlocklistIdResult(string id, bool filtered, IDictionary additionalBinaryDataProperties) { Id = id; Filtered = filtered; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureContentFilterBlocklistIdResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// The ID of the custom blocklist associated with the filtered status. internal string Id { get; set; } - /// Whether the associated blocklist resulted in the content being filtered. + internal bool Filtered { get; set; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs index 152fb6ead..21bd3141d 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs @@ -12,6 +12,10 @@ namespace Azure.AI.OpenAI { internal partial class InternalAzureContentFilterBlocklistResultDetail : IJsonModel { + internal InternalAzureContentFilterBlocklistResultDetail() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,29 +23,26 @@ void IJsonModel.Write(Utf8JsonW writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureContentFilterBlocklistResultDetail)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) + if (_additionalBinaryDataProperties?.ContainsKey("filtered") != true) { writer.WritePropertyName("filtered"u8); writer.WriteBooleanValue(Filtered); } - if (SerializedAdditionalRawData?.ContainsKey("id") != true) + if (_additionalBinaryDataProperties?.ContainsKey("id") != true) { writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -49,7 +50,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -60,56 +61,53 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - InternalAzureContentFilterBlocklistResultDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureContentFilterBlocklistResultDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected virtual InternalAzureContentFilterBlocklistResultDetail JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureContentFilterBlocklistResultDetail)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureContentFilterBlocklistResultDetail(document.RootElement, options); } - internal static InternalAzureContentFilterBlocklistResultDetail DeserializeInternalAzureContentFilterBlocklistResultDetail(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureContentFilterBlocklistResultDetail DeserializeInternalAzureContentFilterBlocklistResultDetail(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } bool filtered = default; string id = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("filtered"u8)) + if (prop.NameEquals("filtered"u8)) { - filtered = property.Value.GetBoolean(); + filtered = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureContentFilterBlocklistResultDetail(filtered, id, serializedAdditionalRawData); + return new InternalAzureContentFilterBlocklistResultDetail(filtered, id, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +117,16 @@ BinaryData IPersistableModel.Wr } } - InternalAzureContentFilterBlocklistResultDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureContentFilterBlocklistResultDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected virtual InternalAzureContentFilterBlocklistResultDetail PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureContentFilterBlocklistResultDetail(document.RootElement, options); } default: @@ -137,18 +136,20 @@ InternalAzureContentFilterBlocklistResultDetail IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalAzureContentFilterBlocklistResultDetail FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureContentFilterBlocklistResultDetail internalAzureContentFilterBlocklistResultDetail) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureContentFilterBlocklistResultDetail(document.RootElement); + if (internalAzureContentFilterBlocklistResultDetail == null) + { + return null; + } + return BinaryContent.Create(internalAzureContentFilterBlocklistResultDetail, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + public static explicit operator InternalAzureContentFilterBlocklistResultDetail(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureContentFilterBlocklistResultDetail(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs index 57e5e5ea6..8564be4d9 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs @@ -7,71 +7,32 @@ namespace Azure.AI.OpenAI { - /// The AzureContentFilterBlocklistResultDetail. internal partial class InternalAzureContentFilterBlocklistResultDetail { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// A value indicating whether the blocklist produced a filtering action. - /// The ID of the custom blocklist evaluated. - /// is null. + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal InternalAzureContentFilterBlocklistResultDetail(bool filtered, string id) { - Argument.AssertNotNull(id, nameof(id)); - Filtered = filtered; Id = id; } - /// Initializes a new instance of . - /// A value indicating whether the blocklist produced a filtering action. - /// The ID of the custom blocklist evaluated. - /// Keeps track of any properties unknown to the library. - internal InternalAzureContentFilterBlocklistResultDetail(bool filtered, string id, IDictionary serializedAdditionalRawData) + internal InternalAzureContentFilterBlocklistResultDetail(bool filtered, string id, IDictionary additionalBinaryDataProperties) { Filtered = filtered; Id = id; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureContentFilterBlocklistResultDetail() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// A value indicating whether the blocklist produced a filtering action. internal bool Filtered { get; set; } - /// The ID of the custom blocklist evaluated. + internal string Id { get; set; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForChoiceError.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForChoiceError.Serialization.cs index 3577b2606..4abb04256 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForChoiceError.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForChoiceError.Serialization.cs @@ -12,6 +12,10 @@ namespace Azure.AI.OpenAI { internal partial class InternalAzureContentFilterResultForChoiceError : IJsonModel { + internal InternalAzureContentFilterResultForChoiceError() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,29 +23,26 @@ void IJsonModel.Write(Utf8JsonWr writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureContentFilterResultForChoiceError)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("code") != true) + if (_additionalBinaryDataProperties?.ContainsKey("code") != true) { writer.WritePropertyName("code"u8); writer.WriteNumberValue(Code); } - if (SerializedAdditionalRawData?.ContainsKey("message") != true) + if (_additionalBinaryDataProperties?.ContainsKey("message") != true) { writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -49,7 +50,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -60,56 +61,53 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - InternalAzureContentFilterResultForChoiceError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureContentFilterResultForChoiceError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected virtual InternalAzureContentFilterResultForChoiceError JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureContentFilterResultForChoiceError)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureContentFilterResultForChoiceError(document.RootElement, options); } - internal static InternalAzureContentFilterResultForChoiceError DeserializeInternalAzureContentFilterResultForChoiceError(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureContentFilterResultForChoiceError DeserializeInternalAzureContentFilterResultForChoiceError(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } int code = default; string message = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("code"u8)) + if (prop.NameEquals("code"u8)) { - code = property.Value.GetInt32(); + code = prop.Value.GetInt32(); continue; } - if (property.NameEquals("message"u8)) + if (prop.NameEquals("message"u8)) { - message = property.Value.GetString(); + message = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureContentFilterResultForChoiceError(code, message, serializedAdditionalRawData); + return new InternalAzureContentFilterResultForChoiceError(code, message, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +117,16 @@ BinaryData IPersistableModel.Wri } } - InternalAzureContentFilterResultForChoiceError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureContentFilterResultForChoiceError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected virtual InternalAzureContentFilterResultForChoiceError PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureContentFilterResultForChoiceError(document.RootElement, options); } default: @@ -137,18 +136,20 @@ InternalAzureContentFilterResultForChoiceError IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalAzureContentFilterResultForChoiceError FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureContentFilterResultForChoiceError internalAzureContentFilterResultForChoiceError) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureContentFilterResultForChoiceError(document.RootElement); + if (internalAzureContentFilterResultForChoiceError == null) + { + return null; + } + return BinaryContent.Create(internalAzureContentFilterResultForChoiceError, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + public static explicit operator InternalAzureContentFilterResultForChoiceError(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureContentFilterResultForChoiceError(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForChoiceError.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForChoiceError.cs index a31195cb6..77673df0c 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForChoiceError.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForChoiceError.cs @@ -7,71 +7,32 @@ namespace Azure.AI.OpenAI { - /// The AzureContentFilterResultForChoiceError. internal partial class InternalAzureContentFilterResultForChoiceError { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// A distinct, machine-readable code associated with the error. - /// A human-readable message associated with the error. - /// is null. + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal InternalAzureContentFilterResultForChoiceError(int code, string message) { - Argument.AssertNotNull(message, nameof(message)); - Code = code; Message = message; } - /// Initializes a new instance of . - /// A distinct, machine-readable code associated with the error. - /// A human-readable message associated with the error. - /// Keeps track of any properties unknown to the library. - internal InternalAzureContentFilterResultForChoiceError(int code, string message, IDictionary serializedAdditionalRawData) + internal InternalAzureContentFilterResultForChoiceError(int code, string message, IDictionary additionalBinaryDataProperties) { Code = code; Message = message; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureContentFilterResultForChoiceError() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// A distinct, machine-readable code associated with the error. internal int Code { get; set; } - /// A human-readable message associated with the error. + internal string Message { get; set; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs index c1e393eac..2a95abe6d 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs @@ -12,6 +12,10 @@ namespace Azure.AI.OpenAI { internal partial class InternalAzureContentFilterResultForPromptContentFilterResults : IJsonModel { + internal InternalAzureContentFilterResultForPromptContentFilterResults() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,64 +23,61 @@ void IJsonModel.W writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureContentFilterResultForPromptContentFilterResults)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("sexual") != true && Optional.IsDefined(Sexual)) + if (Optional.IsDefined(Sexual) && _additionalBinaryDataProperties?.ContainsKey("sexual") != true) { writer.WritePropertyName("sexual"u8); writer.WriteObjectValue(Sexual, options); } - if (SerializedAdditionalRawData?.ContainsKey("hate") != true && Optional.IsDefined(Hate)) + if (Optional.IsDefined(Hate) && _additionalBinaryDataProperties?.ContainsKey("hate") != true) { writer.WritePropertyName("hate"u8); writer.WriteObjectValue(Hate, options); } - if (SerializedAdditionalRawData?.ContainsKey("violence") != true && Optional.IsDefined(Violence)) + if (Optional.IsDefined(Violence) && _additionalBinaryDataProperties?.ContainsKey("violence") != true) { writer.WritePropertyName("violence"u8); writer.WriteObjectValue(Violence, options); } - if (SerializedAdditionalRawData?.ContainsKey("self_harm") != true && Optional.IsDefined(SelfHarm)) + if (Optional.IsDefined(SelfHarm) && _additionalBinaryDataProperties?.ContainsKey("self_harm") != true) { writer.WritePropertyName("self_harm"u8); writer.WriteObjectValue(SelfHarm, options); } - if (SerializedAdditionalRawData?.ContainsKey("profanity") != true && Optional.IsDefined(Profanity)) + if (Optional.IsDefined(Profanity) && _additionalBinaryDataProperties?.ContainsKey("profanity") != true) { writer.WritePropertyName("profanity"u8); writer.WriteObjectValue(Profanity, options); } - if (SerializedAdditionalRawData?.ContainsKey("custom_blocklists") != true && Optional.IsDefined(CustomBlocklists)) + if (Optional.IsDefined(CustomBlocklists) && _additionalBinaryDataProperties?.ContainsKey("custom_blocklists") != true) { writer.WritePropertyName("custom_blocklists"u8); writer.WriteObjectValue(CustomBlocklists, options); } - if (SerializedAdditionalRawData?.ContainsKey("error") != true && Optional.IsDefined(Error)) + if (Optional.IsDefined(Error) && _additionalBinaryDataProperties?.ContainsKey("error") != true) { writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); } - if (SerializedAdditionalRawData?.ContainsKey("jailbreak") != true) + if (_additionalBinaryDataProperties?.ContainsKey("jailbreak") != true) { writer.WritePropertyName("jailbreak"u8); writer.WriteObjectValue(Jailbreak, options); } - if (SerializedAdditionalRawData?.ContainsKey("indirect_attack") != true) + if (_additionalBinaryDataProperties?.ContainsKey("indirect_attack") != true) { writer.WritePropertyName("indirect_attack"u8); writer.WriteObjectValue(IndirectAttack, options); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -84,7 +85,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -95,22 +96,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - InternalAzureContentFilterResultForPromptContentFilterResults IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureContentFilterResultForPromptContentFilterResults IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected virtual InternalAzureContentFilterResultForPromptContentFilterResults JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureContentFilterResultForPromptContentFilterResults)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureContentFilterResultForPromptContentFilterResults(document.RootElement, options); } - internal static InternalAzureContentFilterResultForPromptContentFilterResults DeserializeInternalAzureContentFilterResultForPromptContentFilterResults(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureContentFilterResultForPromptContentFilterResults DeserializeInternalAzureContentFilterResultForPromptContentFilterResults(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -124,90 +124,87 @@ internal static InternalAzureContentFilterResultForPromptContentFilterResults De InternalAzureContentFilterResultForChoiceError error = default; ContentFilterDetectionResult jailbreak = default; ContentFilterDetectionResult indirectAttack = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("sexual"u8)) + if (prop.NameEquals("sexual"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - sexual = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + sexual = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(prop.Value, options); continue; } - if (property.NameEquals("hate"u8)) + if (prop.NameEquals("hate"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - hate = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + hate = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(prop.Value, options); continue; } - if (property.NameEquals("violence"u8)) + if (prop.NameEquals("violence"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - violence = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + violence = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(prop.Value, options); continue; } - if (property.NameEquals("self_harm"u8)) + if (prop.NameEquals("self_harm"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - selfHarm = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + selfHarm = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(prop.Value, options); continue; } - if (property.NameEquals("profanity"u8)) + if (prop.NameEquals("profanity"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - profanity = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(property.Value, options); + profanity = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(prop.Value, options); continue; } - if (property.NameEquals("custom_blocklists"u8)) + if (prop.NameEquals("custom_blocklists"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - customBlocklists = ContentFilterBlocklistResult.DeserializeContentFilterBlocklistResult(property.Value, options); + customBlocklists = ContentFilterBlocklistResult.DeserializeContentFilterBlocklistResult(prop.Value, options); continue; } - if (property.NameEquals("error"u8)) + if (prop.NameEquals("error"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - error = InternalAzureContentFilterResultForChoiceError.DeserializeInternalAzureContentFilterResultForChoiceError(property.Value, options); + error = InternalAzureContentFilterResultForChoiceError.DeserializeInternalAzureContentFilterResultForChoiceError(prop.Value, options); continue; } - if (property.NameEquals("jailbreak"u8)) + if (prop.NameEquals("jailbreak"u8)) { - jailbreak = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(property.Value, options); + jailbreak = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(prop.Value, options); continue; } - if (property.NameEquals("indirect_attack"u8)) + if (prop.NameEquals("indirect_attack"u8)) { - indirectAttack = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(property.Value, options); + indirectAttack = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new InternalAzureContentFilterResultForPromptContentFilterResults( sexual, hate, @@ -218,13 +215,14 @@ internal static InternalAzureContentFilterResultForPromptContentFilterResults De error, jailbreak, indirectAttack, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -234,15 +232,16 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureContentFilterResultForPromptContentFilterResults IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected virtual InternalAzureContentFilterResultForPromptContentFilterResults PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureContentFilterResultForPromptContentFilterResults(document.RootElement, options); } default: @@ -252,18 +251,20 @@ InternalAzureContentFilterResultForPromptContentFilterResults IPersistableModel< string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalAzureContentFilterResultForPromptContentFilterResults FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureContentFilterResultForPromptContentFilterResults internalAzureContentFilterResultForPromptContentFilterResults) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureContentFilterResultForPromptContentFilterResults(document.RootElement); + if (internalAzureContentFilterResultForPromptContentFilterResults == null) + { + return null; + } + return BinaryContent.Create(internalAzureContentFilterResultForPromptContentFilterResults, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + public static explicit operator InternalAzureContentFilterResultForPromptContentFilterResults(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureContentFilterResultForPromptContentFilterResults(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs index 4887bb919..625a04ccb 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs @@ -7,100 +7,18 @@ namespace Azure.AI.OpenAI { - /// The AzureContentFilterResultForPromptContentFilterResults. internal partial class InternalAzureContentFilterResultForPromptContentFilterResults { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// - /// A detection result that describes user prompt injection attacks, where malicious users deliberately exploit - /// system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content - /// generation or violations of system-imposed restrictions. - /// - /// - /// A detection result that describes attacks on systems powered by Generative AI models that can happen every time - /// an application processes information that wasn’t directly authored by either the developer of the application or - /// the user. - /// - /// or is null. + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal InternalAzureContentFilterResultForPromptContentFilterResults(ContentFilterDetectionResult jailbreak, ContentFilterDetectionResult indirectAttack) { - Argument.AssertNotNull(jailbreak, nameof(jailbreak)); - Argument.AssertNotNull(indirectAttack, nameof(indirectAttack)); - Jailbreak = jailbreak; IndirectAttack = indirectAttack; } - /// Initializes a new instance of . - /// - /// A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - /// portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - /// assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - /// - /// - /// A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - /// language with reference to a person or identity group based on certain differentiating attributes of these groups - /// including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - /// religion, immigration status, ability status, personal appearance, and body size. - /// - /// - /// A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - /// someone or something; describes weapons, guns and related entities, such as manufactures, associations, - /// legislation, and so on. - /// - /// - /// A content filter category that describes language related to physical actions intended to purposely hurt, injure, - /// damage one's body or kill oneself. - /// - /// - /// A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the - /// content. - /// - /// A collection of binary filtering outcomes for configured custom blocklists. - /// If present, details about an error that prevented content filtering from completing its evaluation. - /// - /// A detection result that describes user prompt injection attacks, where malicious users deliberately exploit - /// system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content - /// generation or violations of system-imposed restrictions. - /// - /// - /// A detection result that describes attacks on systems powered by Generative AI models that can happen every time - /// an application processes information that wasn’t directly authored by either the developer of the application or - /// the user. - /// - /// Keeps track of any properties unknown to the library. - internal InternalAzureContentFilterResultForPromptContentFilterResults(ContentFilterSeverityResult sexual, ContentFilterSeverityResult hate, ContentFilterSeverityResult violence, ContentFilterSeverityResult selfHarm, ContentFilterDetectionResult profanity, ContentFilterBlocklistResult customBlocklists, InternalAzureContentFilterResultForChoiceError error, ContentFilterDetectionResult jailbreak, ContentFilterDetectionResult indirectAttack, IDictionary serializedAdditionalRawData) + internal InternalAzureContentFilterResultForPromptContentFilterResults(ContentFilterSeverityResult sexual, ContentFilterSeverityResult hate, ContentFilterSeverityResult violence, ContentFilterSeverityResult selfHarm, ContentFilterDetectionResult profanity, ContentFilterBlocklistResult customBlocklists, InternalAzureContentFilterResultForChoiceError error, ContentFilterDetectionResult jailbreak, ContentFilterDetectionResult indirectAttack, IDictionary additionalBinaryDataProperties) { Sexual = sexual; Hate = hate; @@ -111,58 +29,31 @@ internal InternalAzureContentFilterResultForPromptContentFilterResults(ContentFi Error = error; Jailbreak = jailbreak; IndirectAttack = indirectAttack; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureContentFilterResultForPromptContentFilterResults() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// - /// A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - /// portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - /// assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - /// internal ContentFilterSeverityResult Sexual { get; set; } - /// - /// A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - /// language with reference to a person or identity group based on certain differentiating attributes of these groups - /// including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - /// religion, immigration status, ability status, personal appearance, and body size. - /// + internal ContentFilterSeverityResult Hate { get; set; } - /// - /// A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - /// someone or something; describes weapons, guns and related entities, such as manufactures, associations, - /// legislation, and so on. - /// + internal ContentFilterSeverityResult Violence { get; set; } - /// - /// A content filter category that describes language related to physical actions intended to purposely hurt, injure, - /// damage one's body or kill oneself. - /// + internal ContentFilterSeverityResult SelfHarm { get; set; } - /// - /// A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the - /// content. - /// + internal ContentFilterDetectionResult Profanity { get; set; } - /// A collection of binary filtering outcomes for configured custom blocklists. + internal ContentFilterBlocklistResult CustomBlocklists { get; set; } - /// If present, details about an error that prevented content filtering from completing its evaluation. + internal InternalAzureContentFilterResultForChoiceError Error { get; set; } - /// - /// A detection result that describes user prompt injection attacks, where malicious users deliberately exploit - /// system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content - /// generation or violations of system-imposed restrictions. - /// + internal ContentFilterDetectionResult Jailbreak { get; set; } - /// - /// A detection result that describes attacks on systems powered by Generative AI models that can happen every time - /// an application processes information that wasn’t directly authored by either the developer of the application or - /// the user. - /// + internal ContentFilterDetectionResult IndirectAttack { get; set; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs index 9cf6d954e..b9bf23cd2 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs @@ -7,11 +7,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalAzureCosmosDBChatDataSourceParameters : IJsonModel { + internal InternalAzureCosmosDBChatDataSourceParameters() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,84 +24,86 @@ void IJsonModel.Write(Utf8JsonWri writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureCosmosDBChatDataSourceParameters)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) + if (Optional.IsDefined(TopNDocuments) && _additionalBinaryDataProperties?.ContainsKey("top_n_documents") != true) { writer.WritePropertyName("top_n_documents"u8); writer.WriteNumberValue(TopNDocuments.Value); } - if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) + if (Optional.IsDefined(InScope) && _additionalBinaryDataProperties?.ContainsKey("in_scope") != true) { writer.WritePropertyName("in_scope"u8); writer.WriteBooleanValue(InScope.Value); } - if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) + if (Optional.IsDefined(Strictness) && _additionalBinaryDataProperties?.ContainsKey("strictness") != true) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) + if (Optional.IsDefined(MaxSearchQueries) && _additionalBinaryDataProperties?.ContainsKey("max_search_queries") != true) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) + if (Optional.IsDefined(AllowPartialResult) && _additionalBinaryDataProperties?.ContainsKey("allow_partial_result") != true) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) - { - writer.WritePropertyName("include_contexts"u8); - writer.WriteStartArray(); - foreach (var item in _internalIncludeContexts) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (SerializedAdditionalRawData?.ContainsKey("container_name") != true) + if (_additionalBinaryDataProperties?.ContainsKey("container_name") != true) { writer.WritePropertyName("container_name"u8); writer.WriteStringValue(ContainerName); } - if (SerializedAdditionalRawData?.ContainsKey("database_name") != true) + if (_additionalBinaryDataProperties?.ContainsKey("database_name") != true) { writer.WritePropertyName("database_name"u8); writer.WriteStringValue(DatabaseName); } - if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true) - { - writer.WritePropertyName("embedding_dependency"u8); - writer.WriteObjectValue(VectorizationSource, options); - } - if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) + if (_additionalBinaryDataProperties?.ContainsKey("index_name") != true) { writer.WritePropertyName("index_name"u8); writer.WriteStringValue(IndexName); } - if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + if (_additionalBinaryDataProperties?.ContainsKey("authentication") != true) { writer.WritePropertyName("authentication"u8); writer.WriteObjectValue(Authentication, options); } - if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true) + if (_additionalBinaryDataProperties?.ContainsKey("fields_mapping") != true) { writer.WritePropertyName("fields_mapping"u8); writer.WriteObjectValue(FieldMappings, options); } - if (SerializedAdditionalRawData != null) + if (_additionalBinaryDataProperties?.ContainsKey("embedding_dependency") != true) { - foreach (var item in SerializedAdditionalRawData) + writer.WritePropertyName("embedding_dependency"u8); + writer.WriteObjectValue(VectorizationSource, options); + } + if (Optional.IsCollectionDefined(_internalIncludeContexts) && _additionalBinaryDataProperties?.ContainsKey("include_contexts") != true) + { + writer.WritePropertyName("include_contexts"u8); + writer.WriteStartArray(); + foreach (string item in _internalIncludeContexts) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -104,7 +111,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -115,22 +122,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - InternalAzureCosmosDBChatDataSourceParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureCosmosDBChatDataSourceParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected virtual InternalAzureCosmosDBChatDataSourceParameters JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureCosmosDBChatDataSourceParameters)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureCosmosDBChatDataSourceParameters(document.RootElement, options); } - internal static InternalAzureCosmosDBChatDataSourceParameters DeserializeInternalAzureCosmosDBChatDataSourceParameters(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureCosmosDBChatDataSourceParameters DeserializeInternalAzureCosmosDBChatDataSourceParameters(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -140,133 +146,138 @@ internal static InternalAzureCosmosDBChatDataSourceParameters DeserializeInterna int? strictness = default; int? maxSearchQueries = default; bool? allowPartialResult = default; - IList includeContexts = default; string containerName = default; string databaseName = default; - DataSourceVectorizer embeddingDependency = default; string indexName = default; DataSourceAuthentication authentication = default; - DataSourceFieldMappings fieldsMapping = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + DataSourceFieldMappings fieldMappings = default; + DataSourceVectorizer vectorizationSource = default; + IList internalIncludeContexts = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("top_n_documents"u8)) + if (prop.NameEquals("top_n_documents"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - topNDocuments = property.Value.GetInt32(); + topNDocuments = prop.Value.GetInt32(); continue; } - if (property.NameEquals("in_scope"u8)) + if (prop.NameEquals("in_scope"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - inScope = property.Value.GetBoolean(); + inScope = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("strictness"u8)) + if (prop.NameEquals("strictness"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - strictness = property.Value.GetInt32(); + strictness = prop.Value.GetInt32(); continue; } - if (property.NameEquals("max_search_queries"u8)) + if (prop.NameEquals("max_search_queries"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - maxSearchQueries = property.Value.GetInt32(); + maxSearchQueries = prop.Value.GetInt32(); continue; } - if (property.NameEquals("allow_partial_result"u8)) + if (prop.NameEquals("allow_partial_result"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - allowPartialResult = property.Value.GetBoolean(); + allowPartialResult = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("include_contexts"u8)) + if (prop.NameEquals("container_name"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - includeContexts = array; + containerName = prop.Value.GetString(); continue; } - if (property.NameEquals("container_name"u8)) + if (prop.NameEquals("database_name"u8)) { - containerName = property.Value.GetString(); + databaseName = prop.Value.GetString(); continue; } - if (property.NameEquals("database_name"u8)) + if (prop.NameEquals("index_name"u8)) { - databaseName = property.Value.GetString(); + indexName = prop.Value.GetString(); continue; } - if (property.NameEquals("embedding_dependency"u8)) + if (prop.NameEquals("authentication"u8)) { - embeddingDependency = DataSourceVectorizer.DeserializeDataSourceVectorizer(property.Value, options); + authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(prop.Value, options); continue; } - if (property.NameEquals("index_name"u8)) + if (prop.NameEquals("fields_mapping"u8)) { - indexName = property.Value.GetString(); + fieldMappings = DataSourceFieldMappings.DeserializeDataSourceFieldMappings(prop.Value, options); continue; } - if (property.NameEquals("authentication"u8)) + if (prop.NameEquals("embedding_dependency"u8)) { - authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(property.Value, options); + vectorizationSource = DataSourceVectorizer.DeserializeDataSourceVectorizer(prop.Value, options); continue; } - if (property.NameEquals("fields_mapping"u8)) + if (prop.NameEquals("include_contexts"u8)) { - fieldsMapping = DataSourceFieldMappings.DeserializeDataSourceFieldMappings(property.Value, options); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } + } + internalIncludeContexts = array; continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new InternalAzureCosmosDBChatDataSourceParameters( topNDocuments, inScope, strictness, maxSearchQueries, allowPartialResult, - includeContexts ?? new ChangeTrackingList(), containerName, databaseName, - embeddingDependency, indexName, authentication, - fieldsMapping, - serializedAdditionalRawData); + fieldMappings, + vectorizationSource, + internalIncludeContexts, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -276,15 +287,16 @@ BinaryData IPersistableModel.Writ } } - InternalAzureCosmosDBChatDataSourceParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureCosmosDBChatDataSourceParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected virtual InternalAzureCosmosDBChatDataSourceParameters PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureCosmosDBChatDataSourceParameters(document.RootElement, options); } default: @@ -294,18 +306,20 @@ InternalAzureCosmosDBChatDataSourceParameters IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalAzureCosmosDBChatDataSourceParameters FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureCosmosDBChatDataSourceParameters internalAzureCosmosDBChatDataSourceParameters) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureCosmosDBChatDataSourceParameters(document.RootElement); + if (internalAzureCosmosDBChatDataSourceParameters == null) + { + return null; + } + return BinaryContent.Create(internalAzureCosmosDBChatDataSourceParameters, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + public static explicit operator InternalAzureCosmosDBChatDataSourceParameters(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureCosmosDBChatDataSourceParameters(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs index 766b29fbd..1113ac762 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs @@ -4,149 +4,70 @@ using System; using System.Collections.Generic; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// The AzureCosmosDBChatDataSourceParameters. internal partial class InternalAzureCosmosDBChatDataSourceParameters { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// - /// - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// , , , , or is null. - public InternalAzureCosmosDBChatDataSourceParameters(string containerName, string databaseName, DataSourceVectorizer vectorizationSource, string indexName, DataSourceAuthentication authentication, DataSourceFieldMappings fieldMappings) + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + + public InternalAzureCosmosDBChatDataSourceParameters(string containerName, string databaseName, string indexName, DataSourceAuthentication authentication, DataSourceFieldMappings fieldMappings, DataSourceVectorizer vectorizationSource) { Argument.AssertNotNull(containerName, nameof(containerName)); Argument.AssertNotNull(databaseName, nameof(databaseName)); - Argument.AssertNotNull(vectorizationSource, nameof(vectorizationSource)); Argument.AssertNotNull(indexName, nameof(indexName)); Argument.AssertNotNull(authentication, nameof(authentication)); Argument.AssertNotNull(fieldMappings, nameof(fieldMappings)); + Argument.AssertNotNull(vectorizationSource, nameof(vectorizationSource)); - _internalIncludeContexts = new ChangeTrackingList(); ContainerName = containerName; DatabaseName = databaseName; - VectorizationSource = vectorizationSource; IndexName = indexName; Authentication = authentication; FieldMappings = fieldMappings; + VectorizationSource = vectorizationSource; + _internalIncludeContexts = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The configured number of documents to feature in the query. - /// Whether queries should be restricted to use of the indexed data. - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// - /// - /// The output context properties to include on the response. - /// By default, citations and intent will be requested. - /// - /// - /// - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// Keeps track of any properties unknown to the library. - internal InternalAzureCosmosDBChatDataSourceParameters(int? topNDocuments, bool? inScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, IList internalIncludeContexts, string containerName, string databaseName, DataSourceVectorizer vectorizationSource, string indexName, DataSourceAuthentication authentication, DataSourceFieldMappings fieldMappings, IDictionary serializedAdditionalRawData) + internal InternalAzureCosmosDBChatDataSourceParameters(int? topNDocuments, bool? inScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, string containerName, string databaseName, string indexName, DataSourceAuthentication authentication, DataSourceFieldMappings fieldMappings, DataSourceVectorizer vectorizationSource, IList internalIncludeContexts, IDictionary additionalBinaryDataProperties) { TopNDocuments = topNDocuments; InScope = inScope; Strictness = strictness; MaxSearchQueries = maxSearchQueries; AllowPartialResult = allowPartialResult; - _internalIncludeContexts = internalIncludeContexts; ContainerName = containerName; DatabaseName = databaseName; - VectorizationSource = vectorizationSource; IndexName = indexName; Authentication = authentication; FieldMappings = fieldMappings; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureCosmosDBChatDataSourceParameters() - { + VectorizationSource = vectorizationSource; + _internalIncludeContexts = internalIncludeContexts; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// The configured number of documents to feature in the query. public int? TopNDocuments { get; set; } - /// Whether queries should be restricted to use of the indexed data. + public bool? InScope { get; set; } - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// + public int? Strictness { get; set; } - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// + public int? MaxSearchQueries { get; set; } - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// + public bool? AllowPartialResult { get; set; } - /// Gets the container name. + internal string ContainerName { get; set; } - /// Gets the database name. + internal string DatabaseName { get; set; } - /// Gets the index name. + internal string IndexName { get; set; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs index 8ccab130f..b52b4bf0d 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs @@ -19,34 +19,31 @@ void IJsonModel.Write(Utf8JsonWriter wri writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureOpenAIChatErrorInnerError)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("code") != true && Optional.IsDefined(Code)) + if (Optional.IsDefined(Code) && _additionalBinaryDataProperties?.ContainsKey("code") != true) { writer.WritePropertyName("code"u8); writer.WriteStringValue(Code.Value.ToString()); } - if (SerializedAdditionalRawData?.ContainsKey("revised_prompt") != true && Optional.IsDefined(RevisedPrompt)) + if (Optional.IsDefined(RevisedPrompt) && _additionalBinaryDataProperties?.ContainsKey("revised_prompt") != true) { writer.WritePropertyName("revised_prompt"u8); writer.WriteStringValue(RevisedPrompt); } - if (SerializedAdditionalRawData?.ContainsKey("content_filter_results") != true && Optional.IsDefined(ContentFilterResults)) + if (Optional.IsDefined(ContentFilterResults) && _additionalBinaryDataProperties?.ContainsKey("content_filter_results") != true) { writer.WritePropertyName("content_filter_results"u8); writer.WriteObjectValue(ContentFilterResults, options); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -54,7 +51,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -65,22 +62,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - InternalAzureOpenAIChatErrorInnerError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureOpenAIChatErrorInnerError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected virtual InternalAzureOpenAIChatErrorInnerError JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureOpenAIChatErrorInnerError)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureOpenAIChatErrorInnerError(document.RootElement, options); } - internal static InternalAzureOpenAIChatErrorInnerError DeserializeInternalAzureOpenAIChatErrorInnerError(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureOpenAIChatErrorInnerError DeserializeInternalAzureOpenAIChatErrorInnerError(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -88,47 +84,45 @@ internal static InternalAzureOpenAIChatErrorInnerError DeserializeInternalAzureO InternalAzureOpenAIChatErrorInnerErrorCode? code = default; string revisedPrompt = default; RequestContentFilterResult contentFilterResults = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("code"u8)) + if (prop.NameEquals("code"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - code = new InternalAzureOpenAIChatErrorInnerErrorCode(property.Value.GetString()); + code = new InternalAzureOpenAIChatErrorInnerErrorCode(prop.Value.GetString()); continue; } - if (property.NameEquals("revised_prompt"u8)) + if (prop.NameEquals("revised_prompt"u8)) { - revisedPrompt = property.Value.GetString(); + revisedPrompt = prop.Value.GetString(); continue; } - if (property.NameEquals("content_filter_results"u8)) + if (prop.NameEquals("content_filter_results"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - contentFilterResults = RequestContentFilterResult.DeserializeRequestContentFilterResult(property.Value, options); + contentFilterResults = RequestContentFilterResult.DeserializeRequestContentFilterResult(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureOpenAIChatErrorInnerError(code, revisedPrompt, contentFilterResults, serializedAdditionalRawData); + return new InternalAzureOpenAIChatErrorInnerError(code, revisedPrompt, contentFilterResults, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -138,15 +132,16 @@ BinaryData IPersistableModel.Write(Model } } - InternalAzureOpenAIChatErrorInnerError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureOpenAIChatErrorInnerError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected virtual InternalAzureOpenAIChatErrorInnerError PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureOpenAIChatErrorInnerError(document.RootElement, options); } default: @@ -156,18 +151,20 @@ InternalAzureOpenAIChatErrorInnerError IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalAzureOpenAIChatErrorInnerError FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureOpenAIChatErrorInnerError internalAzureOpenAIChatErrorInnerError) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureOpenAIChatErrorInnerError(document.RootElement); + if (internalAzureOpenAIChatErrorInnerError == null) + { + return null; + } + return BinaryContent.Create(internalAzureOpenAIChatErrorInnerError, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + public static explicit operator InternalAzureOpenAIChatErrorInnerError(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureOpenAIChatErrorInnerError(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs index 94f1da0eb..e796e5aa0 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs @@ -7,63 +7,33 @@ namespace Azure.AI.OpenAI { - /// The AzureOpenAIChatErrorInnerError. internal partial class InternalAzureOpenAIChatErrorInnerError { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal InternalAzureOpenAIChatErrorInnerError() { } - /// Initializes a new instance of . - /// The code associated with the inner error. - /// If applicable, the modified prompt used for generation. - /// The content filter result details associated with the inner error. - /// Keeps track of any properties unknown to the library. - internal InternalAzureOpenAIChatErrorInnerError(InternalAzureOpenAIChatErrorInnerErrorCode? code, string revisedPrompt, RequestContentFilterResult contentFilterResults, IDictionary serializedAdditionalRawData) + internal InternalAzureOpenAIChatErrorInnerError(InternalAzureOpenAIChatErrorInnerErrorCode? code, string revisedPrompt, RequestContentFilterResult contentFilterResults, IDictionary additionalBinaryDataProperties) { Code = code; RevisedPrompt = revisedPrompt; ContentFilterResults = contentFilterResults; - SerializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// The code associated with the inner error. internal InternalAzureOpenAIChatErrorInnerErrorCode? Code { get; set; } - /// If applicable, the modified prompt used for generation. + internal string RevisedPrompt { get; set; } - /// The content filter result details associated with the inner error. + internal RequestContentFilterResult ContentFilterResults { get; set; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs index 84c3cb975..5bad53ad3 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs @@ -7,39 +7,37 @@ namespace Azure.AI.OpenAI { - /// The AzureOpenAIChatErrorInnerError_code. internal readonly partial struct InternalAzureOpenAIChatErrorInnerErrorCode : IEquatable { private readonly string _value; + /// ResponsibleAIPolicyViolation. + private const string ResponsibleAIPolicyViolationValue = "ResponsibleAIPolicyViolation"; - /// Initializes a new instance of . - /// is null. public InternalAzureOpenAIChatErrorInnerErrorCode(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string ResponsibleAIPolicyViolationValue = "ResponsibleAIPolicyViolation"; + _value = value; + } - /// ResponsibleAIPolicyViolation. internal static InternalAzureOpenAIChatErrorInnerErrorCode ResponsibleAIPolicyViolation { get; set; } = new InternalAzureOpenAIChatErrorInnerErrorCode(ResponsibleAIPolicyViolationValue); - /// Determines if two values are the same. + public static bool operator ==(InternalAzureOpenAIChatErrorInnerErrorCode left, InternalAzureOpenAIChatErrorInnerErrorCode right) => left.Equals(right); - /// Determines if two values are not the same. + public static bool operator !=(InternalAzureOpenAIChatErrorInnerErrorCode left, InternalAzureOpenAIChatErrorInnerErrorCode right) => !left.Equals(right); - /// Converts a to a . + public static implicit operator InternalAzureOpenAIChatErrorInnerErrorCode(string value) => new InternalAzureOpenAIChatErrorInnerErrorCode(value); - /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is InternalAzureOpenAIChatErrorInnerErrorCode other && Equals(other); - /// + public bool Equals(InternalAzureOpenAIChatErrorInnerErrorCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs index ee1d0be7f..38bf4ea6c 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs @@ -19,34 +19,31 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureOpenAIDalleErrorInnerError)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("code") != true && Optional.IsDefined(Code)) + if (Optional.IsDefined(Code) && _additionalBinaryDataProperties?.ContainsKey("code") != true) { writer.WritePropertyName("code"u8); writer.WriteStringValue(Code.Value.ToString()); } - if (SerializedAdditionalRawData?.ContainsKey("revised_prompt") != true && Optional.IsDefined(RevisedPrompt)) + if (Optional.IsDefined(RevisedPrompt) && _additionalBinaryDataProperties?.ContainsKey("revised_prompt") != true) { writer.WritePropertyName("revised_prompt"u8); writer.WriteStringValue(RevisedPrompt); } - if (SerializedAdditionalRawData?.ContainsKey("content_filter_results") != true && Optional.IsDefined(ContentFilterResults)) + if (Optional.IsDefined(ContentFilterResults) && _additionalBinaryDataProperties?.ContainsKey("content_filter_results") != true) { writer.WritePropertyName("content_filter_results"u8); writer.WriteObjectValue(ContentFilterResults, options); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -54,7 +51,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -65,22 +62,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - InternalAzureOpenAIDalleErrorInnerError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureOpenAIDalleErrorInnerError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected virtual InternalAzureOpenAIDalleErrorInnerError JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureOpenAIDalleErrorInnerError)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureOpenAIDalleErrorInnerError(document.RootElement, options); } - internal static InternalAzureOpenAIDalleErrorInnerError DeserializeInternalAzureOpenAIDalleErrorInnerError(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureOpenAIDalleErrorInnerError DeserializeInternalAzureOpenAIDalleErrorInnerError(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -88,47 +84,45 @@ internal static InternalAzureOpenAIDalleErrorInnerError DeserializeInternalAzure InternalAzureOpenAIDalleErrorInnerErrorCode? code = default; string revisedPrompt = default; RequestImageContentFilterResult contentFilterResults = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("code"u8)) + if (prop.NameEquals("code"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - code = new InternalAzureOpenAIDalleErrorInnerErrorCode(property.Value.GetString()); + code = new InternalAzureOpenAIDalleErrorInnerErrorCode(prop.Value.GetString()); continue; } - if (property.NameEquals("revised_prompt"u8)) + if (prop.NameEquals("revised_prompt"u8)) { - revisedPrompt = property.Value.GetString(); + revisedPrompt = prop.Value.GetString(); continue; } - if (property.NameEquals("content_filter_results"u8)) + if (prop.NameEquals("content_filter_results"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - contentFilterResults = RequestImageContentFilterResult.DeserializeRequestImageContentFilterResult(property.Value, options); + contentFilterResults = RequestImageContentFilterResult.DeserializeRequestImageContentFilterResult(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalAzureOpenAIDalleErrorInnerError(code, revisedPrompt, contentFilterResults, serializedAdditionalRawData); + return new InternalAzureOpenAIDalleErrorInnerError(code, revisedPrompt, contentFilterResults, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -138,15 +132,16 @@ BinaryData IPersistableModel.Write(Mode } } - InternalAzureOpenAIDalleErrorInnerError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureOpenAIDalleErrorInnerError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected virtual InternalAzureOpenAIDalleErrorInnerError PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureOpenAIDalleErrorInnerError(document.RootElement, options); } default: @@ -156,18 +151,20 @@ InternalAzureOpenAIDalleErrorInnerError IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalAzureOpenAIDalleErrorInnerError FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureOpenAIDalleErrorInnerError internalAzureOpenAIDalleErrorInnerError) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureOpenAIDalleErrorInnerError(document.RootElement); + if (internalAzureOpenAIDalleErrorInnerError == null) + { + return null; + } + return BinaryContent.Create(internalAzureOpenAIDalleErrorInnerError, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + public static explicit operator InternalAzureOpenAIDalleErrorInnerError(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureOpenAIDalleErrorInnerError(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs index d600b81cf..a8ae69bcb 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs @@ -7,63 +7,33 @@ namespace Azure.AI.OpenAI { - /// The AzureOpenAIDalleErrorInnerError. internal partial class InternalAzureOpenAIDalleErrorInnerError { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal InternalAzureOpenAIDalleErrorInnerError() { } - /// Initializes a new instance of . - /// The code associated with the inner error. - /// If applicable, the modified prompt used for generation. - /// The content filter result details associated with the inner error. - /// Keeps track of any properties unknown to the library. - internal InternalAzureOpenAIDalleErrorInnerError(InternalAzureOpenAIDalleErrorInnerErrorCode? code, string revisedPrompt, RequestImageContentFilterResult contentFilterResults, IDictionary serializedAdditionalRawData) + internal InternalAzureOpenAIDalleErrorInnerError(InternalAzureOpenAIDalleErrorInnerErrorCode? code, string revisedPrompt, RequestImageContentFilterResult contentFilterResults, IDictionary additionalBinaryDataProperties) { Code = code; RevisedPrompt = revisedPrompt; ContentFilterResults = contentFilterResults; - SerializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// The code associated with the inner error. internal InternalAzureOpenAIDalleErrorInnerErrorCode? Code { get; set; } - /// If applicable, the modified prompt used for generation. + internal string RevisedPrompt { get; set; } - /// The content filter result details associated with the inner error. + internal RequestImageContentFilterResult ContentFilterResults { get; set; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs index 4e4a87f04..9c9b22e30 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs @@ -7,39 +7,37 @@ namespace Azure.AI.OpenAI { - /// The AzureOpenAIDalleErrorInnerError_code. internal readonly partial struct InternalAzureOpenAIDalleErrorInnerErrorCode : IEquatable { private readonly string _value; + /// ResponsibleAIPolicyViolation. + private const string ResponsibleAIPolicyViolationValue = "ResponsibleAIPolicyViolation"; - /// Initializes a new instance of . - /// is null. public InternalAzureOpenAIDalleErrorInnerErrorCode(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string ResponsibleAIPolicyViolationValue = "ResponsibleAIPolicyViolation"; + _value = value; + } - /// ResponsibleAIPolicyViolation. internal static InternalAzureOpenAIDalleErrorInnerErrorCode ResponsibleAIPolicyViolation { get; set; } = new InternalAzureOpenAIDalleErrorInnerErrorCode(ResponsibleAIPolicyViolationValue); - /// Determines if two values are the same. + public static bool operator ==(InternalAzureOpenAIDalleErrorInnerErrorCode left, InternalAzureOpenAIDalleErrorInnerErrorCode right) => left.Equals(right); - /// Determines if two values are not the same. + public static bool operator !=(InternalAzureOpenAIDalleErrorInnerErrorCode left, InternalAzureOpenAIDalleErrorInnerErrorCode right) => !left.Equals(right); - /// Converts a to a . + public static implicit operator InternalAzureOpenAIDalleErrorInnerErrorCode(string value) => new InternalAzureOpenAIDalleErrorInnerErrorCode(value); - /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is InternalAzureOpenAIDalleErrorInnerErrorCode other && Equals(other); - /// + public bool Equals(InternalAzureOpenAIDalleErrorInnerErrorCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs index 6a234efc8..fabc88269 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs @@ -7,11 +7,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalAzureSearchChatDataSourceParameters : IJsonModel { + internal InternalAzureSearchChatDataSourceParameters() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,94 +24,96 @@ void IJsonModel.Write(Utf8JsonWrite writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureSearchChatDataSourceParameters)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) + if (Optional.IsDefined(TopNDocuments) && _additionalBinaryDataProperties?.ContainsKey("top_n_documents") != true) { writer.WritePropertyName("top_n_documents"u8); writer.WriteNumberValue(TopNDocuments.Value); } - if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) + if (Optional.IsDefined(InScope) && _additionalBinaryDataProperties?.ContainsKey("in_scope") != true) { writer.WritePropertyName("in_scope"u8); writer.WriteBooleanValue(InScope.Value); } - if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) + if (Optional.IsDefined(Strictness) && _additionalBinaryDataProperties?.ContainsKey("strictness") != true) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) + if (Optional.IsDefined(MaxSearchQueries) && _additionalBinaryDataProperties?.ContainsKey("max_search_queries") != true) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) + if (Optional.IsDefined(AllowPartialResult) && _additionalBinaryDataProperties?.ContainsKey("allow_partial_result") != true) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) - { - writer.WritePropertyName("include_contexts"u8); - writer.WriteStartArray(); - foreach (var item in _internalIncludeContexts) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (SerializedAdditionalRawData?.ContainsKey("endpoint") != true) + if (_additionalBinaryDataProperties?.ContainsKey("endpoint") != true) { writer.WritePropertyName("endpoint"u8); writer.WriteStringValue(Endpoint.AbsoluteUri); } - if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) + if (_additionalBinaryDataProperties?.ContainsKey("index_name") != true) { writer.WritePropertyName("index_name"u8); writer.WriteStringValue(IndexName); } - if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + if (Optional.IsDefined(SemanticConfiguration) && _additionalBinaryDataProperties?.ContainsKey("semantic_configuration") != true) + { + writer.WritePropertyName("semantic_configuration"u8); + writer.WriteStringValue(SemanticConfiguration); + } + if (Optional.IsDefined(Filter) && _additionalBinaryDataProperties?.ContainsKey("filter") != true) + { + writer.WritePropertyName("filter"u8); + writer.WriteStringValue(Filter); + } + if (_additionalBinaryDataProperties?.ContainsKey("authentication") != true) { writer.WritePropertyName("authentication"u8); writer.WriteObjectValue(Authentication, options); } - if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true && Optional.IsDefined(FieldMappings)) + if (Optional.IsDefined(FieldMappings) && _additionalBinaryDataProperties?.ContainsKey("fields_mapping") != true) { writer.WritePropertyName("fields_mapping"u8); writer.WriteObjectValue(FieldMappings, options); } - if (SerializedAdditionalRawData?.ContainsKey("query_type") != true && Optional.IsDefined(QueryType)) + if (Optional.IsDefined(QueryType) && _additionalBinaryDataProperties?.ContainsKey("query_type") != true) { writer.WritePropertyName("query_type"u8); writer.WriteStringValue(QueryType.Value.ToString()); } - if (SerializedAdditionalRawData?.ContainsKey("semantic_configuration") != true && Optional.IsDefined(SemanticConfiguration)) - { - writer.WritePropertyName("semantic_configuration"u8); - writer.WriteStringValue(SemanticConfiguration); - } - if (SerializedAdditionalRawData?.ContainsKey("filter") != true && Optional.IsDefined(Filter)) - { - writer.WritePropertyName("filter"u8); - writer.WriteStringValue(Filter); - } - if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true && Optional.IsDefined(VectorizationSource)) + if (Optional.IsDefined(VectorizationSource) && _additionalBinaryDataProperties?.ContainsKey("embedding_dependency") != true) { writer.WritePropertyName("embedding_dependency"u8); writer.WriteObjectValue(VectorizationSource, options); } - if (SerializedAdditionalRawData != null) + if (Optional.IsCollectionDefined(_internalIncludeContexts) && _additionalBinaryDataProperties?.ContainsKey("include_contexts") != true) { - foreach (var item in SerializedAdditionalRawData) + writer.WritePropertyName("include_contexts"u8); + writer.WriteStartArray(); + foreach (string item in _internalIncludeContexts) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -114,7 +121,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -125,22 +132,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - InternalAzureSearchChatDataSourceParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalAzureSearchChatDataSourceParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected virtual InternalAzureSearchChatDataSourceParameters JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalAzureSearchChatDataSourceParameters)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalAzureSearchChatDataSourceParameters(document.RootElement, options); } - internal static InternalAzureSearchChatDataSourceParameters DeserializeInternalAzureSearchChatDataSourceParameters(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalAzureSearchChatDataSourceParameters DeserializeInternalAzureSearchChatDataSourceParameters(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -150,159 +156,164 @@ internal static InternalAzureSearchChatDataSourceParameters DeserializeInternalA int? strictness = default; int? maxSearchQueries = default; bool? allowPartialResult = default; - IList includeContexts = default; Uri endpoint = default; string indexName = default; - DataSourceAuthentication authentication = default; - DataSourceFieldMappings fieldsMapping = default; - DataSourceQueryType? queryType = default; string semanticConfiguration = default; string filter = default; - DataSourceVectorizer embeddingDependency = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + DataSourceAuthentication authentication = default; + DataSourceFieldMappings fieldMappings = default; + DataSourceQueryType? queryType = default; + DataSourceVectorizer vectorizationSource = default; + IList internalIncludeContexts = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("top_n_documents"u8)) + if (prop.NameEquals("top_n_documents"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - topNDocuments = property.Value.GetInt32(); + topNDocuments = prop.Value.GetInt32(); continue; } - if (property.NameEquals("in_scope"u8)) + if (prop.NameEquals("in_scope"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - inScope = property.Value.GetBoolean(); + inScope = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("strictness"u8)) + if (prop.NameEquals("strictness"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - strictness = property.Value.GetInt32(); + strictness = prop.Value.GetInt32(); continue; } - if (property.NameEquals("max_search_queries"u8)) + if (prop.NameEquals("max_search_queries"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - maxSearchQueries = property.Value.GetInt32(); + maxSearchQueries = prop.Value.GetInt32(); continue; } - if (property.NameEquals("allow_partial_result"u8)) + if (prop.NameEquals("allow_partial_result"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - allowPartialResult = property.Value.GetBoolean(); + allowPartialResult = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("include_contexts"u8)) + if (prop.NameEquals("endpoint"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - includeContexts = array; + endpoint = new Uri(prop.Value.GetString()); continue; } - if (property.NameEquals("endpoint"u8)) + if (prop.NameEquals("index_name"u8)) { - endpoint = new Uri(property.Value.GetString()); + indexName = prop.Value.GetString(); continue; } - if (property.NameEquals("index_name"u8)) + if (prop.NameEquals("semantic_configuration"u8)) { - indexName = property.Value.GetString(); + semanticConfiguration = prop.Value.GetString(); continue; } - if (property.NameEquals("authentication"u8)) + if (prop.NameEquals("filter"u8)) { - authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(property.Value, options); + filter = prop.Value.GetString(); continue; } - if (property.NameEquals("fields_mapping"u8)) + if (prop.NameEquals("authentication"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fieldsMapping = DataSourceFieldMappings.DeserializeDataSourceFieldMappings(property.Value, options); + authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(prop.Value, options); continue; } - if (property.NameEquals("query_type"u8)) + if (prop.NameEquals("fields_mapping"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - queryType = new DataSourceQueryType(property.Value.GetString()); + fieldMappings = DataSourceFieldMappings.DeserializeDataSourceFieldMappings(prop.Value, options); continue; } - if (property.NameEquals("semantic_configuration"u8)) + if (prop.NameEquals("query_type"u8)) { - semanticConfiguration = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + queryType = new DataSourceQueryType(prop.Value.GetString()); continue; } - if (property.NameEquals("filter"u8)) + if (prop.NameEquals("embedding_dependency"u8)) { - filter = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vectorizationSource = DataSourceVectorizer.DeserializeDataSourceVectorizer(prop.Value, options); continue; } - if (property.NameEquals("embedding_dependency"u8)) + if (prop.NameEquals("include_contexts"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - embeddingDependency = DataSourceVectorizer.DeserializeDataSourceVectorizer(property.Value, options); + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } + } + internalIncludeContexts = array; continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new InternalAzureSearchChatDataSourceParameters( topNDocuments, inScope, strictness, maxSearchQueries, allowPartialResult, - includeContexts ?? new ChangeTrackingList(), endpoint, indexName, - authentication, - fieldsMapping, - queryType, semanticConfiguration, filter, - embeddingDependency, - serializedAdditionalRawData); + authentication, + fieldMappings, + queryType, + vectorizationSource, + internalIncludeContexts, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -312,15 +323,16 @@ BinaryData IPersistableModel.Write( } } - InternalAzureSearchChatDataSourceParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalAzureSearchChatDataSourceParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected virtual InternalAzureSearchChatDataSourceParameters PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalAzureSearchChatDataSourceParameters(document.RootElement, options); } default: @@ -330,18 +342,20 @@ InternalAzureSearchChatDataSourceParameters IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalAzureSearchChatDataSourceParameters FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalAzureSearchChatDataSourceParameters internalAzureSearchChatDataSourceParameters) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalAzureSearchChatDataSourceParameters(document.RootElement); + if (internalAzureSearchChatDataSourceParameters == null) + { + return null; + } + return BinaryContent.Create(internalAzureSearchChatDataSourceParameters, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + public static explicit operator InternalAzureSearchChatDataSourceParameters(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalAzureSearchChatDataSourceParameters(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs index cbd3f5dcc..7b06fa6cb 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs @@ -4,148 +4,68 @@ using System; using System.Collections.Generic; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// The AzureSearchChatDataSourceParameters. internal partial class InternalAzureSearchChatDataSourceParameters { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// The absolute endpoint path for the Azure Search resource to use. - /// The name of the index to use, as specified in the Azure Search resource. - /// - /// The authentication mechanism to use with Azure Search. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// , or is null. + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + public InternalAzureSearchChatDataSourceParameters(Uri endpoint, string indexName, DataSourceAuthentication authentication) { Argument.AssertNotNull(endpoint, nameof(endpoint)); Argument.AssertNotNull(indexName, nameof(indexName)); Argument.AssertNotNull(authentication, nameof(authentication)); - _internalIncludeContexts = new ChangeTrackingList(); Endpoint = endpoint; IndexName = indexName; Authentication = authentication; + _internalIncludeContexts = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The configured number of documents to feature in the query. - /// Whether queries should be restricted to use of the indexed data. - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// - /// - /// The output context properties to include on the response. - /// By default, citations and intent will be requested. - /// - /// The absolute endpoint path for the Azure Search resource to use. - /// The name of the index to use, as specified in the Azure Search resource. - /// - /// The authentication mechanism to use with Azure Search. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// The field mappings to use with the Azure Search resource. - /// The query type for the Azure Search resource to use. - /// Additional semantic configuration for the query. - /// A filter to apply to the search. - /// - /// The vectorization source to use with Azure Search. - /// Supported sources for Azure Search include endpoint, deployment name, and integrated. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// Keeps track of any properties unknown to the library. - internal InternalAzureSearchChatDataSourceParameters(int? topNDocuments, bool? inScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, IList internalIncludeContexts, Uri endpoint, string indexName, DataSourceAuthentication authentication, DataSourceFieldMappings fieldMappings, DataSourceQueryType? queryType, string semanticConfiguration, string filter, DataSourceVectorizer vectorizationSource, IDictionary serializedAdditionalRawData) + internal InternalAzureSearchChatDataSourceParameters(int? topNDocuments, bool? inScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, Uri endpoint, string indexName, string semanticConfiguration, string filter, DataSourceAuthentication authentication, DataSourceFieldMappings fieldMappings, DataSourceQueryType? queryType, DataSourceVectorizer vectorizationSource, IList internalIncludeContexts, IDictionary additionalBinaryDataProperties) { TopNDocuments = topNDocuments; InScope = inScope; Strictness = strictness; MaxSearchQueries = maxSearchQueries; AllowPartialResult = allowPartialResult; - _internalIncludeContexts = internalIncludeContexts; Endpoint = endpoint; IndexName = indexName; + SemanticConfiguration = semanticConfiguration; + Filter = filter; Authentication = authentication; FieldMappings = fieldMappings; QueryType = queryType; - SemanticConfiguration = semanticConfiguration; - Filter = filter; VectorizationSource = vectorizationSource; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InternalAzureSearchChatDataSourceParameters() - { + _internalIncludeContexts = internalIncludeContexts; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// The configured number of documents to feature in the query. public int? TopNDocuments { get; set; } - /// Whether queries should be restricted to use of the indexed data. + public bool? InScope { get; set; } - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// + public int? Strictness { get; set; } - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// + public int? MaxSearchQueries { get; set; } - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// + public bool? AllowPartialResult { get; set; } - /// The absolute endpoint path for the Azure Search resource to use. + internal Uri Endpoint { get; set; } - /// The name of the index to use, as specified in the Azure Search resource. + internal string IndexName { get; set; } - /// Additional semantic configuration for the query. + public string SemanticConfiguration { get; set; } - /// A filter to apply to the search. + public string Filter { get; set; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs index 1d2113e47..64fcc7934 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs @@ -4,48 +4,46 @@ using System; using System.ComponentModel; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// The AzureSearchChatDataSourceParametersIncludeContext. internal readonly partial struct InternalAzureSearchChatDataSourceParametersIncludeContext : IEquatable { private readonly string _value; + private const string CitationsValue = "citations"; + private const string IntentValue = "intent"; + private const string AllRetrievedDocumentsValue = "all_retrieved_documents"; - /// Initializes a new instance of . - /// is null. public InternalAzureSearchChatDataSourceParametersIncludeContext(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string CitationsValue = "citations"; - private const string IntentValue = "intent"; - private const string AllRetrievedDocumentsValue = "all_retrieved_documents"; + _value = value; + } - /// citations. internal static InternalAzureSearchChatDataSourceParametersIncludeContext Citations { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(CitationsValue); - /// intent. + internal static InternalAzureSearchChatDataSourceParametersIncludeContext Intent { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(IntentValue); - /// all_retrieved_documents. + internal static InternalAzureSearchChatDataSourceParametersIncludeContext AllRetrievedDocuments { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(AllRetrievedDocumentsValue); - /// Determines if two values are the same. + public static bool operator ==(InternalAzureSearchChatDataSourceParametersIncludeContext left, InternalAzureSearchChatDataSourceParametersIncludeContext right) => left.Equals(right); - /// Determines if two values are not the same. + public static bool operator !=(InternalAzureSearchChatDataSourceParametersIncludeContext left, InternalAzureSearchChatDataSourceParametersIncludeContext right) => !left.Equals(right); - /// Converts a to a . + public static implicit operator InternalAzureSearchChatDataSourceParametersIncludeContext(string value) => new InternalAzureSearchChatDataSourceParametersIncludeContext(value); - /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is InternalAzureSearchChatDataSourceParametersIncludeContext other && Equals(other); - /// + public bool Equals(InternalAzureSearchChatDataSourceParametersIncludeContext other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs index 445e3e27c..20677c407 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs @@ -7,11 +7,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalElasticsearchChatDataSourceParameters : IJsonModel { + internal InternalElasticsearchChatDataSourceParameters() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,84 +24,86 @@ void IJsonModel.Write(Utf8JsonWri writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalElasticsearchChatDataSourceParameters)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) + if (Optional.IsDefined(TopNDocuments) && _additionalBinaryDataProperties?.ContainsKey("top_n_documents") != true) { writer.WritePropertyName("top_n_documents"u8); writer.WriteNumberValue(TopNDocuments.Value); } - if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) + if (Optional.IsDefined(InScope) && _additionalBinaryDataProperties?.ContainsKey("in_scope") != true) { writer.WritePropertyName("in_scope"u8); writer.WriteBooleanValue(InScope.Value); } - if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) + if (Optional.IsDefined(Strictness) && _additionalBinaryDataProperties?.ContainsKey("strictness") != true) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) + if (Optional.IsDefined(MaxSearchQueries) && _additionalBinaryDataProperties?.ContainsKey("max_search_queries") != true) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) + if (Optional.IsDefined(AllowPartialResult) && _additionalBinaryDataProperties?.ContainsKey("allow_partial_result") != true) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) - { - writer.WritePropertyName("include_contexts"u8); - writer.WriteStartArray(); - foreach (var item in _internalIncludeContexts) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (SerializedAdditionalRawData?.ContainsKey("endpoint") != true) + if (_additionalBinaryDataProperties?.ContainsKey("endpoint") != true) { writer.WritePropertyName("endpoint"u8); writer.WriteStringValue(Endpoint.AbsoluteUri); } - if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) + if (_additionalBinaryDataProperties?.ContainsKey("index_name") != true) { writer.WritePropertyName("index_name"u8); writer.WriteStringValue(IndexName); } - if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + if (Optional.IsCollectionDefined(_internalIncludeContexts) && _additionalBinaryDataProperties?.ContainsKey("include_contexts") != true) + { + writer.WritePropertyName("include_contexts"u8); + writer.WriteStartArray(); + foreach (string item in _internalIncludeContexts) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (_additionalBinaryDataProperties?.ContainsKey("authentication") != true) { writer.WritePropertyName("authentication"u8); writer.WriteObjectValue(Authentication, options); } - if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true && Optional.IsDefined(FieldMappings)) + if (Optional.IsDefined(FieldMappings) && _additionalBinaryDataProperties?.ContainsKey("fields_mapping") != true) { writer.WritePropertyName("fields_mapping"u8); writer.WriteObjectValue(FieldMappings, options); } - if (SerializedAdditionalRawData?.ContainsKey("query_type") != true && Optional.IsDefined(QueryType)) + if (Optional.IsDefined(QueryType) && _additionalBinaryDataProperties?.ContainsKey("query_type") != true) { writer.WritePropertyName("query_type"u8); writer.WriteStringValue(QueryType.Value.ToString()); } - if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true && Optional.IsDefined(VectorizationSource)) + if (Optional.IsDefined(VectorizationSource) && _additionalBinaryDataProperties?.ContainsKey("embedding_dependency") != true) { writer.WritePropertyName("embedding_dependency"u8); writer.WriteObjectValue(VectorizationSource, options); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -104,7 +111,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -115,22 +122,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - InternalElasticsearchChatDataSourceParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalElasticsearchChatDataSourceParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected virtual InternalElasticsearchChatDataSourceParameters JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalElasticsearchChatDataSourceParameters)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalElasticsearchChatDataSourceParameters(document.RootElement, options); } - internal static InternalElasticsearchChatDataSourceParameters DeserializeInternalElasticsearchChatDataSourceParameters(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalElasticsearchChatDataSourceParameters DeserializeInternalElasticsearchChatDataSourceParameters(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -140,145 +146,150 @@ internal static InternalElasticsearchChatDataSourceParameters DeserializeInterna int? strictness = default; int? maxSearchQueries = default; bool? allowPartialResult = default; - IList includeContexts = default; Uri endpoint = default; string indexName = default; + IList internalIncludeContexts = default; DataSourceAuthentication authentication = default; - DataSourceFieldMappings fieldsMapping = default; + DataSourceFieldMappings fieldMappings = default; DataSourceQueryType? queryType = default; - DataSourceVectorizer embeddingDependency = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + DataSourceVectorizer vectorizationSource = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("top_n_documents"u8)) + if (prop.NameEquals("top_n_documents"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - topNDocuments = property.Value.GetInt32(); + topNDocuments = prop.Value.GetInt32(); continue; } - if (property.NameEquals("in_scope"u8)) + if (prop.NameEquals("in_scope"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - inScope = property.Value.GetBoolean(); + inScope = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("strictness"u8)) + if (prop.NameEquals("strictness"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - strictness = property.Value.GetInt32(); + strictness = prop.Value.GetInt32(); continue; } - if (property.NameEquals("max_search_queries"u8)) + if (prop.NameEquals("max_search_queries"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - maxSearchQueries = property.Value.GetInt32(); + maxSearchQueries = prop.Value.GetInt32(); continue; } - if (property.NameEquals("allow_partial_result"u8)) + if (prop.NameEquals("allow_partial_result"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - allowPartialResult = property.Value.GetBoolean(); + allowPartialResult = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("include_contexts"u8)) + if (prop.NameEquals("endpoint"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - includeContexts = array; + endpoint = new Uri(prop.Value.GetString()); continue; } - if (property.NameEquals("endpoint"u8)) + if (prop.NameEquals("index_name"u8)) { - endpoint = new Uri(property.Value.GetString()); + indexName = prop.Value.GetString(); continue; } - if (property.NameEquals("index_name"u8)) + if (prop.NameEquals("include_contexts"u8)) { - indexName = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } + } + internalIncludeContexts = array; continue; } - if (property.NameEquals("authentication"u8)) + if (prop.NameEquals("authentication"u8)) { - authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(property.Value, options); + authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(prop.Value, options); continue; } - if (property.NameEquals("fields_mapping"u8)) + if (prop.NameEquals("fields_mapping"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - fieldsMapping = DataSourceFieldMappings.DeserializeDataSourceFieldMappings(property.Value, options); + fieldMappings = DataSourceFieldMappings.DeserializeDataSourceFieldMappings(prop.Value, options); continue; } - if (property.NameEquals("query_type"u8)) + if (prop.NameEquals("query_type"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - queryType = new DataSourceQueryType(property.Value.GetString()); + queryType = new DataSourceQueryType(prop.Value.GetString()); continue; } - if (property.NameEquals("embedding_dependency"u8)) + if (prop.NameEquals("embedding_dependency"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - embeddingDependency = DataSourceVectorizer.DeserializeDataSourceVectorizer(property.Value, options); + vectorizationSource = DataSourceVectorizer.DeserializeDataSourceVectorizer(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new InternalElasticsearchChatDataSourceParameters( topNDocuments, inScope, strictness, maxSearchQueries, allowPartialResult, - includeContexts ?? new ChangeTrackingList(), endpoint, indexName, + internalIncludeContexts ?? new ChangeTrackingList(), authentication, - fieldsMapping, + fieldMappings, queryType, - embeddingDependency, - serializedAdditionalRawData); + vectorizationSource, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -288,15 +299,16 @@ BinaryData IPersistableModel.Writ } } - InternalElasticsearchChatDataSourceParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalElasticsearchChatDataSourceParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected virtual InternalElasticsearchChatDataSourceParameters PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalElasticsearchChatDataSourceParameters(document.RootElement, options); } default: @@ -306,18 +318,20 @@ InternalElasticsearchChatDataSourceParameters IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalElasticsearchChatDataSourceParameters FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalElasticsearchChatDataSourceParameters internalElasticsearchChatDataSourceParameters) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalElasticsearchChatDataSourceParameters(document.RootElement); + if (internalElasticsearchChatDataSourceParameters == null) + { + return null; + } + return BinaryContent.Create(internalElasticsearchChatDataSourceParameters, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + public static explicit operator InternalElasticsearchChatDataSourceParameters(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalElasticsearchChatDataSourceParameters(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs index f82b1889d..b83f75a54 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs @@ -4,136 +4,62 @@ using System; using System.Collections.Generic; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// The ElasticsearchChatDataSourceParameters. internal partial class InternalElasticsearchChatDataSourceParameters { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// - /// - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// , or is null. + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + public InternalElasticsearchChatDataSourceParameters(Uri endpoint, string indexName, DataSourceAuthentication authentication) { Argument.AssertNotNull(endpoint, nameof(endpoint)); Argument.AssertNotNull(indexName, nameof(indexName)); Argument.AssertNotNull(authentication, nameof(authentication)); - _internalIncludeContexts = new ChangeTrackingList(); Endpoint = endpoint; IndexName = indexName; + _internalIncludeContexts = new ChangeTrackingList(); Authentication = authentication; } - /// Initializes a new instance of . - /// The configured number of documents to feature in the query. - /// Whether queries should be restricted to use of the indexed data. - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// - /// - /// The output context properties to include on the response. - /// By default, citations and intent will be requested. - /// - /// - /// - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// Keeps track of any properties unknown to the library. - internal InternalElasticsearchChatDataSourceParameters(int? topNDocuments, bool? inScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, IList internalIncludeContexts, Uri endpoint, string indexName, DataSourceAuthentication authentication, DataSourceFieldMappings fieldMappings, DataSourceQueryType? queryType, DataSourceVectorizer vectorizationSource, IDictionary serializedAdditionalRawData) + internal InternalElasticsearchChatDataSourceParameters(int? topNDocuments, bool? inScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, Uri endpoint, string indexName, IList internalIncludeContexts, DataSourceAuthentication authentication, DataSourceFieldMappings fieldMappings, DataSourceQueryType? queryType, DataSourceVectorizer vectorizationSource, IDictionary additionalBinaryDataProperties) { TopNDocuments = topNDocuments; InScope = inScope; Strictness = strictness; MaxSearchQueries = maxSearchQueries; AllowPartialResult = allowPartialResult; - _internalIncludeContexts = internalIncludeContexts; Endpoint = endpoint; IndexName = indexName; + _internalIncludeContexts = internalIncludeContexts; Authentication = authentication; FieldMappings = fieldMappings; QueryType = queryType; VectorizationSource = vectorizationSource; - SerializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Initializes a new instance of for deserialization. - internal InternalElasticsearchChatDataSourceParameters() - { - } - - /// The configured number of documents to feature in the query. public int? TopNDocuments { get; set; } - /// Whether queries should be restricted to use of the indexed data. + public bool? InScope { get; set; } - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// + public int? Strictness { get; set; } - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// + public int? MaxSearchQueries { get; set; } - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// + public bool? AllowPartialResult { get; set; } - /// Gets the endpoint. + internal Uri Endpoint { get; set; } - /// Gets the index name. + internal string IndexName { get; set; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.Serialization.cs index 30e1f6968..8ee1be5fb 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.Serialization.cs @@ -7,11 +7,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalMongoDBChatDataSourceParameters : IJsonModel { + internal InternalMongoDBChatDataSourceParameters() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,94 +24,96 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalMongoDBChatDataSourceParameters)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) + if (Optional.IsDefined(TopNDocuments) && _additionalBinaryDataProperties?.ContainsKey("top_n_documents") != true) { writer.WritePropertyName("top_n_documents"u8); writer.WriteNumberValue(TopNDocuments.Value); } - if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) + if (Optional.IsDefined(InScope) && _additionalBinaryDataProperties?.ContainsKey("in_scope") != true) { writer.WritePropertyName("in_scope"u8); writer.WriteBooleanValue(InScope.Value); } - if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) + if (Optional.IsDefined(Strictness) && _additionalBinaryDataProperties?.ContainsKey("strictness") != true) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) + if (Optional.IsDefined(MaxSearchQueries) && _additionalBinaryDataProperties?.ContainsKey("max_search_queries") != true) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) + if (Optional.IsDefined(AllowPartialResult) && _additionalBinaryDataProperties?.ContainsKey("allow_partial_result") != true) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) - { - writer.WritePropertyName("include_contexts"u8); - writer.WriteStartArray(); - foreach (var item in _internalIncludeContexts) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (SerializedAdditionalRawData?.ContainsKey("endpoint") != true) + if (_additionalBinaryDataProperties?.ContainsKey("endpoint") != true) { writer.WritePropertyName("endpoint"u8); writer.WriteStringValue(Endpoint); } - if (SerializedAdditionalRawData?.ContainsKey("database_name") != true) + if (_additionalBinaryDataProperties?.ContainsKey("database_name") != true) { writer.WritePropertyName("database_name"u8); writer.WriteStringValue(DatabaseName); } - if (SerializedAdditionalRawData?.ContainsKey("collection_name") != true) + if (_additionalBinaryDataProperties?.ContainsKey("collection_name") != true) { writer.WritePropertyName("collection_name"u8); writer.WriteStringValue(CollectionName); } - if (SerializedAdditionalRawData?.ContainsKey("app_name") != true) + if (_additionalBinaryDataProperties?.ContainsKey("app_name") != true) { writer.WritePropertyName("app_name"u8); writer.WriteStringValue(AppName); } - if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) + if (_additionalBinaryDataProperties?.ContainsKey("index_name") != true) { writer.WritePropertyName("index_name"u8); writer.WriteStringValue(IndexName); } - if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + if (_additionalBinaryDataProperties?.ContainsKey("fields_mapping") != true) + { + writer.WritePropertyName("fields_mapping"u8); + writer.WriteObjectValue(FieldMappings, options); + } + if (_additionalBinaryDataProperties?.ContainsKey("authentication") != true) { writer.WritePropertyName("authentication"u8); writer.WriteObjectValue(Authentication, options); } - if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true) + if (_additionalBinaryDataProperties?.ContainsKey("embedding_dependency") != true) { writer.WritePropertyName("embedding_dependency"u8); writer.WriteObjectValue(EmbeddingDependency, options); } - if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true) + if (Optional.IsCollectionDefined(_internalIncludeContexts) && _additionalBinaryDataProperties?.ContainsKey("include_contexts") != true) { - writer.WritePropertyName("fields_mapping"u8); - writer.WriteObjectValue(FieldMappings, options); + writer.WritePropertyName("include_contexts"u8); + writer.WriteStartArray(); + foreach (string item in _internalIncludeContexts) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -114,7 +121,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -125,22 +132,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - InternalMongoDBChatDataSourceParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalMongoDBChatDataSourceParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected virtual InternalMongoDBChatDataSourceParameters JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalMongoDBChatDataSourceParameters)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalMongoDBChatDataSourceParameters(document.RootElement, options); } - internal static InternalMongoDBChatDataSourceParameters DeserializeInternalMongoDBChatDataSourceParameters(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalMongoDBChatDataSourceParameters DeserializeInternalMongoDBChatDataSourceParameters(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -150,147 +156,152 @@ internal static InternalMongoDBChatDataSourceParameters DeserializeInternalMongo int? strictness = default; int? maxSearchQueries = default; bool? allowPartialResult = default; - IList includeContexts = default; string endpoint = default; string databaseName = default; string collectionName = default; string appName = default; string indexName = default; + DataSourceFieldMappings fieldMappings = default; DataSourceAuthentication authentication = default; DataSourceVectorizer embeddingDependency = default; - DataSourceFieldMappings fieldsMapping = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IList internalIncludeContexts = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("top_n_documents"u8)) + if (prop.NameEquals("top_n_documents"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - topNDocuments = property.Value.GetInt32(); + topNDocuments = prop.Value.GetInt32(); continue; } - if (property.NameEquals("in_scope"u8)) + if (prop.NameEquals("in_scope"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - inScope = property.Value.GetBoolean(); + inScope = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("strictness"u8)) + if (prop.NameEquals("strictness"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - strictness = property.Value.GetInt32(); + strictness = prop.Value.GetInt32(); continue; } - if (property.NameEquals("max_search_queries"u8)) + if (prop.NameEquals("max_search_queries"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - maxSearchQueries = property.Value.GetInt32(); + maxSearchQueries = prop.Value.GetInt32(); continue; } - if (property.NameEquals("allow_partial_result"u8)) + if (prop.NameEquals("allow_partial_result"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - allowPartialResult = property.Value.GetBoolean(); + allowPartialResult = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("include_contexts"u8)) + if (prop.NameEquals("endpoint"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - includeContexts = array; + endpoint = prop.Value.GetString(); continue; } - if (property.NameEquals("endpoint"u8)) + if (prop.NameEquals("database_name"u8)) { - endpoint = property.Value.GetString(); + databaseName = prop.Value.GetString(); continue; } - if (property.NameEquals("database_name"u8)) + if (prop.NameEquals("collection_name"u8)) { - databaseName = property.Value.GetString(); + collectionName = prop.Value.GetString(); continue; } - if (property.NameEquals("collection_name"u8)) + if (prop.NameEquals("app_name"u8)) { - collectionName = property.Value.GetString(); + appName = prop.Value.GetString(); continue; } - if (property.NameEquals("app_name"u8)) + if (prop.NameEquals("index_name"u8)) { - appName = property.Value.GetString(); + indexName = prop.Value.GetString(); continue; } - if (property.NameEquals("index_name"u8)) + if (prop.NameEquals("fields_mapping"u8)) { - indexName = property.Value.GetString(); + fieldMappings = DataSourceFieldMappings.DeserializeDataSourceFieldMappings(prop.Value, options); continue; } - if (property.NameEquals("authentication"u8)) + if (prop.NameEquals("authentication"u8)) { - authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(property.Value, options); + authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(prop.Value, options); continue; } - if (property.NameEquals("embedding_dependency"u8)) + if (prop.NameEquals("embedding_dependency"u8)) { - embeddingDependency = DataSourceVectorizer.DeserializeDataSourceVectorizer(property.Value, options); + embeddingDependency = DataSourceVectorizer.DeserializeDataSourceVectorizer(prop.Value, options); continue; } - if (property.NameEquals("fields_mapping"u8)) + if (prop.NameEquals("include_contexts"u8)) { - fieldsMapping = DataSourceFieldMappings.DeserializeDataSourceFieldMappings(property.Value, options); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } + } + internalIncludeContexts = array; continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new InternalMongoDBChatDataSourceParameters( topNDocuments, inScope, strictness, maxSearchQueries, allowPartialResult, - includeContexts ?? new ChangeTrackingList(), endpoint, databaseName, collectionName, appName, indexName, + fieldMappings, authentication, embeddingDependency, - fieldsMapping, - serializedAdditionalRawData); + internalIncludeContexts, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -300,15 +311,16 @@ BinaryData IPersistableModel.Write(Mode } } - InternalMongoDBChatDataSourceParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalMongoDBChatDataSourceParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected virtual InternalMongoDBChatDataSourceParameters PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalMongoDBChatDataSourceParameters(document.RootElement, options); } default: @@ -318,18 +330,20 @@ InternalMongoDBChatDataSourceParameters IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalMongoDBChatDataSourceParameters FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalMongoDBChatDataSourceParameters internalMongoDBChatDataSourceParameters) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalMongoDBChatDataSourceParameters(document.RootElement); + if (internalMongoDBChatDataSourceParameters == null) + { + return null; + } + return BinaryContent.Create(internalMongoDBChatDataSourceParameters, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + public static explicit operator InternalMongoDBChatDataSourceParameters(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalMongoDBChatDataSourceParameters(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.cs index 5b79c3c25..8f34af30b 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.cs @@ -4,177 +4,80 @@ using System; using System.Collections.Generic; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// The MongoDBChatDataSourceParameters. internal partial class InternalMongoDBChatDataSourceParameters { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// The name of the MongoDB cluster endpoint. - /// The name of the MongoDB database. - /// The name of the MongoDB collection. - /// The name of the MongoDB application. - /// The name of the MongoDB index. - /// - /// The authentication mechanism to use with Pinecone. - /// Supported authentication mechanisms for Pinecone include: username and password. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// The vectorization source to use as an embedding dependency for the MongoDB data source. - /// Supported vectorization sources for MongoDB include: endpoint, deployment name. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// Field mappings to apply to data used by the MongoDB data source. - /// Note that content and vector field mappings are required for MongoDB. - /// - /// , , , , , , or is null. - public InternalMongoDBChatDataSourceParameters(string endpoint, string databaseName, string collectionName, string appName, string indexName, DataSourceAuthentication authentication, DataSourceVectorizer embeddingDependency, DataSourceFieldMappings fieldMappings) + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + + public InternalMongoDBChatDataSourceParameters(string endpoint, string databaseName, string collectionName, string appName, string indexName, DataSourceFieldMappings fieldMappings, DataSourceAuthentication authentication, DataSourceVectorizer embeddingDependency) { Argument.AssertNotNull(endpoint, nameof(endpoint)); Argument.AssertNotNull(databaseName, nameof(databaseName)); Argument.AssertNotNull(collectionName, nameof(collectionName)); Argument.AssertNotNull(appName, nameof(appName)); Argument.AssertNotNull(indexName, nameof(indexName)); + Argument.AssertNotNull(fieldMappings, nameof(fieldMappings)); Argument.AssertNotNull(authentication, nameof(authentication)); Argument.AssertNotNull(embeddingDependency, nameof(embeddingDependency)); - Argument.AssertNotNull(fieldMappings, nameof(fieldMappings)); - _internalIncludeContexts = new ChangeTrackingList(); Endpoint = endpoint; DatabaseName = databaseName; CollectionName = collectionName; AppName = appName; IndexName = indexName; + FieldMappings = fieldMappings; Authentication = authentication; EmbeddingDependency = embeddingDependency; - FieldMappings = fieldMappings; + _internalIncludeContexts = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The configured number of documents to feature in the query. - /// Whether queries should be restricted to use of the indexed data. - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// - /// - /// The output context properties to include on the response. - /// By default, citations and intent will be requested. - /// - /// The name of the MongoDB cluster endpoint. - /// The name of the MongoDB database. - /// The name of the MongoDB collection. - /// The name of the MongoDB application. - /// The name of the MongoDB index. - /// - /// The authentication mechanism to use with Pinecone. - /// Supported authentication mechanisms for Pinecone include: username and password. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// The vectorization source to use as an embedding dependency for the MongoDB data source. - /// Supported vectorization sources for MongoDB include: endpoint, deployment name. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// Field mappings to apply to data used by the MongoDB data source. - /// Note that content and vector field mappings are required for MongoDB. - /// - /// Keeps track of any properties unknown to the library. - internal InternalMongoDBChatDataSourceParameters(int? topNDocuments, bool? inScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, IList internalIncludeContexts, string endpoint, string databaseName, string collectionName, string appName, string indexName, DataSourceAuthentication authentication, DataSourceVectorizer embeddingDependency, DataSourceFieldMappings fieldMappings, IDictionary serializedAdditionalRawData) + internal InternalMongoDBChatDataSourceParameters(int? topNDocuments, bool? inScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, string endpoint, string databaseName, string collectionName, string appName, string indexName, DataSourceFieldMappings fieldMappings, DataSourceAuthentication authentication, DataSourceVectorizer embeddingDependency, IList internalIncludeContexts, IDictionary additionalBinaryDataProperties) { TopNDocuments = topNDocuments; InScope = inScope; Strictness = strictness; MaxSearchQueries = maxSearchQueries; AllowPartialResult = allowPartialResult; - _internalIncludeContexts = internalIncludeContexts; Endpoint = endpoint; DatabaseName = databaseName; CollectionName = collectionName; AppName = appName; IndexName = indexName; + FieldMappings = fieldMappings; Authentication = authentication; EmbeddingDependency = embeddingDependency; - FieldMappings = fieldMappings; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InternalMongoDBChatDataSourceParameters() - { + _internalIncludeContexts = internalIncludeContexts; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// The configured number of documents to feature in the query. public int? TopNDocuments { get; set; } - /// Whether queries should be restricted to use of the indexed data. + public bool? InScope { get; set; } - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// + public int? Strictness { get; set; } - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// + public int? MaxSearchQueries { get; set; } - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// + public bool? AllowPartialResult { get; set; } - /// The name of the MongoDB cluster endpoint. + internal string Endpoint { get; set; } - /// The name of the MongoDB database. + internal string DatabaseName { get; set; } - /// The name of the MongoDB collection. + internal string CollectionName { get; set; } - /// The name of the MongoDB application. + internal string AppName { get; set; } - /// The name of the MongoDB index. + internal string IndexName { get; set; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs index d8ebc8873..7c3ffe244 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs @@ -7,11 +7,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalPineconeChatDataSourceParameters : IJsonModel { + internal InternalPineconeChatDataSourceParameters() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,79 +24,81 @@ void IJsonModel.Write(Utf8JsonWriter w writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalPineconeChatDataSourceParameters)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) + if (Optional.IsDefined(TopNDocuments) && _additionalBinaryDataProperties?.ContainsKey("top_n_documents") != true) { writer.WritePropertyName("top_n_documents"u8); writer.WriteNumberValue(TopNDocuments.Value); } - if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) + if (Optional.IsDefined(InScope) && _additionalBinaryDataProperties?.ContainsKey("in_scope") != true) { writer.WritePropertyName("in_scope"u8); writer.WriteBooleanValue(InScope.Value); } - if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) + if (Optional.IsDefined(Strictness) && _additionalBinaryDataProperties?.ContainsKey("strictness") != true) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) + if (Optional.IsDefined(MaxSearchQueries) && _additionalBinaryDataProperties?.ContainsKey("max_search_queries") != true) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) + if (Optional.IsDefined(AllowPartialResult) && _additionalBinaryDataProperties?.ContainsKey("allow_partial_result") != true) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) - { - writer.WritePropertyName("include_contexts"u8); - writer.WriteStartArray(); - foreach (var item in _internalIncludeContexts) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (SerializedAdditionalRawData?.ContainsKey("environment") != true) + if (_additionalBinaryDataProperties?.ContainsKey("environment") != true) { writer.WritePropertyName("environment"u8); writer.WriteStringValue(Environment); } - if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) + if (_additionalBinaryDataProperties?.ContainsKey("index_name") != true) { writer.WritePropertyName("index_name"u8); writer.WriteStringValue(IndexName); } - if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + if (_additionalBinaryDataProperties?.ContainsKey("authentication") != true) { writer.WritePropertyName("authentication"u8); writer.WriteObjectValue(Authentication, options); } - if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true) + if (_additionalBinaryDataProperties?.ContainsKey("fields_mapping") != true) + { + writer.WritePropertyName("fields_mapping"u8); + writer.WriteObjectValue(FieldMappings, options); + } + if (_additionalBinaryDataProperties?.ContainsKey("embedding_dependency") != true) { writer.WritePropertyName("embedding_dependency"u8); writer.WriteObjectValue(VectorizationSource, options); } - if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true) + if (Optional.IsCollectionDefined(_internalIncludeContexts) && _additionalBinaryDataProperties?.ContainsKey("include_contexts") != true) { - writer.WritePropertyName("fields_mapping"u8); - writer.WriteObjectValue(FieldMappings, options); + writer.WritePropertyName("include_contexts"u8); + writer.WriteStartArray(); + foreach (string item in _internalIncludeContexts) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -99,7 +106,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -110,22 +117,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - InternalPineconeChatDataSourceParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalPineconeChatDataSourceParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected virtual InternalPineconeChatDataSourceParameters JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(InternalPineconeChatDataSourceParameters)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeInternalPineconeChatDataSourceParameters(document.RootElement, options); } - internal static InternalPineconeChatDataSourceParameters DeserializeInternalPineconeChatDataSourceParameters(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalPineconeChatDataSourceParameters DeserializeInternalPineconeChatDataSourceParameters(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -135,126 +141,131 @@ internal static InternalPineconeChatDataSourceParameters DeserializeInternalPine int? strictness = default; int? maxSearchQueries = default; bool? allowPartialResult = default; - IList includeContexts = default; string environment = default; string indexName = default; DataSourceAuthentication authentication = default; - DataSourceVectorizer embeddingDependency = default; - DataSourceFieldMappings fieldsMapping = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + DataSourceFieldMappings fieldMappings = default; + DataSourceVectorizer vectorizationSource = default; + IList internalIncludeContexts = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("top_n_documents"u8)) + if (prop.NameEquals("top_n_documents"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - topNDocuments = property.Value.GetInt32(); + topNDocuments = prop.Value.GetInt32(); continue; } - if (property.NameEquals("in_scope"u8)) + if (prop.NameEquals("in_scope"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - inScope = property.Value.GetBoolean(); + inScope = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("strictness"u8)) + if (prop.NameEquals("strictness"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - strictness = property.Value.GetInt32(); + strictness = prop.Value.GetInt32(); continue; } - if (property.NameEquals("max_search_queries"u8)) + if (prop.NameEquals("max_search_queries"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - maxSearchQueries = property.Value.GetInt32(); + maxSearchQueries = prop.Value.GetInt32(); continue; } - if (property.NameEquals("allow_partial_result"u8)) + if (prop.NameEquals("allow_partial_result"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - allowPartialResult = property.Value.GetBoolean(); + allowPartialResult = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("include_contexts"u8)) + if (prop.NameEquals("environment"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - includeContexts = array; + environment = prop.Value.GetString(); continue; } - if (property.NameEquals("environment"u8)) + if (prop.NameEquals("index_name"u8)) { - environment = property.Value.GetString(); + indexName = prop.Value.GetString(); continue; } - if (property.NameEquals("index_name"u8)) + if (prop.NameEquals("authentication"u8)) { - indexName = property.Value.GetString(); + authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(prop.Value, options); continue; } - if (property.NameEquals("authentication"u8)) + if (prop.NameEquals("fields_mapping"u8)) { - authentication = DataSourceAuthentication.DeserializeDataSourceAuthentication(property.Value, options); + fieldMappings = DataSourceFieldMappings.DeserializeDataSourceFieldMappings(prop.Value, options); continue; } - if (property.NameEquals("embedding_dependency"u8)) + if (prop.NameEquals("embedding_dependency"u8)) { - embeddingDependency = DataSourceVectorizer.DeserializeDataSourceVectorizer(property.Value, options); + vectorizationSource = DataSourceVectorizer.DeserializeDataSourceVectorizer(prop.Value, options); continue; } - if (property.NameEquals("fields_mapping"u8)) + if (prop.NameEquals("include_contexts"u8)) { - fieldsMapping = DataSourceFieldMappings.DeserializeDataSourceFieldMappings(property.Value, options); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } + } + internalIncludeContexts = array; continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new InternalPineconeChatDataSourceParameters( topNDocuments, inScope, strictness, maxSearchQueries, allowPartialResult, - includeContexts ?? new ChangeTrackingList(), environment, indexName, authentication, - embeddingDependency, - fieldsMapping, - serializedAdditionalRawData); + fieldMappings, + vectorizationSource, + internalIncludeContexts, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -264,15 +275,16 @@ BinaryData IPersistableModel.Write(Mod } } - InternalPineconeChatDataSourceParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + InternalPineconeChatDataSourceParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected virtual InternalPineconeChatDataSourceParameters PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeInternalPineconeChatDataSourceParameters(document.RootElement, options); } default: @@ -282,18 +294,20 @@ InternalPineconeChatDataSourceParameters IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static InternalPineconeChatDataSourceParameters FromResponse(PipelineResponse response) + public static implicit operator BinaryContent(InternalPineconeChatDataSourceParameters internalPineconeChatDataSourceParameters) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalPineconeChatDataSourceParameters(document.RootElement); + if (internalPineconeChatDataSourceParameters == null) + { + return null; + } + return BinaryContent.Create(internalPineconeChatDataSourceParameters, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + public static explicit operator InternalPineconeChatDataSourceParameters(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeInternalPineconeChatDataSourceParameters(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs index a559fbb2e..d16b93871 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs @@ -4,156 +4,65 @@ using System; using System.Collections.Generic; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { - /// The PineconeChatDataSourceParameters. internal partial class InternalPineconeChatDataSourceParameters { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . - /// The environment name to use with Pinecone. - /// The name of the Pinecone database index to use. - /// - /// The authentication mechanism to use with Pinecone. - /// Supported authentication mechanisms for Pinecone include: API key. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// The vectorization source to use as an embedding dependency for the Pinecone data source. - /// Supported vectorization sources for Pinecone include: deployment name. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// Field mappings to apply to data used by the Pinecone data source. - /// Note that content field mappings are required for Pinecone. - /// - /// , , , or is null. - public InternalPineconeChatDataSourceParameters(string environment, string indexName, DataSourceAuthentication authentication, DataSourceVectorizer vectorizationSource, DataSourceFieldMappings fieldMappings) + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + + public InternalPineconeChatDataSourceParameters(string environment, string indexName, DataSourceAuthentication authentication, DataSourceFieldMappings fieldMappings, DataSourceVectorizer vectorizationSource) { Argument.AssertNotNull(environment, nameof(environment)); Argument.AssertNotNull(indexName, nameof(indexName)); Argument.AssertNotNull(authentication, nameof(authentication)); - Argument.AssertNotNull(vectorizationSource, nameof(vectorizationSource)); Argument.AssertNotNull(fieldMappings, nameof(fieldMappings)); + Argument.AssertNotNull(vectorizationSource, nameof(vectorizationSource)); - _internalIncludeContexts = new ChangeTrackingList(); Environment = environment; IndexName = indexName; Authentication = authentication; - VectorizationSource = vectorizationSource; FieldMappings = fieldMappings; + VectorizationSource = vectorizationSource; + _internalIncludeContexts = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The configured number of documents to feature in the query. - /// Whether queries should be restricted to use of the indexed data. - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// - /// - /// The output context properties to include on the response. - /// By default, citations and intent will be requested. - /// - /// The environment name to use with Pinecone. - /// The name of the Pinecone database index to use. - /// - /// The authentication mechanism to use with Pinecone. - /// Supported authentication mechanisms for Pinecone include: API key. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// The vectorization source to use as an embedding dependency for the Pinecone data source. - /// Supported vectorization sources for Pinecone include: deployment name. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. - /// - /// - /// Field mappings to apply to data used by the Pinecone data source. - /// Note that content field mappings are required for Pinecone. - /// - /// Keeps track of any properties unknown to the library. - internal InternalPineconeChatDataSourceParameters(int? topNDocuments, bool? inScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, IList internalIncludeContexts, string environment, string indexName, DataSourceAuthentication authentication, DataSourceVectorizer vectorizationSource, DataSourceFieldMappings fieldMappings, IDictionary serializedAdditionalRawData) + internal InternalPineconeChatDataSourceParameters(int? topNDocuments, bool? inScope, int? strictness, int? maxSearchQueries, bool? allowPartialResult, string environment, string indexName, DataSourceAuthentication authentication, DataSourceFieldMappings fieldMappings, DataSourceVectorizer vectorizationSource, IList internalIncludeContexts, IDictionary additionalBinaryDataProperties) { TopNDocuments = topNDocuments; InScope = inScope; Strictness = strictness; MaxSearchQueries = maxSearchQueries; AllowPartialResult = allowPartialResult; - _internalIncludeContexts = internalIncludeContexts; Environment = environment; IndexName = indexName; Authentication = authentication; - VectorizationSource = vectorizationSource; FieldMappings = fieldMappings; - SerializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal InternalPineconeChatDataSourceParameters() - { + VectorizationSource = vectorizationSource; + _internalIncludeContexts = internalIncludeContexts; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// The configured number of documents to feature in the query. public int? TopNDocuments { get; set; } - /// Whether queries should be restricted to use of the indexed data. + public bool? InScope { get; set; } - /// - /// The configured strictness of the search relevance filtering. - /// Higher strictness will increase precision but lower recall of the answer. - /// + public int? Strictness { get; set; } - /// - /// The maximum number of rewritten queries that should be sent to the search provider for a single user message. - /// By default, the system will make an automatic determination. - /// + public int? MaxSearchQueries { get; set; } - /// - /// If set to true, the system will allow partial search results to be used and the request will fail if all - /// partial queries fail. If not specified or specified as false, the request will fail if any search query fails. - /// + public bool? AllowPartialResult { get; set; } - /// The environment name to use with Pinecone. + internal string Environment { get; set; } - /// The name of the Pinecone database index to use. + internal string IndexName { get; set; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs index d1e1ef815..a07d42685 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs @@ -3,15 +3,19 @@ #nullable disable using System; -using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalUnknownAzureChatDataSource : IJsonModel { + internal InternalUnknownAzureChatDataSource() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,63 +23,57 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ChatDataSource)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - ChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected override ChatDataSource JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ChatDataSource)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeChatDataSource(document.RootElement, options); } - internal static InternalUnknownAzureChatDataSource DeserializeInternalUnknownAzureChatDataSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalUnknownAzureChatDataSource DeserializeInternalUnknownAzureChatDataSource(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string type = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string @type = "unknown"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalUnknownAzureChatDataSource(type, serializedAdditionalRawData); + return new InternalUnknownAzureChatDataSource(@type, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -85,15 +83,16 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions opti } } - ChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + ChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected override ChatDataSource PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeChatDataSource(document.RootElement, options); } default: @@ -102,19 +101,5 @@ ChatDataSource IPersistableModel.Create(BinaryData data, ModelRe } string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalUnknownAzureChatDataSource FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalUnknownAzureChatDataSource(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.cs index 4d8d34f5d..4b8afdf9d 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.cs @@ -7,18 +7,9 @@ namespace Azure.AI.OpenAI.Chat { - /// Unknown version of AzureChatDataSource. internal partial class InternalUnknownAzureChatDataSource : ChatDataSource { - /// Initializes a new instance of . - /// The differentiating type identifier for the data source. - /// Keeps track of any properties unknown to the library. - internal InternalUnknownAzureChatDataSource(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal InternalUnknownAzureChatDataSource() + internal InternalUnknownAzureChatDataSource(string @type, IDictionary additionalBinaryDataProperties) : base(@type ?? "unknown", additionalBinaryDataProperties) { } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs index 368b24719..21aaab7d4 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs @@ -3,15 +3,19 @@ #nullable disable using System; -using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalUnknownAzureChatDataSourceAuthenticationOptions : IJsonModel { + internal InternalUnknownAzureChatDataSourceAuthenticationOptions() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,63 +23,57 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DataSourceAuthentication)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - DataSourceAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DataSourceAuthentication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected override DataSourceAuthentication JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DataSourceAuthentication)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDataSourceAuthentication(document.RootElement, options); } - internal static InternalUnknownAzureChatDataSourceAuthenticationOptions DeserializeInternalUnknownAzureChatDataSourceAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalUnknownAzureChatDataSourceAuthenticationOptions DeserializeInternalUnknownAzureChatDataSourceAuthenticationOptions(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string type = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string @type = "unknown"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalUnknownAzureChatDataSourceAuthenticationOptions(type, serializedAdditionalRawData); + return new InternalUnknownAzureChatDataSourceAuthenticationOptions(@type, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -85,15 +83,16 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp } } - DataSourceAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + DataSourceAuthentication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected override DataSourceAuthentication PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeDataSourceAuthentication(document.RootElement, options); } default: @@ -102,19 +101,5 @@ DataSourceAuthentication IPersistableModel.Create(Bina } string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalUnknownAzureChatDataSourceAuthenticationOptions FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalUnknownAzureChatDataSourceAuthenticationOptions(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs index df4ea2dad..fefb20709 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs @@ -7,18 +7,9 @@ namespace Azure.AI.OpenAI.Chat { - /// Unknown version of AzureChatDataSourceAuthenticationOptions. internal partial class InternalUnknownAzureChatDataSourceAuthenticationOptions : DataSourceAuthentication { - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal InternalUnknownAzureChatDataSourceAuthenticationOptions(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal InternalUnknownAzureChatDataSourceAuthenticationOptions() + internal InternalUnknownAzureChatDataSourceAuthenticationOptions(string @type, IDictionary additionalBinaryDataProperties) : base(@type ?? "unknown", additionalBinaryDataProperties) { } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs index 164dcbe06..cb3a779a6 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs @@ -3,15 +3,19 @@ #nullable disable using System; -using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { internal partial class InternalUnknownAzureChatDataSourceVectorizationSource : IJsonModel { + internal InternalUnknownAzureChatDataSourceVectorizationSource() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -19,63 +23,57 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WriteEndObject(); } - /// The JSON writer. - /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DataSourceVectorizer)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - DataSourceVectorizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DataSourceVectorizer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + protected override DataSourceVectorizer JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DataSourceVectorizer)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDataSourceVectorizer(document.RootElement, options); } - internal static InternalUnknownAzureChatDataSourceVectorizationSource DeserializeInternalUnknownAzureChatDataSourceVectorizationSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalUnknownAzureChatDataSourceVectorizationSource DeserializeInternalUnknownAzureChatDataSourceVectorizationSource(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string type = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string @type = "unknown"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("type"u8)) + if (prop.NameEquals("type"u8)) { - type = property.Value.GetString(); + @type = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new InternalUnknownAzureChatDataSourceVectorizationSource(type, serializedAdditionalRawData); + return new InternalUnknownAzureChatDataSourceVectorizationSource(@type, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -85,15 +83,16 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - DataSourceVectorizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + DataSourceVectorizer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + protected override DataSourceVectorizer PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeDataSourceVectorizer(document.RootElement, options); } default: @@ -102,19 +101,5 @@ DataSourceVectorizer IPersistableModel.Create(BinaryData d } string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new InternalUnknownAzureChatDataSourceVectorizationSource FromResponse(PipelineResponse response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeInternalUnknownAzureChatDataSourceVectorizationSource(document.RootElement); - } - - /// Convert into a . - internal override BinaryContent ToBinaryContent() - { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); - } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.cs index 6b9910a12..2f85fedc7 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.cs @@ -7,18 +7,9 @@ namespace Azure.AI.OpenAI.Chat { - /// Unknown version of AzureChatDataSourceVectorizationSource. internal partial class InternalUnknownAzureChatDataSourceVectorizationSource : DataSourceVectorizer { - /// Initializes a new instance of . - /// The differentiating identifier for the concrete vectorization source. - /// Keeps track of any properties unknown to the library. - internal InternalUnknownAzureChatDataSourceVectorizationSource(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal InternalUnknownAzureChatDataSourceVectorizationSource() + internal InternalUnknownAzureChatDataSourceVectorizationSource(string @type, IDictionary additionalBinaryDataProperties) : base(@type ?? "unknown", additionalBinaryDataProperties) { } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.Serialization.cs index 9c68f12b6..e11ef4f71 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.Serialization.cs @@ -7,9 +7,11 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { + /// public partial class MongoDBChatDataSource : IJsonModel { void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -23,70 +25,69 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MongoDBChatDataSource)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) + if (_additionalBinaryDataProperties?.ContainsKey("parameters") != true) { writer.WritePropertyName("parameters"u8); writer.WriteObjectValue(InternalParameters, options); } } - MongoDBChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MongoDBChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (MongoDBChatDataSource)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ChatDataSource JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(MongoDBChatDataSource)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeMongoDBChatDataSource(document.RootElement, options); } - internal static MongoDBChatDataSource DeserializeMongoDBChatDataSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static MongoDBChatDataSource DeserializeMongoDBChatDataSource(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - InternalMongoDBChatDataSourceParameters parameters = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string @type = "mongo_db"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + InternalMongoDBChatDataSourceParameters internalParameters = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("parameters"u8)) + if (prop.NameEquals("type"u8)) { - parameters = InternalMongoDBChatDataSourceParameters.DeserializeInternalMongoDBChatDataSourceParameters(property.Value, options); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("parameters"u8)) { - type = property.Value.GetString(); + internalParameters = InternalMongoDBChatDataSourceParameters.DeserializeInternalMongoDBChatDataSourceParameters(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new MongoDBChatDataSource(type, serializedAdditionalRawData, parameters); + return new MongoDBChatDataSource(@type, additionalBinaryDataProperties, internalParameters); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -96,15 +97,18 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio } } - MongoDBChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + MongoDBChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (MongoDBChatDataSource)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ChatDataSource PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeMongoDBChatDataSource(document.RootElement, options); } default: @@ -114,18 +118,22 @@ MongoDBChatDataSource IPersistableModel.Create(BinaryData string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new MongoDBChatDataSource FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(MongoDBChatDataSource mongoDBChatDataSource) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMongoDBChatDataSource(document.RootElement); + if (mongoDBChatDataSource == null) + { + return null; + } + return BinaryContent.Create(mongoDBChatDataSource, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator MongoDBChatDataSource(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeMongoDBChatDataSource(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.cs index 9a483cc28..ff06412c6 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.cs @@ -2,9 +2,6 @@ #nullable disable -using System; -using System.Collections.Generic; - namespace Azure.AI.OpenAI.Chat { /// The MongoDBChatDataSource. diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs index 578dc5248..2c7145e34 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs @@ -7,9 +7,11 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; +using Azure.AI.OpenAI; namespace Azure.AI.OpenAI.Chat { + /// public partial class PineconeChatDataSource : IJsonModel { void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -23,70 +25,69 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(PineconeChatDataSource)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) + if (_additionalBinaryDataProperties?.ContainsKey("parameters") != true) { writer.WritePropertyName("parameters"u8); writer.WriteObjectValue(InternalParameters, options); } } - PineconeChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + PineconeChatDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (PineconeChatDataSource)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ChatDataSource JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(PineconeChatDataSource)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializePineconeChatDataSource(document.RootElement, options); } - internal static PineconeChatDataSource DeserializePineconeChatDataSource(JsonElement element, ModelReaderWriterOptions options = null) + internal static PineconeChatDataSource DeserializePineconeChatDataSource(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - InternalPineconeChatDataSourceParameters parameters = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string @type = "pinecone"; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + InternalPineconeChatDataSourceParameters internalParameters = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("parameters"u8)) + if (prop.NameEquals("type"u8)) { - parameters = InternalPineconeChatDataSourceParameters.DeserializeInternalPineconeChatDataSourceParameters(property.Value, options); + @type = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("parameters"u8)) { - type = property.Value.GetString(); + internalParameters = InternalPineconeChatDataSourceParameters.DeserializeInternalPineconeChatDataSourceParameters(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new PineconeChatDataSource(type, serializedAdditionalRawData, parameters); + return new PineconeChatDataSource(@type, additionalBinaryDataProperties, internalParameters); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -96,15 +97,18 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti } } - PineconeChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + PineconeChatDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (PineconeChatDataSource)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ChatDataSource PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializePineconeChatDataSource(document.RootElement, options); } default: @@ -114,18 +118,22 @@ PineconeChatDataSource IPersistableModel.Create(BinaryDa string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new PineconeChatDataSource FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(PineconeChatDataSource pineconeChatDataSource) { - using var document = JsonDocument.Parse(response.Content); - return DeserializePineconeChatDataSource(document.RootElement); + if (pineconeChatDataSource == null) + { + return null; + } + return BinaryContent.Create(pineconeChatDataSource, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator PineconeChatDataSource(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializePineconeChatDataSource(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs index 213c4559c..ab9f57629 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs @@ -2,9 +2,6 @@ #nullable disable -using System; -using System.Collections.Generic; - namespace Azure.AI.OpenAI.Chat { /// The PineconeChatDataSource. diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.Serialization.cs index d497337e1..079ba11a4 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.Serialization.cs @@ -10,6 +10,7 @@ namespace Azure.AI.OpenAI { + /// public partial class RequestContentFilterResult : IJsonModel { void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -23,25 +24,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(RequestContentFilterResult)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("prompt_index") != true && Optional.IsDefined(PromptIndex)) + if (Optional.IsDefined(PromptIndex) && _additionalBinaryDataProperties?.ContainsKey("prompt_index") != true) { writer.WritePropertyName("prompt_index"u8); writer.WriteNumberValue(PromptIndex.Value); } - if (SerializedAdditionalRawData?.ContainsKey("content_filter_results") != true && Optional.IsDefined(InternalResults)) + if (Optional.IsDefined(InternalResults) && _additionalBinaryDataProperties?.ContainsKey("content_filter_results") != true) { writer.WritePropertyName("content_filter_results"u8); writer.WriteObjectValue(InternalResults, options); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -49,7 +49,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -60,64 +60,64 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - RequestContentFilterResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RequestContentFilterResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual RequestContentFilterResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(RequestContentFilterResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeRequestContentFilterResult(document.RootElement, options); } - internal static RequestContentFilterResult DeserializeRequestContentFilterResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static RequestContentFilterResult DeserializeRequestContentFilterResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } int? promptIndex = default; - InternalAzureContentFilterResultForPromptContentFilterResults contentFilterResults = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + InternalAzureContentFilterResultForPromptContentFilterResults internalResults = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("prompt_index"u8)) + if (prop.NameEquals("prompt_index"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - promptIndex = property.Value.GetInt32(); + promptIndex = prop.Value.GetInt32(); continue; } - if (property.NameEquals("content_filter_results"u8)) + if (prop.NameEquals("content_filter_results"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - contentFilterResults = InternalAzureContentFilterResultForPromptContentFilterResults.DeserializeInternalAzureContentFilterResultForPromptContentFilterResults(property.Value, options); + internalResults = InternalAzureContentFilterResultForPromptContentFilterResults.DeserializeInternalAzureContentFilterResultForPromptContentFilterResults(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new RequestContentFilterResult(promptIndex, contentFilterResults, serializedAdditionalRawData); + return new RequestContentFilterResult(promptIndex, internalResults, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -127,15 +127,18 @@ BinaryData IPersistableModel.Write(ModelReaderWriter } } - RequestContentFilterResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + RequestContentFilterResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual RequestContentFilterResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeRequestContentFilterResult(document.RootElement, options); } default: @@ -145,18 +148,22 @@ RequestContentFilterResult IPersistableModel.Create( string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static RequestContentFilterResult FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(RequestContentFilterResult requestContentFilterResult) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRequestContentFilterResult(document.RootElement); + if (requestContentFilterResult == null) + { + return null; + } + return BinaryContent.Create(requestContentFilterResult, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator RequestContentFilterResult(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeRequestContentFilterResult(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.cs index 74a54e015..6910e83fd 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.cs @@ -10,51 +10,24 @@ namespace Azure.AI.OpenAI /// A content filter result associated with a single input prompt item into a generative AI system. public partial class RequestContentFilterResult { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal RequestContentFilterResult() { } - /// Initializes a new instance of . - /// The index of the input prompt associated with the accompanying content filter result categories. - /// The content filter category details for the result. - /// Keeps track of any properties unknown to the library. - internal RequestContentFilterResult(int? promptIndex, InternalAzureContentFilterResultForPromptContentFilterResults internalResults, IDictionary serializedAdditionalRawData) + internal RequestContentFilterResult(int? promptIndex, InternalAzureContentFilterResultForPromptContentFilterResults internalResults, IDictionary additionalBinaryDataProperties) { PromptIndex = promptIndex; InternalResults = internalResults; - SerializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.Serialization.cs index 365cc7c87..844fd9b42 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.Serialization.cs @@ -10,8 +10,13 @@ namespace Azure.AI.OpenAI { + /// public partial class RequestImageContentFilterResult : IJsonModel { + internal RequestImageContentFilterResult() + { + } + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -23,142 +28,141 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(RequestImageContentFilterResult)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (SerializedAdditionalRawData?.ContainsKey("profanity") != true && Optional.IsDefined(Profanity)) + if (Optional.IsDefined(Profanity) && _additionalBinaryDataProperties?.ContainsKey("profanity") != true) { writer.WritePropertyName("profanity"u8); writer.WriteObjectValue(Profanity, options); } - if (SerializedAdditionalRawData?.ContainsKey("custom_blocklists") != true && Optional.IsDefined(CustomBlocklists)) + if (Optional.IsDefined(CustomBlocklists) && _additionalBinaryDataProperties?.ContainsKey("custom_blocklists") != true) { writer.WritePropertyName("custom_blocklists"u8); writer.WriteObjectValue(CustomBlocklists, options); } - if (SerializedAdditionalRawData?.ContainsKey("jailbreak") != true) + if (_additionalBinaryDataProperties?.ContainsKey("jailbreak") != true) { writer.WritePropertyName("jailbreak"u8); writer.WriteObjectValue(Jailbreak, options); } } - RequestImageContentFilterResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RequestImageContentFilterResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (RequestImageContentFilterResult)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override ResponseImageContentFilterResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(RequestImageContentFilterResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeRequestImageContentFilterResult(document.RootElement, options); } - internal static RequestImageContentFilterResult DeserializeRequestImageContentFilterResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static RequestImageContentFilterResult DeserializeRequestImageContentFilterResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - ContentFilterDetectionResult profanity = default; - ContentFilterBlocklistResult customBlocklists = default; - ContentFilterDetectionResult jailbreak = default; ContentFilterSeverityResult sexual = default; ContentFilterSeverityResult violence = default; ContentFilterSeverityResult hate = default; ContentFilterSeverityResult selfHarm = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + ContentFilterDetectionResult profanity = default; + ContentFilterBlocklistResult customBlocklists = default; + ContentFilterDetectionResult jailbreak = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("profanity"u8)) + if (prop.NameEquals("sexual"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - profanity = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(property.Value, options); + sexual = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(prop.Value, options); continue; } - if (property.NameEquals("custom_blocklists"u8)) + if (prop.NameEquals("violence"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - customBlocklists = ContentFilterBlocklistResult.DeserializeContentFilterBlocklistResult(property.Value, options); + violence = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(prop.Value, options); continue; } - if (property.NameEquals("jailbreak"u8)) + if (prop.NameEquals("hate"u8)) { - jailbreak = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(property.Value, options); - continue; - } - if (property.NameEquals("sexual"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - sexual = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + hate = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(prop.Value, options); continue; } - if (property.NameEquals("violence"u8)) + if (prop.NameEquals("self_harm"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - violence = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + selfHarm = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(prop.Value, options); continue; } - if (property.NameEquals("hate"u8)) + if (prop.NameEquals("profanity"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - hate = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + profanity = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(prop.Value, options); continue; } - if (property.NameEquals("self_harm"u8)) + if (prop.NameEquals("custom_blocklists"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - selfHarm = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + customBlocklists = ContentFilterBlocklistResult.DeserializeContentFilterBlocklistResult(prop.Value, options); + continue; + } + if (prop.NameEquals("jailbreak"u8)) + { + jailbreak = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new RequestImageContentFilterResult( sexual, violence, hate, selfHarm, - serializedAdditionalRawData, + additionalBinaryDataProperties, profanity, customBlocklists, jailbreak); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -168,15 +172,18 @@ BinaryData IPersistableModel.Write(ModelReaderW } } - RequestImageContentFilterResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + RequestImageContentFilterResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (RequestImageContentFilterResult)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override ResponseImageContentFilterResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeRequestImageContentFilterResult(document.RootElement, options); } default: @@ -186,18 +193,22 @@ RequestImageContentFilterResult IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static new RequestImageContentFilterResult FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(RequestImageContentFilterResult requestImageContentFilterResult) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRequestImageContentFilterResult(document.RootElement); + if (requestImageContentFilterResult == null) + { + return null; + } + return BinaryContent.Create(requestImageContentFilterResult, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal override BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator RequestImageContentFilterResult(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeRequestImageContentFilterResult(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.cs index e41fc322b..7fa092e11 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.cs @@ -10,71 +10,27 @@ namespace Azure.AI.OpenAI /// A content filter result for an image generation operation's input request content. public partial class RequestImageContentFilterResult : ResponseImageContentFilterResult { - /// Initializes a new instance of . - /// - /// A detection result that describes user prompt injection attacks, where malicious users deliberately exploit - /// system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content - /// generation or violations of system-imposed restrictions. - /// - /// is null. internal RequestImageContentFilterResult(ContentFilterDetectionResult jailbreak) { - Argument.AssertNotNull(jailbreak, nameof(jailbreak)); - Jailbreak = jailbreak; } - /// Initializes a new instance of . - /// - /// A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - /// portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - /// assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - /// - /// - /// A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - /// someone or something; describes weapons, guns and related entities, such as manufactures, associations, - /// legislation, and so on. - /// - /// - /// A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - /// language with reference to a person or identity group based on certain differentiating attributes of these groups - /// including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - /// religion, immigration status, ability status, personal appearance, and body size. - /// - /// - /// A content filter category that describes language related to physical actions intended to purposely hurt, injure, - /// damage one's body or kill oneself. - /// - /// Keeps track of any properties unknown to the library. - /// - /// A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the - /// content. - /// - /// A collection of binary filtering outcomes for configured custom blocklists. - /// - /// A detection result that describes user prompt injection attacks, where malicious users deliberately exploit - /// system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content - /// generation or violations of system-imposed restrictions. - /// - internal RequestImageContentFilterResult(ContentFilterSeverityResult sexual, ContentFilterSeverityResult violence, ContentFilterSeverityResult hate, ContentFilterSeverityResult selfHarm, IDictionary serializedAdditionalRawData, ContentFilterDetectionResult profanity, ContentFilterBlocklistResult customBlocklists, ContentFilterDetectionResult jailbreak) : base(sexual, violence, hate, selfHarm, serializedAdditionalRawData) + internal RequestImageContentFilterResult(ContentFilterSeverityResult sexual, ContentFilterSeverityResult violence, ContentFilterSeverityResult hate, ContentFilterSeverityResult selfHarm, IDictionary additionalBinaryDataProperties, ContentFilterDetectionResult profanity, ContentFilterBlocklistResult customBlocklists, ContentFilterDetectionResult jailbreak) : base(sexual, violence, hate, selfHarm, additionalBinaryDataProperties) { Profanity = profanity; CustomBlocklists = customBlocklists; Jailbreak = jailbreak; } - /// Initializes a new instance of for deserialization. - internal RequestImageContentFilterResult() - { - } - /// /// A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the /// content. /// public ContentFilterDetectionResult Profanity { get; } + /// A collection of binary filtering outcomes for configured custom blocklists. public ContentFilterBlocklistResult CustomBlocklists { get; } + /// /// A detection result that describes user prompt injection attacks, where malicious users deliberately exploit /// system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.Serialization.cs index a45212164..c33d4abe2 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.Serialization.cs @@ -10,6 +10,7 @@ namespace Azure.AI.OpenAI { + /// public partial class ResponseContentFilterResult : IJsonModel { void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -23,65 +24,64 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResponseContentFilterResult)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("sexual") != true && Optional.IsDefined(Sexual)) + if (Optional.IsDefined(Sexual) && _additionalBinaryDataProperties?.ContainsKey("sexual") != true) { writer.WritePropertyName("sexual"u8); writer.WriteObjectValue(Sexual, options); } - if (SerializedAdditionalRawData?.ContainsKey("hate") != true && Optional.IsDefined(Hate)) + if (Optional.IsDefined(Hate) && _additionalBinaryDataProperties?.ContainsKey("hate") != true) { writer.WritePropertyName("hate"u8); writer.WriteObjectValue(Hate, options); } - if (SerializedAdditionalRawData?.ContainsKey("violence") != true && Optional.IsDefined(Violence)) + if (Optional.IsDefined(Violence) && _additionalBinaryDataProperties?.ContainsKey("violence") != true) { writer.WritePropertyName("violence"u8); writer.WriteObjectValue(Violence, options); } - if (SerializedAdditionalRawData?.ContainsKey("self_harm") != true && Optional.IsDefined(SelfHarm)) + if (Optional.IsDefined(SelfHarm) && _additionalBinaryDataProperties?.ContainsKey("self_harm") != true) { writer.WritePropertyName("self_harm"u8); writer.WriteObjectValue(SelfHarm, options); } - if (SerializedAdditionalRawData?.ContainsKey("profanity") != true && Optional.IsDefined(Profanity)) + if (Optional.IsDefined(Profanity) && _additionalBinaryDataProperties?.ContainsKey("profanity") != true) { writer.WritePropertyName("profanity"u8); writer.WriteObjectValue(Profanity, options); } - if (SerializedAdditionalRawData?.ContainsKey("custom_blocklists") != true && Optional.IsDefined(CustomBlocklists)) + if (Optional.IsDefined(CustomBlocklists) && _additionalBinaryDataProperties?.ContainsKey("custom_blocklists") != true) { writer.WritePropertyName("custom_blocklists"u8); writer.WriteObjectValue(CustomBlocklists, options); } - if (SerializedAdditionalRawData?.ContainsKey("error") != true && Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"u8); - writer.WriteObjectValue(Error, options); - } - if (SerializedAdditionalRawData?.ContainsKey("protected_material_text") != true && Optional.IsDefined(ProtectedMaterialText)) + if (Optional.IsDefined(ProtectedMaterialText) && _additionalBinaryDataProperties?.ContainsKey("protected_material_text") != true) { writer.WritePropertyName("protected_material_text"u8); writer.WriteObjectValue(ProtectedMaterialText, options); } - if (SerializedAdditionalRawData?.ContainsKey("protected_material_code") != true && Optional.IsDefined(ProtectedMaterialCode)) + if (Optional.IsDefined(ProtectedMaterialCode) && _additionalBinaryDataProperties?.ContainsKey("protected_material_code") != true) { writer.WritePropertyName("protected_material_code"u8); writer.WriteObjectValue(ProtectedMaterialCode, options); } - if (SerializedAdditionalRawData?.ContainsKey("ungrounded_material") != true && Optional.IsDefined(UngroundedMaterial)) + if (Optional.IsDefined(Error) && _additionalBinaryDataProperties?.ContainsKey("error") != true) + { + writer.WritePropertyName("error"u8); + writer.WriteObjectValue(Error, options); + } + if (Optional.IsDefined(UngroundedMaterial) && _additionalBinaryDataProperties?.ContainsKey("ungrounded_material") != true) { writer.WritePropertyName("ungrounded_material"u8); writer.WriteObjectValue(UngroundedMaterial, options); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -89,7 +89,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -100,22 +100,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResponseContentFilterResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ResponseContentFilterResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResponseContentFilterResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResponseContentFilterResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResponseContentFilterResult(document.RootElement, options); } - internal static ResponseContentFilterResult DeserializeResponseContentFilterResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static ResponseContentFilterResult DeserializeResponseContentFilterResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -126,111 +127,108 @@ internal static ResponseContentFilterResult DeserializeResponseContentFilterResu ContentFilterSeverityResult selfHarm = default; ContentFilterDetectionResult profanity = default; ContentFilterBlocklistResult customBlocklists = default; - InternalAzureContentFilterResultForChoiceError error = default; ContentFilterDetectionResult protectedMaterialText = default; ContentFilterProtectedMaterialResult protectedMaterialCode = default; + InternalAzureContentFilterResultForChoiceError error = default; ContentFilterTextSpanResult ungroundedMaterial = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("sexual"u8)) + if (prop.NameEquals("sexual"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - sexual = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + sexual = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(prop.Value, options); continue; } - if (property.NameEquals("hate"u8)) + if (prop.NameEquals("hate"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - hate = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + hate = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(prop.Value, options); continue; } - if (property.NameEquals("violence"u8)) + if (prop.NameEquals("violence"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - violence = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + violence = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(prop.Value, options); continue; } - if (property.NameEquals("self_harm"u8)) + if (prop.NameEquals("self_harm"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - selfHarm = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + selfHarm = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(prop.Value, options); continue; } - if (property.NameEquals("profanity"u8)) + if (prop.NameEquals("profanity"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - profanity = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(property.Value, options); + profanity = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(prop.Value, options); continue; } - if (property.NameEquals("custom_blocklists"u8)) + if (prop.NameEquals("custom_blocklists"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - customBlocklists = ContentFilterBlocklistResult.DeserializeContentFilterBlocklistResult(property.Value, options); + customBlocklists = ContentFilterBlocklistResult.DeserializeContentFilterBlocklistResult(prop.Value, options); continue; } - if (property.NameEquals("error"u8)) + if (prop.NameEquals("protected_material_text"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - error = InternalAzureContentFilterResultForChoiceError.DeserializeInternalAzureContentFilterResultForChoiceError(property.Value, options); + protectedMaterialText = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(prop.Value, options); continue; } - if (property.NameEquals("protected_material_text"u8)) + if (prop.NameEquals("protected_material_code"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - protectedMaterialText = ContentFilterDetectionResult.DeserializeContentFilterDetectionResult(property.Value, options); + protectedMaterialCode = ContentFilterProtectedMaterialResult.DeserializeContentFilterProtectedMaterialResult(prop.Value, options); continue; } - if (property.NameEquals("protected_material_code"u8)) + if (prop.NameEquals("error"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - protectedMaterialCode = ContentFilterProtectedMaterialResult.DeserializeContentFilterProtectedMaterialResult(property.Value, options); + error = InternalAzureContentFilterResultForChoiceError.DeserializeInternalAzureContentFilterResultForChoiceError(prop.Value, options); continue; } - if (property.NameEquals("ungrounded_material"u8)) + if (prop.NameEquals("ungrounded_material"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - ungroundedMaterial = ContentFilterTextSpanResult.DeserializeContentFilterTextSpanResult(property.Value, options); + ungroundedMaterial = ContentFilterTextSpanResult.DeserializeContentFilterTextSpanResult(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new ResponseContentFilterResult( sexual, hate, @@ -238,17 +236,19 @@ internal static ResponseContentFilterResult DeserializeResponseContentFilterResu selfHarm, profanity, customBlocklists, - error, protectedMaterialText, protectedMaterialCode, + error, ungroundedMaterial, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -258,15 +258,18 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - ResponseContentFilterResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + ResponseContentFilterResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResponseContentFilterResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeResponseContentFilterResult(document.RootElement, options); } default: @@ -276,18 +279,22 @@ ResponseContentFilterResult IPersistableModel.Creat string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ResponseContentFilterResult FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(ResponseContentFilterResult responseContentFilterResult) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeResponseContentFilterResult(document.RootElement); + if (responseContentFilterResult == null) + { + return null; + } + return BinaryContent.Create(responseContentFilterResult, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator ResponseContentFilterResult(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeResponseContentFilterResult(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.cs index 45fdc12f1..2d7c6ec52 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.cs @@ -10,74 +10,14 @@ namespace Azure.AI.OpenAI /// A content filter result for a single response item produced by a generative AI system. public partial class ResponseContentFilterResult { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal ResponseContentFilterResult() { } - /// Initializes a new instance of . - /// - /// A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - /// portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - /// assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - /// - /// - /// A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - /// language with reference to a person or identity group based on certain differentiating attributes of these groups - /// including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - /// religion, immigration status, ability status, personal appearance, and body size. - /// - /// - /// A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - /// someone or something; describes weapons, guns and related entities, such as manufactures, associations, - /// legislation, and so on. - /// - /// - /// A content filter category that describes language related to physical actions intended to purposely hurt, injure, - /// damage one's body or kill oneself. - /// - /// - /// A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the - /// content. - /// - /// A collection of binary filtering outcomes for configured custom blocklists. - /// If present, details about an error that prevented content filtering from completing its evaluation. - /// A detection result that describes a match against text protected under copyright or other status. - /// A detection result that describes a match against licensed code or other protected source material. - /// - /// Keeps track of any properties unknown to the library. - internal ResponseContentFilterResult(ContentFilterSeverityResult sexual, ContentFilterSeverityResult hate, ContentFilterSeverityResult violence, ContentFilterSeverityResult selfHarm, ContentFilterDetectionResult profanity, ContentFilterBlocklistResult customBlocklists, InternalAzureContentFilterResultForChoiceError error, ContentFilterDetectionResult protectedMaterialText, ContentFilterProtectedMaterialResult protectedMaterialCode, ContentFilterTextSpanResult ungroundedMaterial, IDictionary serializedAdditionalRawData) + internal ResponseContentFilterResult(ContentFilterSeverityResult sexual, ContentFilterSeverityResult hate, ContentFilterSeverityResult violence, ContentFilterSeverityResult selfHarm, ContentFilterDetectionResult profanity, ContentFilterBlocklistResult customBlocklists, ContentFilterDetectionResult protectedMaterialText, ContentFilterProtectedMaterialResult protectedMaterialCode, InternalAzureContentFilterResultForChoiceError error, ContentFilterTextSpanResult ungroundedMaterial, IDictionary additionalBinaryDataProperties) { Sexual = sexual; Hate = hate; @@ -85,11 +25,11 @@ internal ResponseContentFilterResult(ContentFilterSeverityResult sexual, Content SelfHarm = selfHarm; Profanity = profanity; CustomBlocklists = customBlocklists; - Error = error; ProtectedMaterialText = protectedMaterialText; ProtectedMaterialCode = protectedMaterialCode; + Error = error; UngroundedMaterial = ungroundedMaterial; - SerializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// @@ -98,6 +38,7 @@ internal ResponseContentFilterResult(ContentFilterSeverityResult sexual, Content /// assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. /// public ContentFilterSeverityResult Sexual { get; } + /// /// A content filter category that can refer to any content that attacks or uses pejorative or discriminatory /// language with reference to a person or identity group based on certain differentiating attributes of these groups @@ -105,27 +46,39 @@ internal ResponseContentFilterResult(ContentFilterSeverityResult sexual, Content /// religion, immigration status, ability status, personal appearance, and body size. /// public ContentFilterSeverityResult Hate { get; } + /// /// A content filter category for language related to physical actions intended to hurt, injure, damage, or kill /// someone or something; describes weapons, guns and related entities, such as manufactures, associations, /// legislation, and so on. /// public ContentFilterSeverityResult Violence { get; } + /// /// A content filter category that describes language related to physical actions intended to purposely hurt, injure, /// damage one's body or kill oneself. /// public ContentFilterSeverityResult SelfHarm { get; } + /// /// A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the /// content. /// public ContentFilterDetectionResult Profanity { get; } + /// A collection of binary filtering outcomes for configured custom blocklists. public ContentFilterBlocklistResult CustomBlocklists { get; } + /// A detection result that describes a match against text protected under copyright or other status. public ContentFilterDetectionResult ProtectedMaterialText { get; } + /// A detection result that describes a match against licensed code or other protected source material. public ContentFilterProtectedMaterialResult ProtectedMaterialCode { get; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.Serialization.cs index 7f34031a2..09de1cee2 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.Serialization.cs @@ -10,6 +10,7 @@ namespace Azure.AI.OpenAI { + /// public partial class ResponseImageContentFilterResult : IJsonModel { void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -23,35 +24,34 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResponseImageContentFilterResult)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("sexual") != true && Optional.IsDefined(Sexual)) + if (Optional.IsDefined(Sexual) && _additionalBinaryDataProperties?.ContainsKey("sexual") != true) { writer.WritePropertyName("sexual"u8); writer.WriteObjectValue(Sexual, options); } - if (SerializedAdditionalRawData?.ContainsKey("violence") != true && Optional.IsDefined(Violence)) + if (Optional.IsDefined(Violence) && _additionalBinaryDataProperties?.ContainsKey("violence") != true) { writer.WritePropertyName("violence"u8); writer.WriteObjectValue(Violence, options); } - if (SerializedAdditionalRawData?.ContainsKey("hate") != true && Optional.IsDefined(Hate)) + if (Optional.IsDefined(Hate) && _additionalBinaryDataProperties?.ContainsKey("hate") != true) { writer.WritePropertyName("hate"u8); writer.WriteObjectValue(Hate, options); } - if (SerializedAdditionalRawData?.ContainsKey("self_harm") != true && Optional.IsDefined(SelfHarm)) + if (Optional.IsDefined(SelfHarm) && _additionalBinaryDataProperties?.ContainsKey("self_harm") != true) { writer.WritePropertyName("self_harm"u8); writer.WriteObjectValue(SelfHarm, options); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -59,7 +59,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -70,22 +70,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ResponseImageContentFilterResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ResponseImageContentFilterResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResponseImageContentFilterResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ResponseImageContentFilterResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeResponseImageContentFilterResult(document.RootElement, options); } - internal static ResponseImageContentFilterResult DeserializeResponseImageContentFilterResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static ResponseImageContentFilterResult DeserializeResponseImageContentFilterResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -94,60 +95,59 @@ internal static ResponseImageContentFilterResult DeserializeResponseImageContent ContentFilterSeverityResult violence = default; ContentFilterSeverityResult hate = default; ContentFilterSeverityResult selfHarm = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("sexual"u8)) + if (prop.NameEquals("sexual"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - sexual = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + sexual = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(prop.Value, options); continue; } - if (property.NameEquals("violence"u8)) + if (prop.NameEquals("violence"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - violence = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + violence = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(prop.Value, options); continue; } - if (property.NameEquals("hate"u8)) + if (prop.NameEquals("hate"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - hate = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + hate = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(prop.Value, options); continue; } - if (property.NameEquals("self_harm"u8)) + if (prop.NameEquals("self_harm"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - selfHarm = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(property.Value, options); + selfHarm = ContentFilterSeverityResult.DeserializeContentFilterSeverityResult(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ResponseImageContentFilterResult(sexual, violence, hate, selfHarm, serializedAdditionalRawData); + return new ResponseImageContentFilterResult(sexual, violence, hate, selfHarm, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -157,15 +157,18 @@ BinaryData IPersistableModel.Write(ModelReader } } - ResponseImageContentFilterResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + ResponseImageContentFilterResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResponseImageContentFilterResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeResponseImageContentFilterResult(document.RootElement, options); } default: @@ -175,18 +178,22 @@ ResponseImageContentFilterResult IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static ResponseImageContentFilterResult FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(ResponseImageContentFilterResult responseImageContentFilterResult) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeResponseImageContentFilterResult(document.RootElement); + if (responseImageContentFilterResult == null) + { + return null; + } + return BinaryContent.Create(responseImageContentFilterResult, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator ResponseImageContentFilterResult(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeResponseImageContentFilterResult(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.cs index 2a5b21055..825d42f35 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.cs @@ -10,71 +10,20 @@ namespace Azure.AI.OpenAI /// A content filter result for an image generation operation's output response content. public partial class ResponseImageContentFilterResult { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } - /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; + internal ResponseImageContentFilterResult() { } - /// Initializes a new instance of . - /// - /// A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - /// portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - /// assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - /// - /// - /// A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - /// someone or something; describes weapons, guns and related entities, such as manufactures, associations, - /// legislation, and so on. - /// - /// - /// A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - /// language with reference to a person or identity group based on certain differentiating attributes of these groups - /// including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - /// religion, immigration status, ability status, personal appearance, and body size. - /// - /// - /// A content filter category that describes language related to physical actions intended to purposely hurt, injure, - /// damage one's body or kill oneself. - /// - /// Keeps track of any properties unknown to the library. - internal ResponseImageContentFilterResult(ContentFilterSeverityResult sexual, ContentFilterSeverityResult violence, ContentFilterSeverityResult hate, ContentFilterSeverityResult selfHarm, IDictionary serializedAdditionalRawData) + internal ResponseImageContentFilterResult(ContentFilterSeverityResult sexual, ContentFilterSeverityResult violence, ContentFilterSeverityResult hate, ContentFilterSeverityResult selfHarm, IDictionary additionalBinaryDataProperties) { Sexual = sexual; Violence = violence; Hate = hate; SelfHarm = selfHarm; - SerializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// @@ -83,12 +32,14 @@ internal ResponseImageContentFilterResult(ContentFilterSeverityResult sexual, Co /// assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. /// public ContentFilterSeverityResult Sexual { get; } + /// /// A content filter category for language related to physical actions intended to hurt, injure, damage, or kill /// someone or something; describes weapons, guns and related entities, such as manufactures, associations, /// legislation, and so on. /// public ContentFilterSeverityResult Violence { get; } + /// /// A content filter category that can refer to any content that attacks or uses pejorative or discriminatory /// language with reference to a person or identity group based on certain differentiating attributes of these groups @@ -96,10 +47,17 @@ internal ResponseImageContentFilterResult(ContentFilterSeverityResult sexual, Co /// religion, immigration status, ability status, personal appearance, and body size. /// public ContentFilterSeverityResult Hate { get; } + /// /// A content filter category that describes language related to physical actions intended to purposely hurt, injure, /// damage one's body or kill oneself. /// public ContentFilterSeverityResult SelfHarm { get; } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; + } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/UserSecurityContext.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/UserSecurityContext.Serialization.cs index ce8fcb983..b0aacd3bc 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/UserSecurityContext.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/UserSecurityContext.Serialization.cs @@ -10,6 +10,7 @@ namespace Azure.AI.OpenAI { + /// public partial class UserSecurityContext : IJsonModel { void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) @@ -23,35 +24,34 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(UserSecurityContext)} does not support writing '{format}' format."); } - - if (SerializedAdditionalRawData?.ContainsKey("application_name") != true && Optional.IsDefined(ApplicationName)) + if (Optional.IsDefined(ApplicationName) && _additionalBinaryDataProperties?.ContainsKey("application_name") != true) { writer.WritePropertyName("application_name"u8); writer.WriteStringValue(ApplicationName); } - if (SerializedAdditionalRawData?.ContainsKey("end_user_id") != true && Optional.IsDefined(EndUserId)) + if (Optional.IsDefined(EndUserId) && _additionalBinaryDataProperties?.ContainsKey("end_user_id") != true) { writer.WritePropertyName("end_user_id"u8); writer.WriteStringValue(EndUserId); } - if (SerializedAdditionalRawData?.ContainsKey("end_user_tenant_id") != true && Optional.IsDefined(EndUserTenantId)) + if (Optional.IsDefined(EndUserTenantId) && _additionalBinaryDataProperties?.ContainsKey("end_user_tenant_id") != true) { writer.WritePropertyName("end_user_tenant_id"u8); writer.WriteStringValue(EndUserTenantId); } - if (SerializedAdditionalRawData?.ContainsKey("source_ip") != true && Optional.IsDefined(SourceIP)) + if (Optional.IsDefined(SourceIP) && _additionalBinaryDataProperties?.ContainsKey("source_ip") != true) { writer.WritePropertyName("source_ip"u8); writer.WriteStringValue(SourceIP); } - if (SerializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in SerializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { if (ModelSerializationExtensions.IsSentinelValue(item.Value)) { @@ -59,7 +59,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else using (JsonDocument document = JsonDocument.Parse(item.Value)) { @@ -70,22 +70,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - UserSecurityContext IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + UserSecurityContext IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual UserSecurityContext JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(UserSecurityContext)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeUserSecurityContext(document.RootElement, options); } - internal static UserSecurityContext DeserializeUserSecurityContext(JsonElement element, ModelReaderWriterOptions options = null) + internal static UserSecurityContext DeserializeUserSecurityContext(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -93,45 +94,44 @@ internal static UserSecurityContext DeserializeUserSecurityContext(JsonElement e string applicationName = default; string endUserId = default; string endUserTenantId = default; - string sourceIp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string sourceIP = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("application_name"u8)) + if (prop.NameEquals("application_name"u8)) { - applicationName = property.Value.GetString(); + applicationName = prop.Value.GetString(); continue; } - if (property.NameEquals("end_user_id"u8)) + if (prop.NameEquals("end_user_id"u8)) { - endUserId = property.Value.GetString(); + endUserId = prop.Value.GetString(); continue; } - if (property.NameEquals("end_user_tenant_id"u8)) + if (prop.NameEquals("end_user_tenant_id"u8)) { - endUserTenantId = property.Value.GetString(); + endUserTenantId = prop.Value.GetString(); continue; } - if (property.NameEquals("source_ip"u8)) + if (prop.NameEquals("source_ip"u8)) { - sourceIp = property.Value.GetString(); + sourceIP = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary ??= new Dictionary(); - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new UserSecurityContext(applicationName, endUserId, endUserTenantId, sourceIp, serializedAdditionalRawData); + return new UserSecurityContext(applicationName, endUserId, endUserTenantId, sourceIP, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -141,15 +141,18 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - UserSecurityContext IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + UserSecurityContext IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual UserSecurityContext PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data)) { - using JsonDocument document = JsonDocument.Parse(data); return DeserializeUserSecurityContext(document.RootElement, options); } default: @@ -159,18 +162,22 @@ UserSecurityContext IPersistableModel.Create(BinaryData dat string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - /// Deserializes the model from a raw response. - /// The result to deserialize the model from. - internal static UserSecurityContext FromResponse(PipelineResponse response) + /// The to serialize into . + public static implicit operator BinaryContent(UserSecurityContext userSecurityContext) { - using var document = JsonDocument.Parse(response.Content); - return DeserializeUserSecurityContext(document.RootElement); + if (userSecurityContext == null) + { + return null; + } + return BinaryContent.Create(userSecurityContext, ModelSerializationExtensions.WireOptions); } - /// Convert into a . - internal virtual BinaryContent ToBinaryContent() + /// The to deserialize the from. + public static explicit operator UserSecurityContext(ClientResult result) { - return BinaryContent.Create(this, ModelSerializationExtensions.WireOptions); + using PipelineResponse response = result.GetRawResponse(); + using JsonDocument document = JsonDocument.Parse(response.Content); + return DeserializeUserSecurityContext(document.RootElement, ModelSerializationExtensions.WireOptions); } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/UserSecurityContext.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/UserSecurityContext.cs index fdce17d7b..581fefaba 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/UserSecurityContext.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/UserSecurityContext.cs @@ -10,51 +10,22 @@ namespace Azure.AI.OpenAI /// User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud. public partial class UserSecurityContext { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - internal IDictionary SerializedAdditionalRawData { get; set; } + /// Keeps track of any properties unknown to the library. + private protected IDictionary _additionalBinaryDataProperties; - /// Initializes a new instance of . - /// The name of the application. Sensitive personal information should not be included in this field. - /// This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field. - /// The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multitenant. - /// Captures the original client's IP address. - /// Keeps track of any properties unknown to the library. - internal UserSecurityContext(string applicationName, string endUserId, string endUserTenantId, string sourceIP, IDictionary serializedAdditionalRawData) + internal UserSecurityContext(string applicationName, string endUserId, string endUserTenantId, string sourceIP, IDictionary additionalBinaryDataProperties) { ApplicationName = applicationName; EndUserId = endUserId; EndUserTenantId = endUserTenantId; SourceIP = sourceIP; - SerializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + internal IDictionary SerializedAdditionalRawData + { + get => _additionalBinaryDataProperties; + set => _additionalBinaryDataProperties = value; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/tspCodeModel.json b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/tspCodeModel.json new file mode 100644 index 000000000..33ca3c05c --- /dev/null +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/tspCodeModel.json @@ -0,0 +1,12494 @@ +{ + "$id": "1", + "Name": "AzureOpenAI", + "ApiVersions": [ + "2024-06-01", + "2024-08-01-preview", + "2024-09-01-preview", + "2024-10-01-preview", + "2024-10-21", + "2024-12-01-preview", + "2025-01-01-preview" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "AzureOpenAIDalleErrorInnerError_code", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "ResponsibleAIPolicyViolation", + "value": "ResponsibleAIPolicyViolation", + "description": "ResponsibleAIPolicyViolation", + "valueType": { + "$ref": "3" + }, + "enumType": { + "$ref": "2" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The AzureOpenAIDalleErrorInnerError_code", + "isFixed": false, + "isFlags": false, + "usage": "Output", + "decorators": [] + }, + { + "$id": "5", + "kind": "enum", + "name": "AzureContentFilterSeverityResultSeverity", + "crossLanguageDefinitionId": "AzureContentFilterSeverityResult.severity.anonymous", + "valueType": { + "$id": "6", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "7", + "kind": "enumvalue", + "name": "safe", + "value": "safe", + "valueType": { + "$id": "8", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "5" + }, + "decorators": [] + }, + { + "$id": "9", + "kind": "enumvalue", + "name": "low", + "value": "low", + "valueType": { + "$id": "10", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "5" + }, + "decorators": [] + }, + { + "$id": "11", + "kind": "enumvalue", + "name": "medium", + "value": "medium", + "valueType": { + "$id": "12", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "5" + }, + "decorators": [] + }, + { + "$id": "13", + "kind": "enumvalue", + "name": "high", + "value": "high", + "valueType": { + "$id": "14", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "5" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Output", + "decorators": [] + }, + { + "$id": "15", + "kind": "enum", + "name": "AzureSearchChatDataSourceParametersIncludeContext", + "crossLanguageDefinitionId": "AzureSearchChatDataSource.parameters.include_context.anonymous", + "valueType": { + "$id": "16", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "17", + "kind": "enumvalue", + "name": "citations", + "value": "citations", + "valueType": { + "$id": "18", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "15" + }, + "decorators": [] + }, + { + "$id": "19", + "kind": "enumvalue", + "name": "intent", + "value": "intent", + "valueType": { + "$id": "20", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "15" + }, + "decorators": [] + }, + { + "$id": "21", + "kind": "enumvalue", + "name": "all_retrieved_documents", + "value": "all_retrieved_documents", + "valueType": { + "$id": "22", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "15" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input", + "decorators": [] + }, + { + "$id": "23", + "kind": "enum", + "name": "AzureSearchChatDataSourceParametersQueryType", + "crossLanguageDefinitionId": "AzureSearchChatDataSource.parameters.query_type.anonymous", + "valueType": { + "$id": "24", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "25", + "kind": "enumvalue", + "name": "simple", + "value": "simple", + "valueType": { + "$id": "26", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "23" + }, + "decorators": [] + }, + { + "$id": "27", + "kind": "enumvalue", + "name": "semantic", + "value": "semantic", + "valueType": { + "$id": "28", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "23" + }, + "decorators": [] + }, + { + "$id": "29", + "kind": "enumvalue", + "name": "vector", + "value": "vector", + "valueType": { + "$id": "30", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "23" + }, + "decorators": [] + }, + { + "$id": "31", + "kind": "enumvalue", + "name": "vector_simple_hybrid", + "value": "vector_simple_hybrid", + "valueType": { + "$id": "32", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "23" + }, + "decorators": [] + }, + { + "$id": "33", + "kind": "enumvalue", + "name": "vector_semantic_hybrid", + "value": "vector_semantic_hybrid", + "valueType": { + "$id": "34", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "23" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input", + "decorators": [] + }, + { + "$id": "35", + "kind": "enum", + "name": "ElasticsearchChatDataSourceParametersQueryType", + "crossLanguageDefinitionId": "ElasticsearchChatDataSource.parameters.query_type.anonymous", + "valueType": { + "$id": "36", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "37", + "kind": "enumvalue", + "name": "simple", + "value": "simple", + "valueType": { + "$id": "38", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "35" + }, + "decorators": [] + }, + { + "$id": "39", + "kind": "enumvalue", + "name": "vector", + "value": "vector", + "valueType": { + "$id": "40", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "35" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input", + "decorators": [] + }, + { + "$id": "41", + "kind": "enum", + "name": "AzureChatMessageContextAllRetrievedDocumentsFilterReason", + "crossLanguageDefinitionId": "AzureChatMessageContext.all_retrieved_documents.filter_reason.anonymous", + "valueType": { + "$id": "42", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "43", + "kind": "enumvalue", + "name": "score", + "value": "score", + "valueType": { + "$id": "44", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "41" + }, + "decorators": [] + }, + { + "$id": "45", + "kind": "enumvalue", + "name": "rerank", + "value": "rerank", + "valueType": { + "$id": "46", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "41" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Output", + "decorators": [] + }, + { + "$id": "47", + "kind": "enum", + "name": "AzureOpenAIChatErrorInnerError_code", + "valueType": { + "$id": "48", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "49", + "kind": "enumvalue", + "name": "ResponsibleAIPolicyViolation", + "value": "ResponsibleAIPolicyViolation", + "description": "ResponsibleAIPolicyViolation", + "valueType": { + "$ref": "48" + }, + "enumType": { + "$ref": "47" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The AzureOpenAIChatErrorInnerError_code", + "isFixed": false, + "isFlags": false, + "usage": "Output", + "decorators": [] + }, + { + "$id": "50", + "kind": "enum", + "name": "AzureOpenAIServiceApiVersion", + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIServiceApiVersion", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "52", + "kind": "enumvalue", + "name": "v2024_06_01", + "value": "2024-06-01", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "50" + }, + "description": "The 2024-06-01 (stable) service API version label.", + "decorators": [] + }, + { + "$id": "54", + "kind": "enumvalue", + "name": "v2024_08_01_preview", + "value": "2024-08-01-preview", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "50" + }, + "description": "The 2024-08-01-preview service API version label.", + "decorators": [] + }, + { + "$id": "56", + "kind": "enumvalue", + "name": "v2024_09_01_preview", + "value": "2024-09-01-preview", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "50" + }, + "description": "The 2024-09-01-preview service API version label.", + "decorators": [] + }, + { + "$id": "58", + "kind": "enumvalue", + "name": "v2024_10_01_preview", + "value": "2024-10-01-preview", + "valueType": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "50" + }, + "description": "The 2024-10-01-preview service API version label.", + "decorators": [] + }, + { + "$id": "60", + "kind": "enumvalue", + "name": "v2024_10_21", + "value": "2024-10-21", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "50" + }, + "description": "The 2024-10-21 (stable) service API version label.", + "decorators": [] + }, + { + "$id": "62", + "kind": "enumvalue", + "name": "v2024_12_01_preview", + "value": "2024-12-01-preview", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "50" + }, + "description": "The 2024-12-01-preview service API version label.", + "decorators": [] + }, + { + "$id": "64", + "kind": "enumvalue", + "name": "v2025_01_01_preview", + "value": "2025-01-01-preview", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "50" + }, + "description": "The 2025-01-01-preview service API version label.", + "decorators": [] + } + ], + "description": "Known service API versions for Azure OpenAI.", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + }, + { + "$id": "66", + "kind": "enum", + "name": "OpenAIFileWithOmittedPropertiesPurpose", + "crossLanguageDefinitionId": "OpenAIFileWithOmittedProperties.purpose.anonymous", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "68", + "kind": "enumvalue", + "name": "assistants", + "value": "assistants", + "valueType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "decorators": [] + }, + { + "$id": "70", + "kind": "enumvalue", + "name": "assistants_output", + "value": "assistants_output", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "decorators": [] + }, + { + "$id": "72", + "kind": "enumvalue", + "name": "batch", + "value": "batch", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "decorators": [] + }, + { + "$id": "74", + "kind": "enumvalue", + "name": "batch_output", + "value": "batch_output", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "decorators": [] + }, + { + "$id": "76", + "kind": "enumvalue", + "name": "fine-tune", + "value": "fine-tune", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "decorators": [] + }, + { + "$id": "78", + "kind": "enumvalue", + "name": "fine-tune-results", + "value": "fine-tune-results", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "decorators": [] + }, + { + "$id": "80", + "kind": "enumvalue", + "name": "vision", + "value": "vision", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "66" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Output", + "decorators": [] + }, + { + "$id": "82", + "kind": "enum", + "name": "AzureOpenAIFile_object", + "valueType": { + "$id": "83", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "84", + "kind": "enumvalue", + "name": "file", + "value": "file", + "description": "file", + "valueType": { + "$ref": "83" + }, + "enumType": { + "$ref": "82" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The AzureOpenAIFile_object", + "isFixed": false, + "isFlags": false, + "usage": "Output", + "decorators": [] + }, + { + "$id": "85", + "kind": "enum", + "name": "AzureOpenAIFileStatus", + "crossLanguageDefinitionId": "AzureOpenAIFile.status.anonymous", + "valueType": { + "$id": "86", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "87", + "kind": "enumvalue", + "name": "uploaded", + "value": "uploaded", + "valueType": { + "$id": "88", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "85" + }, + "decorators": [] + }, + { + "$id": "89", + "kind": "enumvalue", + "name": "pending", + "value": "pending", + "valueType": { + "$id": "90", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "85" + }, + "decorators": [] + }, + { + "$id": "91", + "kind": "enumvalue", + "name": "running", + "value": "running", + "valueType": { + "$id": "92", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "85" + }, + "decorators": [] + }, + { + "$id": "93", + "kind": "enumvalue", + "name": "processed", + "value": "processed", + "valueType": { + "$id": "94", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "85" + }, + "decorators": [] + }, + { + "$id": "95", + "kind": "enumvalue", + "name": "error", + "value": "error", + "valueType": { + "$id": "96", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "85" + }, + "decorators": [] + }, + { + "$id": "97", + "kind": "enumvalue", + "name": "deleting", + "value": "deleting", + "valueType": { + "$id": "98", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "85" + }, + "decorators": [] + }, + { + "$id": "99", + "kind": "enumvalue", + "name": "deleted", + "value": "deleted", + "valueType": { + "$id": "100", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "85" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Output", + "decorators": [] + }, + { + "$id": "101", + "kind": "enum", + "name": "ChatCompletionRequestMessageContentPartText_type", + "valueType": { + "$id": "102", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "103", + "kind": "enumvalue", + "name": "text", + "value": "text", + "description": "text", + "valueType": { + "$ref": "102" + }, + "enumType": { + "$ref": "101" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The ChatCompletionRequestMessageContentPartText_type", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "104", + "kind": "enum", + "name": "ChatCompletionRequestMessageContentPartImage_type", + "valueType": { + "$id": "105", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "106", + "kind": "enumvalue", + "name": "image_url", + "value": "image_url", + "description": "image_url", + "valueType": { + "$ref": "105" + }, + "enumType": { + "$ref": "104" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The ChatCompletionRequestMessageContentPartImage_type", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "107", + "kind": "enum", + "name": "ChatCompletionRequestMessageContentPartImageImageUrlDetail", + "crossLanguageDefinitionId": "ChatCompletionRequestMessageContentPartImage.image_url.detail.anonymous", + "valueType": { + "$id": "108", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "109", + "kind": "enumvalue", + "name": "auto", + "value": "auto", + "valueType": { + "$id": "110", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "107" + }, + "decorators": [] + }, + { + "$id": "111", + "kind": "enumvalue", + "name": "low", + "value": "low", + "valueType": { + "$id": "112", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "107" + }, + "decorators": [] + }, + { + "$id": "113", + "kind": "enumvalue", + "name": "high", + "value": "high", + "valueType": { + "$id": "114", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "107" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "115", + "kind": "enum", + "name": "ChatCompletionRequestMessageContentPartAudio_type", + "valueType": { + "$id": "116", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "117", + "kind": "enumvalue", + "name": "input_audio", + "value": "input_audio", + "description": "input_audio", + "valueType": { + "$ref": "116" + }, + "enumType": { + "$ref": "115" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The ChatCompletionRequestMessageContentPartAudio_type", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "118", + "kind": "enum", + "name": "ChatCompletionRequestMessageContentPartAudioInputAudioFormat", + "crossLanguageDefinitionId": "ChatCompletionRequestMessageContentPartAudio.input_audio.format.anonymous", + "valueType": { + "$id": "119", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "120", + "kind": "enumvalue", + "name": "wav", + "value": "wav", + "valueType": { + "$id": "121", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "118" + }, + "decorators": [] + }, + { + "$id": "122", + "kind": "enumvalue", + "name": "mp3", + "value": "mp3", + "valueType": { + "$id": "123", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "118" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "124", + "kind": "enum", + "name": "ChatCompletionRequestMessageContentPartRefusal_type", + "valueType": { + "$id": "125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "126", + "kind": "enumvalue", + "name": "refusal", + "value": "refusal", + "description": "refusal", + "valueType": { + "$ref": "125" + }, + "enumType": { + "$ref": "124" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The ChatCompletionRequestMessageContentPartRefusal_type", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "127", + "kind": "enum", + "name": "ChatCompletionMessageToolCall_type", + "valueType": { + "$id": "128", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "129", + "kind": "enumvalue", + "name": "function", + "value": "function", + "description": "function", + "valueType": { + "$ref": "128" + }, + "enumType": { + "$ref": "127" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The ChatCompletionMessageToolCall_type", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "130", + "kind": "enum", + "name": "AzureCreateChatCompletionRequestReasoningEffort", + "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.reasoning_effort.anonymous", + "valueType": { + "$id": "131", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "132", + "kind": "enumvalue", + "name": "low", + "value": "low", + "valueType": { + "$id": "133", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "130" + }, + "decorators": [] + }, + { + "$id": "134", + "kind": "enumvalue", + "name": "medium", + "value": "medium", + "valueType": { + "$id": "135", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "130" + }, + "decorators": [] + }, + { + "$id": "136", + "kind": "enumvalue", + "name": "high", + "value": "high", + "valueType": { + "$id": "137", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "130" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "138", + "kind": "enum", + "name": "AzureCreateChatCompletionRequestModality", + "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.modality.anonymous", + "valueType": { + "$id": "139", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "140", + "kind": "enumvalue", + "name": "text", + "value": "text", + "valueType": { + "$id": "141", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "138" + }, + "decorators": [] + }, + { + "$id": "142", + "kind": "enumvalue", + "name": "audio", + "value": "audio", + "valueType": { + "$id": "143", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "138" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "144", + "kind": "enum", + "name": "ChatOutputPredictionType", + "crossLanguageDefinitionId": "ChatOutputPrediction.type.anonymous", + "valueType": { + "$id": "145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "146", + "kind": "enumvalue", + "name": "content", + "value": "content", + "valueType": { + "$id": "147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "144" + }, + "decorators": [] + } + ], + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "148", + "kind": "enum", + "name": "AzureCreateChatCompletionRequestAudioVoice", + "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.audio.voice.anonymous", + "valueType": { + "$id": "149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "150", + "kind": "enumvalue", + "name": "alloy", + "value": "alloy", + "valueType": { + "$id": "151", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "148" + }, + "decorators": [] + }, + { + "$id": "152", + "kind": "enumvalue", + "name": "ash", + "value": "ash", + "valueType": { + "$id": "153", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "148" + }, + "decorators": [] + }, + { + "$id": "154", + "kind": "enumvalue", + "name": "ballad", + "value": "ballad", + "valueType": { + "$id": "155", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "148" + }, + "decorators": [] + }, + { + "$id": "156", + "kind": "enumvalue", + "name": "coral", + "value": "coral", + "valueType": { + "$id": "157", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "148" + }, + "decorators": [] + }, + { + "$id": "158", + "kind": "enumvalue", + "name": "echo", + "value": "echo", + "valueType": { + "$id": "159", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "148" + }, + "decorators": [] + }, + { + "$id": "160", + "kind": "enumvalue", + "name": "sage", + "value": "sage", + "valueType": { + "$id": "161", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "148" + }, + "decorators": [] + }, + { + "$id": "162", + "kind": "enumvalue", + "name": "shimmer", + "value": "shimmer", + "valueType": { + "$id": "163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "148" + }, + "decorators": [] + }, + { + "$id": "164", + "kind": "enumvalue", + "name": "verse", + "value": "verse", + "valueType": { + "$id": "165", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "148" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "166", + "kind": "enum", + "name": "AzureCreateChatCompletionRequestAudioFormat", + "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.audio.format.anonymous", + "valueType": { + "$id": "167", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "168", + "kind": "enumvalue", + "name": "wav", + "value": "wav", + "valueType": { + "$id": "169", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "166" + }, + "decorators": [] + }, + { + "$id": "170", + "kind": "enumvalue", + "name": "mp3", + "value": "mp3", + "valueType": { + "$id": "171", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "166" + }, + "decorators": [] + }, + { + "$id": "172", + "kind": "enumvalue", + "name": "flac", + "value": "flac", + "valueType": { + "$id": "173", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "166" + }, + "decorators": [] + }, + { + "$id": "174", + "kind": "enumvalue", + "name": "opus", + "value": "opus", + "valueType": { + "$id": "175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "166" + }, + "decorators": [] + }, + { + "$id": "176", + "kind": "enumvalue", + "name": "pcm16", + "value": "pcm16", + "valueType": { + "$id": "177", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "166" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "178", + "kind": "enum", + "name": "ChatCompletionTool_type", + "valueType": { + "$id": "179", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "180", + "kind": "enumvalue", + "name": "function", + "value": "function", + "description": "function", + "valueType": { + "$ref": "179" + }, + "enumType": { + "$ref": "178" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The ChatCompletionTool_type", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "181", + "kind": "enum", + "name": "AzureCreateChatCompletionRequestToolChoice", + "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.tool_choice.anonymous", + "valueType": { + "$id": "182", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "183", + "kind": "enumvalue", + "name": "none", + "value": "none", + "valueType": { + "$id": "184", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "181" + }, + "decorators": [] + }, + { + "$id": "185", + "kind": "enumvalue", + "name": "auto", + "value": "auto", + "valueType": { + "$id": "186", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "181" + }, + "decorators": [] + }, + { + "$id": "187", + "kind": "enumvalue", + "name": "required", + "value": "required", + "valueType": { + "$id": "188", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "181" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "189", + "kind": "enum", + "name": "ChatCompletionNamedToolChoice_type", + "valueType": { + "$id": "190", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "191", + "kind": "enumvalue", + "name": "function", + "value": "function", + "description": "function", + "valueType": { + "$ref": "190" + }, + "enumType": { + "$ref": "189" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The ChatCompletionNamedToolChoice_type", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "192", + "kind": "enum", + "name": "CreateImageRequestModel", + "crossLanguageDefinitionId": "CreateImageRequest.model.anonymous", + "valueType": { + "$id": "193", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "194", + "kind": "enumvalue", + "name": "dall-e-2", + "value": "dall-e-2", + "valueType": { + "$id": "195", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "192" + }, + "decorators": [] + }, + { + "$id": "196", + "kind": "enumvalue", + "name": "dall-e-3", + "value": "dall-e-3", + "valueType": { + "$id": "197", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "192" + }, + "decorators": [] + } + ], + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "198", + "kind": "enum", + "name": "CreateImageRequestQuality", + "crossLanguageDefinitionId": "CreateImageRequest.quality.anonymous", + "valueType": { + "$id": "199", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "200", + "kind": "enumvalue", + "name": "standard", + "value": "standard", + "valueType": { + "$id": "201", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "198" + }, + "decorators": [] + }, + { + "$id": "202", + "kind": "enumvalue", + "name": "hd", + "value": "hd", + "valueType": { + "$id": "203", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "198" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "204", + "kind": "enum", + "name": "CreateImageRequestResponseFormat", + "crossLanguageDefinitionId": "CreateImageRequest.response_format.anonymous", + "valueType": { + "$id": "205", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "206", + "kind": "enumvalue", + "name": "url", + "value": "url", + "valueType": { + "$id": "207", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "204" + }, + "decorators": [] + }, + { + "$id": "208", + "kind": "enumvalue", + "name": "b64_json", + "value": "b64_json", + "valueType": { + "$id": "209", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "204" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "210", + "kind": "enum", + "name": "CreateImageRequestSize", + "crossLanguageDefinitionId": "CreateImageRequest.size.anonymous", + "valueType": { + "$id": "211", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "212", + "kind": "enumvalue", + "name": "256x256", + "value": "256x256", + "valueType": { + "$id": "213", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "210" + }, + "decorators": [] + }, + { + "$id": "214", + "kind": "enumvalue", + "name": "512x512", + "value": "512x512", + "valueType": { + "$id": "215", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "210" + }, + "decorators": [] + }, + { + "$id": "216", + "kind": "enumvalue", + "name": "1024x1024", + "value": "1024x1024", + "valueType": { + "$id": "217", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "210" + }, + "decorators": [] + }, + { + "$id": "218", + "kind": "enumvalue", + "name": "1792x1024", + "value": "1792x1024", + "valueType": { + "$id": "219", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "210" + }, + "decorators": [] + }, + { + "$id": "220", + "kind": "enumvalue", + "name": "1024x1792", + "value": "1024x1792", + "valueType": { + "$id": "221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "210" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "222", + "kind": "enum", + "name": "CreateImageRequestStyle", + "crossLanguageDefinitionId": "CreateImageRequest.style.anonymous", + "valueType": { + "$id": "223", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "224", + "kind": "enumvalue", + "name": "vivid", + "value": "vivid", + "valueType": { + "$id": "225", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "222" + }, + "decorators": [] + }, + { + "$id": "226", + "kind": "enumvalue", + "name": "natural", + "value": "natural", + "valueType": { + "$id": "227", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "222" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "228", + "kind": "enum", + "name": "CreateMessageRequestRole", + "crossLanguageDefinitionId": "CreateMessageRequest.role.anonymous", + "valueType": { + "$id": "229", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "230", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "231", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "228" + }, + "decorators": [] + }, + { + "$id": "232", + "kind": "enumvalue", + "name": "assistant", + "value": "assistant", + "valueType": { + "$id": "233", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "228" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "234", + "kind": "enum", + "name": "FileSearchRankingOptionsRanker", + "crossLanguageDefinitionId": "FileSearchRankingOptions.ranker.anonymous", + "valueType": { + "$id": "235", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "236", + "kind": "enumvalue", + "name": "auto", + "value": "auto", + "valueType": { + "$id": "237", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "234" + }, + "decorators": [] + }, + { + "$id": "238", + "kind": "enumvalue", + "name": "default_2024_08_21", + "value": "default_2024_08_21", + "valueType": { + "$id": "239", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "234" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "240", + "kind": "enum", + "name": "AssistantToolsFileSearchTypeOnly_type", + "valueType": { + "$id": "241", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "242", + "kind": "enumvalue", + "name": "file_search", + "value": "file_search", + "description": "file_search", + "valueType": { + "$ref": "241" + }, + "enumType": { + "$ref": "240" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The AssistantToolsFileSearchTypeOnly_type", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "243", + "kind": "enum", + "name": "MessageObject_object", + "valueType": { + "$id": "244", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "245", + "kind": "enumvalue", + "name": "thread.message", + "value": "thread.message", + "description": "thread.message", + "valueType": { + "$ref": "244" + }, + "enumType": { + "$ref": "243" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The MessageObject_object", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "246", + "kind": "enum", + "name": "MessageObjectStatus", + "crossLanguageDefinitionId": "MessageObject.status.anonymous", + "valueType": { + "$id": "247", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "248", + "kind": "enumvalue", + "name": "in_progress", + "value": "in_progress", + "valueType": { + "$id": "249", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "246" + }, + "decorators": [] + }, + { + "$id": "250", + "kind": "enumvalue", + "name": "incomplete", + "value": "incomplete", + "valueType": { + "$id": "251", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "246" + }, + "decorators": [] + }, + { + "$id": "252", + "kind": "enumvalue", + "name": "completed", + "value": "completed", + "valueType": { + "$id": "253", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "246" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "254", + "kind": "enum", + "name": "MessageObjectIncompleteDetailsReason", + "crossLanguageDefinitionId": "MessageObject.incomplete_details.reason.anonymous", + "valueType": { + "$id": "255", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "256", + "kind": "enumvalue", + "name": "content_filter", + "value": "content_filter", + "valueType": { + "$id": "257", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "254" + }, + "decorators": [] + }, + { + "$id": "258", + "kind": "enumvalue", + "name": "max_tokens", + "value": "max_tokens", + "valueType": { + "$id": "259", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "254" + }, + "decorators": [] + }, + { + "$id": "260", + "kind": "enumvalue", + "name": "run_cancelled", + "value": "run_cancelled", + "valueType": { + "$id": "261", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "254" + }, + "decorators": [] + }, + { + "$id": "262", + "kind": "enumvalue", + "name": "run_expired", + "value": "run_expired", + "valueType": { + "$id": "263", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "254" + }, + "decorators": [] + }, + { + "$id": "264", + "kind": "enumvalue", + "name": "run_failed", + "value": "run_failed", + "valueType": { + "$id": "265", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "254" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "266", + "kind": "enum", + "name": "MessageObjectRole", + "crossLanguageDefinitionId": "MessageObject.role.anonymous", + "valueType": { + "$id": "267", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "268", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "269", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "266" + }, + "decorators": [] + }, + { + "$id": "270", + "kind": "enumvalue", + "name": "assistant", + "value": "assistant", + "valueType": { + "$id": "271", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "266" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + } + ], + "Models": [ + { + "$id": "272", + "kind": "model", + "name": "MessageContent", + "crossLanguageDefinitionId": "OpenAI.MessageContent", + "access": "public", + "usage": "Input,Output", + "description": "Represents a single piece of content in an Assistants API message.", + "decorators": [], + "properties": [] + }, + { + "$id": "273", + "kind": "model", + "name": "ErrorResponse", + "crossLanguageDefinitionId": "OpenAI.ErrorResponse", + "usage": "Error", + "decorators": [], + "properties": [ + { + "$id": "274", + "kind": "property", + "name": "error", + "serializedName": "error", + "type": { + "$id": "275", + "kind": "model", + "name": "Error", + "crossLanguageDefinitionId": "OpenAI.Error", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "276", + "kind": "property", + "name": "code", + "serializedName": "code", + "type": { + "$id": "277", + "kind": "nullable", + "type": { + "$id": "278", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.Error.code" + }, + { + "$id": "279", + "kind": "property", + "name": "message", + "serializedName": "message", + "type": { + "$id": "280", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.Error.message" + }, + { + "$id": "281", + "kind": "property", + "name": "param", + "serializedName": "param", + "type": { + "$id": "282", + "kind": "nullable", + "type": { + "$id": "283", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.Error.param" + }, + { + "$id": "284", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "285", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.Error.type" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ErrorResponse.error" + } + ] + }, + { + "$ref": "275" + }, + { + "$id": "286", + "kind": "model", + "name": "Image", + "crossLanguageDefinitionId": "OpenAI.Image", + "usage": "Output", + "description": "Represents the url or the content of an image generated by the OpenAI API.", + "decorators": [], + "properties": [ + { + "$id": "287", + "kind": "property", + "name": "b64_json", + "serializedName": "b64_json", + "description": "The base64-encoded JSON of the generated image, if `response_format` is `b64_json`.", + "type": { + "$id": "288", + "kind": "bytes", + "name": "bytes", + "encode": "base64", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.Image.b64_json" + }, + { + "$id": "289", + "kind": "property", + "name": "url", + "serializedName": "url", + "description": "The URL of the generated image, if `response_format` is `url` (default).", + "type": { + "$id": "290", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.Image.url" + }, + { + "$id": "291", + "kind": "property", + "name": "revised_prompt", + "serializedName": "revised_prompt", + "description": "The prompt that was used to generate the image, if there was any revision to the prompt.", + "type": { + "$id": "292", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.Image.revised_prompt" + } + ] + }, + { + "$id": "293", + "kind": "model", + "name": "AzureOpenAIDalleErrorResponse", + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleErrorResponse", + "access": "public", + "usage": "Output", + "description": "A structured representation of an error an Azure OpenAI request.", + "decorators": [], + "properties": [ + { + "$id": "294", + "kind": "property", + "name": "error", + "serializedName": "error", + "type": { + "$id": "295", + "kind": "model", + "name": "AzureOpenAIDalleError", + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError", + "access": "public", + "usage": "Output", + "description": "The structured representation of an error from an Azure OpenAI image generation request.", + "decorators": [], + "properties": [ + { + "$id": "296", + "kind": "property", + "name": "code", + "serializedName": "code", + "description": "The distinct, machine-generated identifier for the error.", + "type": { + "$id": "297", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.code" + }, + { + "$id": "298", + "kind": "property", + "name": "message", + "serializedName": "message", + "description": "A human-readable message associated with the error.", + "type": { + "$id": "299", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.message" + }, + { + "$id": "300", + "kind": "property", + "name": "param", + "serializedName": "param", + "description": "If applicable, the request input parameter associated with the error", + "type": { + "$id": "301", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.param" + }, + { + "$id": "302", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "If applicable, the input line number associated with the error.", + "type": { + "$id": "303", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.type" + }, + { + "$id": "304", + "kind": "property", + "name": "inner_error", + "serializedName": "inner_error", + "description": "If applicable, an upstream error that originated this error.", + "type": { + "$id": "305", + "kind": "model", + "name": "AzureOpenAIDalleErrorInnerError", + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error.anonymous", + "usage": "Output", + "decorators": [], + "properties": [ + { + "$id": "306", + "kind": "property", + "name": "code", + "serializedName": "code", + "description": "The code associated with the inner error.", + "type": { + "$id": "307", + "kind": "constant", + "valueType": { + "$ref": "2" + }, + "value": "ResponsibleAIPolicyViolation", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error.anonymous.code" + }, + { + "$id": "308", + "kind": "property", + "name": "revised_prompt", + "serializedName": "revised_prompt", + "description": "If applicable, the modified prompt used for generation.", + "type": { + "$id": "309", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error.anonymous.revised_prompt" + }, + { + "$id": "310", + "kind": "property", + "name": "content_filter_results", + "serializedName": "content_filter_results", + "description": "The content filter result details associated with the inner error.", + "type": { + "$id": "311", + "kind": "model", + "name": "AzureContentFilterImagePromptResults", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImagePromptResults", + "usage": "Output", + "description": "A content filter result for an image generation operation's input request content.", + "decorators": [], + "baseModel": { + "$id": "312", + "kind": "model", + "name": "AzureContentFilterImageResponseResults", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults", + "usage": "Output", + "description": "A content filter result for an image generation operation's output response content.", + "decorators": [], + "properties": [ + { + "$id": "313", + "kind": "property", + "name": "sexual", + "serializedName": "sexual", + "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse.", + "type": { + "$id": "314", + "kind": "model", + "name": "AzureContentFilterSeverityResult", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterSeverityResult", + "usage": "Output", + "description": "A labeled content filter result item that indicates whether the content was filtered and what the qualitative\nseverity level of the content was, as evaluated against content filter configuration for the category.", + "decorators": [], + "properties": [ + { + "$id": "315", + "kind": "property", + "name": "filtered", + "serializedName": "filtered", + "description": "Whether the content severity resulted in a content filtering action.", + "type": { + "$id": "316", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterSeverityResult.filtered" + }, + { + "$id": "317", + "kind": "property", + "name": "severity", + "serializedName": "severity", + "description": "The labeled severity of the content.", + "type": { + "$ref": "5" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterSeverityResult.severity" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults.sexual" + }, + { + "$id": "318", + "kind": "property", + "name": "violence", + "serializedName": "violence", + "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on.", + "type": { + "$ref": "314" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults.violence" + }, + { + "$id": "319", + "kind": "property", + "name": "hate", + "serializedName": "hate", + "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size.", + "type": { + "$ref": "314" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults.hate" + }, + { + "$id": "320", + "kind": "property", + "name": "self_harm", + "serializedName": "self_harm", + "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself.", + "type": { + "$ref": "314" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults.self_harm" + } + ] + }, + "properties": [ + { + "$id": "321", + "kind": "property", + "name": "profanity", + "serializedName": "profanity", + "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent.", + "type": { + "$id": "322", + "kind": "model", + "name": "AzureContentFilterDetectionResult", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterDetectionResult", + "usage": "Output", + "description": "A labeled content filter result item that indicates whether the content was detected and whether the content was\nfiltered.", + "decorators": [], + "properties": [ + { + "$id": "323", + "kind": "property", + "name": "filtered", + "serializedName": "filtered", + "description": "Whether the content detection resulted in a content filtering action.", + "type": { + "$id": "324", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterDetectionResult.filtered" + }, + { + "$id": "325", + "kind": "property", + "name": "detected", + "serializedName": "detected", + "description": "Whether the labeled content category was detected in the content.", + "type": { + "$id": "326", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterDetectionResult.detected" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImagePromptResults.profanity" + }, + { + "$id": "327", + "kind": "property", + "name": "custom_blocklists", + "serializedName": "custom_blocklists", + "description": "A collection of binary filtering outcomes for configured custom blocklists.", + "type": { + "$id": "328", + "kind": "model", + "name": "AzureContentFilterBlocklistResult", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult", + "access": "public", + "usage": "Output", + "description": "A collection of true/false filtering results for configured custom blocklists.", + "decorators": [], + "properties": [ + { + "$id": "329", + "kind": "property", + "name": "filtered", + "serializedName": "filtered", + "description": "A value indicating whether any of the detailed blocklists resulted in a filtering action.", + "type": { + "$id": "330", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.filtered" + }, + { + "$id": "331", + "kind": "property", + "name": "details", + "serializedName": "details", + "description": "The pairs of individual blocklist IDs and whether they resulted in a filtering action.", + "type": { + "$id": "332", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "333", + "kind": "model", + "name": "AzureContentFilterBlocklistResultDetail", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.detail.anonymous", + "usage": "Output", + "decorators": [], + "properties": [ + { + "$id": "334", + "kind": "property", + "name": "filtered", + "serializedName": "filtered", + "description": "A value indicating whether the blocklist produced a filtering action.", + "type": { + "$id": "335", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.detail.anonymous.filtered" + }, + { + "$id": "336", + "kind": "property", + "name": "id", + "serializedName": "id", + "description": "The ID of the custom blocklist evaluated.", + "type": { + "$id": "337", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.detail.anonymous.id" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.details" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImagePromptResults.custom_blocklists" + }, + { + "$id": "338", + "kind": "property", + "name": "jailbreak", + "serializedName": "jailbreak", + "description": "A detection result that describes user prompt injection attacks, where malicious users deliberately exploit\nsystem vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content\ngeneration or violations of system-imposed restrictions.", + "type": { + "$ref": "322" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImagePromptResults.jailbreak" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error.anonymous.content_filter_results" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleErrorResponse.error" + } + ] + }, + { + "$ref": "295" + }, + { + "$ref": "305" + }, + { + "$ref": "311" + }, + { + "$ref": "322" + }, + { + "$ref": "328" + }, + { + "$ref": "333" + }, + { + "$ref": "312" + }, + { + "$ref": "314" + }, + { + "$id": "339", + "kind": "model", + "name": "AzureChatDataSource", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSource", + "access": "public", + "usage": "Input", + "description": "A representation of configuration data for a single Azure OpenAI chat data source.\nThis will be used by a chat completions request that should use Azure OpenAI chat extensions to augment the\nresponse behavior.\nThe use of this configuration is compatible only with Azure OpenAI.", + "decorators": [], + "discriminatorProperty": { + "$id": "340", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The differentiating type identifier for the data source.", + "type": { + "$id": "341", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSource.type" + }, + "properties": [ + { + "$ref": "340" + } + ], + "discriminatedSubtypes": { + "$id": "342", + "azure_search": { + "$id": "343", + "kind": "model", + "name": "AzureSearchChatDataSource", + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource", + "access": "public", + "usage": "Input", + "description": "Represents a data source configuration that will use an Azure Search resource.", + "discriminatorValue": "azure_search", + "decorators": [], + "baseModel": { + "$ref": "339" + }, + "properties": [ + { + "$id": "344", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The discriminated type identifier, which is always 'azure_search'.", + "type": { + "$id": "345", + "kind": "constant", + "valueType": { + "$id": "346", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "azure_search", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.type" + }, + { + "$id": "347", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "description": "The parameter information to control the use of the Azure Search data source.", + "type": { + "$id": "348", + "kind": "model", + "name": "AzureSearchChatDataSourceParameters", + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous", + "usage": "Input", + "decorators": [], + "properties": [ + { + "$id": "349", + "kind": "property", + "name": "top_n_documents", + "serializedName": "top_n_documents", + "description": "The configured number of documents to feature in the query.", + "type": { + "$id": "350", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.top_n_documents" + }, + { + "$id": "351", + "kind": "property", + "name": "in_scope", + "serializedName": "in_scope", + "description": "Whether queries should be restricted to use of the indexed data.", + "type": { + "$id": "352", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.in_scope" + }, + { + "$id": "353", + "kind": "property", + "name": "strictness", + "serializedName": "strictness", + "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", + "type": { + "$id": "354", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.strictness" + }, + { + "$id": "355", + "kind": "property", + "name": "max_search_queries", + "serializedName": "max_search_queries", + "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", + "type": { + "$id": "356", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.max_search_queries" + }, + { + "$id": "357", + "kind": "property", + "name": "allow_partial_result", + "serializedName": "allow_partial_result", + "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", + "type": { + "$id": "358", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.allow_partial_result" + }, + { + "$id": "359", + "kind": "property", + "name": "include_contexts", + "serializedName": "include_contexts", + "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", + "type": { + "$id": "360", + "kind": "array", + "name": "Array", + "valueType": { + "$ref": "15" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.include_contexts" + }, + { + "$id": "361", + "kind": "property", + "name": "endpoint", + "serializedName": "endpoint", + "description": "The absolute endpoint path for the Azure Search resource to use.", + "type": { + "$id": "362", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.endpoint" + }, + { + "$id": "363", + "kind": "property", + "name": "index_name", + "serializedName": "index_name", + "description": "The name of the index to use, as specified in the Azure Search resource.", + "type": { + "$id": "364", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.index_name" + }, + { + "$id": "365", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "description": "The authentication mechanism to use with Azure Search.", + "type": { + "$id": "366", + "kind": "union", + "name": "AzureSearchChatDataSourceParametersAuthentication", + "variantTypes": [ + { + "$id": "367", + "kind": "model", + "name": "AzureChatDataSourceApiKeyAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceApiKeyAuthenticationOptions", + "usage": "Input", + "discriminatorValue": "api_key", + "decorators": [], + "baseModel": { + "$id": "368", + "kind": "model", + "name": "AzureChatDataSourceAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAuthenticationOptions", + "usage": "Input", + "decorators": [], + "discriminatorProperty": { + "$id": "369", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "370", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAuthenticationOptions.type" + }, + "properties": [ + { + "$ref": "369" + } + ], + "discriminatedSubtypes": { + "$id": "371", + "api_key": { + "$ref": "367" + }, + "connection_string": { + "$id": "372", + "kind": "model", + "name": "AzureChatDataSourceConnectionStringAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceConnectionStringAuthenticationOptions", + "usage": "Input", + "discriminatorValue": "connection_string", + "decorators": [], + "baseModel": { + "$ref": "368" + }, + "properties": [ + { + "$id": "373", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "374", + "kind": "constant", + "valueType": { + "$id": "375", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "connection_string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceConnectionStringAuthenticationOptions.type" + }, + { + "$id": "376", + "kind": "property", + "name": "connection_string", + "serializedName": "connection_string", + "type": { + "$id": "377", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceConnectionStringAuthenticationOptions.connection_string" + } + ] + }, + "system_assigned_managed_identity": { + "$id": "378", + "kind": "model", + "name": "AzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions", + "usage": "Input", + "discriminatorValue": "system_assigned_managed_identity", + "decorators": [], + "baseModel": { + "$ref": "368" + }, + "properties": [ + { + "$id": "379", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "380", + "kind": "constant", + "valueType": { + "$id": "381", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "system_assigned_managed_identity", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.type" + } + ] + }, + "user_assigned_managed_identity": { + "$id": "382", + "kind": "model", + "name": "AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions", + "usage": "Input", + "discriminatorValue": "user_assigned_managed_identity", + "decorators": [], + "baseModel": { + "$ref": "368" + }, + "properties": [ + { + "$id": "383", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "384", + "kind": "constant", + "valueType": { + "$id": "385", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "user_assigned_managed_identity", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.type" + }, + { + "$id": "386", + "kind": "property", + "name": "managed_identity_resource_id", + "serializedName": "managed_identity_resource_id", + "type": { + "$id": "387", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.managed_identity_resource_id" + } + ] + }, + "key_and_key_id": { + "$id": "388", + "kind": "model", + "name": "AzureChatDataSourceKeyAndKeyIdAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceKeyAndKeyIdAuthenticationOptions", + "usage": "Input", + "discriminatorValue": "key_and_key_id", + "decorators": [], + "baseModel": { + "$ref": "368" + }, + "properties": [ + { + "$id": "389", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "390", + "kind": "constant", + "valueType": { + "$id": "391", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "key_and_key_id", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceKeyAndKeyIdAuthenticationOptions.type" + }, + { + "$id": "392", + "kind": "property", + "name": "key", + "serializedName": "key", + "type": { + "$id": "393", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceKeyAndKeyIdAuthenticationOptions.key" + }, + { + "$id": "394", + "kind": "property", + "name": "key_id", + "serializedName": "key_id", + "type": { + "$id": "395", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceKeyAndKeyIdAuthenticationOptions.key_id" + } + ] + }, + "encoded_api_key": { + "$id": "396", + "kind": "model", + "name": "AzureChatDataSourceEncodedApiKeyAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEncodedApiKeyAuthenticationOptions", + "usage": "Input", + "discriminatorValue": "encoded_api_key", + "decorators": [], + "baseModel": { + "$ref": "368" + }, + "properties": [ + { + "$id": "397", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "398", + "kind": "constant", + "valueType": { + "$id": "399", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "encoded_api_key", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEncodedApiKeyAuthenticationOptions.type" + }, + { + "$id": "400", + "kind": "property", + "name": "encoded_api_key", + "serializedName": "encoded_api_key", + "type": { + "$id": "401", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEncodedApiKeyAuthenticationOptions.encoded_api_key" + } + ] + }, + "access_token": { + "$id": "402", + "kind": "model", + "name": "AzureChatDataSourceAccessTokenAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAccessTokenAuthenticationOptions", + "usage": "Input", + "discriminatorValue": "access_token", + "decorators": [], + "baseModel": { + "$ref": "368" + }, + "properties": [ + { + "$id": "403", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "404", + "kind": "constant", + "valueType": { + "$id": "405", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "access_token", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAccessTokenAuthenticationOptions.type" + }, + { + "$id": "406", + "kind": "property", + "name": "access_token", + "serializedName": "access_token", + "type": { + "$id": "407", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAccessTokenAuthenticationOptions.access_token" + } + ] + }, + "username_and_password": { + "$id": "408", + "kind": "model", + "name": "AzureChatDataSourceUsernameAndPasswordAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUsernameAndPasswordAuthenticationOptions", + "usage": "Input", + "discriminatorValue": "username_and_password", + "decorators": [], + "baseModel": { + "$ref": "368" + }, + "properties": [ + { + "$id": "409", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "410", + "kind": "constant", + "valueType": { + "$id": "411", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "username_and_password", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUsernameAndPasswordAuthenticationOptions.type" + }, + { + "$id": "412", + "kind": "property", + "name": "username", + "serializedName": "username", + "type": { + "$id": "413", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUsernameAndPasswordAuthenticationOptions.username" + }, + { + "$id": "414", + "kind": "property", + "name": "password", + "serializedName": "password", + "type": { + "$id": "415", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUsernameAndPasswordAuthenticationOptions.password" + } + ] + } + } + }, + "properties": [ + { + "$id": "416", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "417", + "kind": "constant", + "valueType": { + "$id": "418", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "api_key", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceApiKeyAuthenticationOptions.type" + }, + { + "$id": "419", + "kind": "property", + "name": "key", + "serializedName": "key", + "type": { + "$id": "420", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceApiKeyAuthenticationOptions.key" + } + ] + }, + { + "$ref": "378" + }, + { + "$ref": "382" + }, + { + "$ref": "402" + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.authentication" + }, + { + "$id": "421", + "kind": "property", + "name": "fields_mapping", + "serializedName": "fields_mapping", + "description": "The field mappings to use with the Azure Search resource.", + "type": { + "$id": "422", + "kind": "model", + "name": "AzureSearchChatDataSourceParametersFieldsMapping", + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous", + "usage": "Input", + "decorators": [], + "properties": [ + { + "$id": "423", + "kind": "property", + "name": "title_field", + "serializedName": "title_field", + "description": "The name of the index field to use as a title.", + "type": { + "$id": "424", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.title_field" + }, + { + "$id": "425", + "kind": "property", + "name": "url_field", + "serializedName": "url_field", + "description": "The name of the index field to use as a URL.", + "type": { + "$id": "426", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.url_field" + }, + { + "$id": "427", + "kind": "property", + "name": "filepath_field", + "serializedName": "filepath_field", + "description": "The name of the index field to use as a filepath.", + "type": { + "$id": "428", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.filepath_field" + }, + { + "$id": "429", + "kind": "property", + "name": "content_fields", + "serializedName": "content_fields", + "description": "The names of index fields that should be treated as content.", + "type": { + "$id": "430", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "431", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.content_fields" + }, + { + "$id": "432", + "kind": "property", + "name": "content_fields_separator", + "serializedName": "content_fields_separator", + "description": "The separator pattern that content fields should use.", + "type": { + "$id": "433", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" + }, + { + "$id": "434", + "kind": "property", + "name": "vector_fields", + "serializedName": "vector_fields", + "description": "The names of fields that represent vector data.", + "type": { + "$id": "435", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "436", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.vector_fields" + }, + { + "$id": "437", + "kind": "property", + "name": "image_vector_fields", + "serializedName": "image_vector_fields", + "description": "The names of fields that represent image vector data.", + "type": { + "$id": "438", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "439", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.image_vector_fields" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.fields_mapping" + }, + { + "$id": "440", + "kind": "property", + "name": "query_type", + "serializedName": "query_type", + "description": "The query type for the Azure Search resource to use.", + "type": { + "$ref": "23" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.query_type" + }, + { + "$id": "441", + "kind": "property", + "name": "semantic_configuration", + "serializedName": "semantic_configuration", + "description": "Additional semantic configuration for the query.", + "type": { + "$id": "442", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.semantic_configuration" + }, + { + "$id": "443", + "kind": "property", + "name": "filter", + "serializedName": "filter", + "description": "A filter to apply to the search.", + "type": { + "$id": "444", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.filter" + }, + { + "$id": "445", + "kind": "property", + "name": "embedding_dependency", + "serializedName": "embedding_dependency", + "description": "The vectorization source to use with Azure Search.\nSupported sources for Azure Search include endpoint, deployment name, and integrated.", + "type": { + "$id": "446", + "kind": "model", + "name": "AzureChatDataSourceVectorizationSource", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceVectorizationSource", + "access": "public", + "usage": "Input", + "description": "A representation of a data vectorization source usable as an embedding resource with a data source.", + "decorators": [], + "discriminatorProperty": { + "$id": "447", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The differentiating identifier for the concrete vectorization source.", + "type": { + "$id": "448", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceVectorizationSource.type" + }, + "properties": [ + { + "$ref": "447" + } + ], + "discriminatedSubtypes": { + "$id": "449", + "endpoint": { + "$id": "450", + "kind": "model", + "name": "AzureChatDataSourceEndpointVectorizationSource", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource", + "access": "public", + "usage": "Input", + "description": "Represents a vectorization source that makes public service calls against an Azure OpenAI embedding model deployment.", + "discriminatorValue": "endpoint", + "decorators": [], + "baseModel": { + "$ref": "446" + }, + "properties": [ + { + "$id": "451", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type identifier, always 'endpoint' for this vectorization source type.", + "type": { + "$id": "452", + "kind": "constant", + "valueType": { + "$id": "453", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "endpoint", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource.type" + }, + { + "$id": "454", + "kind": "property", + "name": "endpoint", + "serializedName": "endpoint", + "description": "Specifies the resource endpoint URL from which embeddings should be retrieved.\nIt should be in the format of:\nhttps://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings.\nThe api-version query parameter is not allowed.", + "type": { + "$id": "455", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource.endpoint" + }, + { + "$id": "456", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "description": "The authentication mechanism to use with the endpoint-based vectorization source.\nEndpoint authentication supports API key and access token mechanisms.", + "type": { + "$id": "457", + "kind": "union", + "name": "AzureChatDataSourceEndpointVectorizationSourceAuthentication", + "variantTypes": [ + { + "$ref": "367" + }, + { + "$ref": "402" + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource.authentication" + }, + { + "$id": "458", + "kind": "property", + "name": "dimensions", + "serializedName": "dimensions", + "description": "The number of dimensions to request on embeddings.\nOnly supported in 'text-embedding-3' and later models.", + "type": { + "$id": "459", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource.dimensions" + } + ] + }, + "deployment_name": { + "$id": "460", + "kind": "model", + "name": "AzureChatDataSourceDeploymentNameVectorizationSource", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceDeploymentNameVectorizationSource", + "access": "public", + "usage": "Input", + "description": "Represents a vectorization source that makes internal service calls against an Azure OpenAI embedding model\ndeployment. In contrast with the endpoint-based vectorization source, a deployment-name-based vectorization source\nmust be part of the same Azure OpenAI resource but can be used even in private networks.", + "discriminatorValue": "deployment_name", + "decorators": [], + "baseModel": { + "$ref": "446" + }, + "properties": [ + { + "$id": "461", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type identifier, always 'deployment_name' for this vectorization source type.", + "type": { + "$id": "462", + "kind": "constant", + "valueType": { + "$id": "463", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "deployment_name", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceDeploymentNameVectorizationSource.type" + }, + { + "$id": "464", + "kind": "property", + "name": "deployment_name", + "serializedName": "deployment_name", + "description": "The embedding model deployment to use for vectorization. This deployment must exist within the same Azure OpenAI\nresource as the model deployment being used for chat completions.", + "type": { + "$id": "465", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceDeploymentNameVectorizationSource.deployment_name" + }, + { + "$id": "466", + "kind": "property", + "name": "dimensions", + "serializedName": "dimensions", + "description": "The number of dimensions to request on embeddings.\nOnly supported in 'text-embedding-3' and later models.", + "type": { + "$id": "467", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceDeploymentNameVectorizationSource.dimensions" + } + ] + }, + "model_id": { + "$id": "468", + "kind": "model", + "name": "AzureChatDataSourceModelIdVectorizationSource", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceModelIdVectorizationSource", + "access": "public", + "usage": "Input", + "description": "Represents a vectorization source that makes service calls based on a search service model ID.\nThis source type is currently only supported by Elasticsearch.", + "discriminatorValue": "model_id", + "decorators": [], + "baseModel": { + "$ref": "446" + }, + "properties": [ + { + "$id": "469", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type identifier, always 'model_id' for this vectorization source type.", + "type": { + "$id": "470", + "kind": "constant", + "valueType": { + "$id": "471", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "model_id", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceModelIdVectorizationSource.type" + }, + { + "$id": "472", + "kind": "property", + "name": "model_id", + "serializedName": "model_id", + "description": "The embedding model build ID to use for vectorization.", + "type": { + "$id": "473", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceModelIdVectorizationSource.model_id" + } + ] + }, + "integrated": { + "$id": "474", + "kind": "model", + "name": "AzureChatDataSourceIntegratedVectorizationSource", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceIntegratedVectorizationSource", + "usage": "Input", + "description": "Represents an integrated vectorization source as defined within the supporting search resource.", + "discriminatorValue": "integrated", + "decorators": [], + "baseModel": { + "$ref": "446" + }, + "properties": [ + { + "$id": "475", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type identifier, always 'integrated' for this vectorization source type.", + "type": { + "$id": "476", + "kind": "constant", + "valueType": { + "$id": "477", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "integrated", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceIntegratedVectorizationSource.type" + } + ] + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.embedding_dependency" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters" + } + ] + }, + "azure_cosmos_db": { + "$id": "478", + "kind": "model", + "name": "AzureCosmosDBChatDataSource", + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource", + "access": "public", + "usage": "Input", + "description": "Represents a data source configuration that will use an Azure CosmosDB resource.", + "discriminatorValue": "azure_cosmos_db", + "decorators": [], + "baseModel": { + "$ref": "339" + }, + "properties": [ + { + "$id": "479", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The discriminated type identifier, which is always 'azure_cosmos_db'.", + "type": { + "$id": "480", + "kind": "constant", + "valueType": { + "$id": "481", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "azure_cosmos_db", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.type" + }, + { + "$id": "482", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "description": "The parameter information to control the use of the Azure CosmosDB data source.", + "type": { + "$id": "483", + "kind": "model", + "name": "AzureCosmosDBChatDataSourceParameters", + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous", + "usage": "Input", + "decorators": [], + "properties": [ + { + "$id": "484", + "kind": "property", + "name": "top_n_documents", + "serializedName": "top_n_documents", + "description": "The configured number of documents to feature in the query.", + "type": { + "$id": "485", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.top_n_documents" + }, + { + "$id": "486", + "kind": "property", + "name": "in_scope", + "serializedName": "in_scope", + "description": "Whether queries should be restricted to use of the indexed data.", + "type": { + "$id": "487", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.in_scope" + }, + { + "$id": "488", + "kind": "property", + "name": "strictness", + "serializedName": "strictness", + "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", + "type": { + "$id": "489", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.strictness" + }, + { + "$id": "490", + "kind": "property", + "name": "max_search_queries", + "serializedName": "max_search_queries", + "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", + "type": { + "$id": "491", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.max_search_queries" + }, + { + "$id": "492", + "kind": "property", + "name": "allow_partial_result", + "serializedName": "allow_partial_result", + "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", + "type": { + "$id": "493", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.allow_partial_result" + }, + { + "$id": "494", + "kind": "property", + "name": "include_contexts", + "serializedName": "include_contexts", + "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", + "type": { + "$id": "495", + "kind": "array", + "name": "Array", + "valueType": { + "$ref": "15" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.include_contexts" + }, + { + "$id": "496", + "kind": "property", + "name": "container_name", + "serializedName": "container_name", + "type": { + "$id": "497", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.container_name" + }, + { + "$id": "498", + "kind": "property", + "name": "database_name", + "serializedName": "database_name", + "type": { + "$id": "499", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.database_name" + }, + { + "$id": "500", + "kind": "property", + "name": "embedding_dependency", + "serializedName": "embedding_dependency", + "type": { + "$ref": "446" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.embedding_dependency" + }, + { + "$id": "501", + "kind": "property", + "name": "index_name", + "serializedName": "index_name", + "type": { + "$id": "502", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.index_name" + }, + { + "$id": "503", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "type": { + "$ref": "372" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.authentication" + }, + { + "$id": "504", + "kind": "property", + "name": "fields_mapping", + "serializedName": "fields_mapping", + "type": { + "$id": "505", + "kind": "model", + "name": "AzureCosmosDBChatDataSourceParametersFieldsMapping", + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous", + "usage": "Input", + "decorators": [], + "properties": [ + { + "$id": "506", + "kind": "property", + "name": "content_fields", + "serializedName": "content_fields", + "type": { + "$id": "507", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "508", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.content_fields" + }, + { + "$id": "509", + "kind": "property", + "name": "vector_fields", + "serializedName": "vector_fields", + "type": { + "$id": "510", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "511", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.vector_fields" + }, + { + "$id": "512", + "kind": "property", + "name": "title_field", + "serializedName": "title_field", + "type": { + "$id": "513", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.title_field" + }, + { + "$id": "514", + "kind": "property", + "name": "url_field", + "serializedName": "url_field", + "type": { + "$id": "515", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.url_field" + }, + { + "$id": "516", + "kind": "property", + "name": "filepath_field", + "serializedName": "filepath_field", + "type": { + "$id": "517", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.filepath_field" + }, + { + "$id": "518", + "kind": "property", + "name": "content_fields_separator", + "serializedName": "content_fields_separator", + "type": { + "$id": "519", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.fields_mapping" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters" + } + ] + }, + "elasticsearch": { + "$id": "520", + "kind": "model", + "name": "ElasticsearchChatDataSource", + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource", + "access": "public", + "usage": "Input", + "discriminatorValue": "elasticsearch", + "decorators": [], + "baseModel": { + "$ref": "339" + }, + "properties": [ + { + "$id": "521", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The discriminated type identifier, which is always 'elasticsearch'.", + "type": { + "$id": "522", + "kind": "constant", + "valueType": { + "$id": "523", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "elasticsearch", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.type" + }, + { + "$id": "524", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "description": "The parameter information to control the use of the Elasticsearch data source.", + "type": { + "$id": "525", + "kind": "model", + "name": "ElasticsearchChatDataSourceParameters", + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous", + "usage": "Input", + "decorators": [], + "properties": [ + { + "$id": "526", + "kind": "property", + "name": "top_n_documents", + "serializedName": "top_n_documents", + "description": "The configured number of documents to feature in the query.", + "type": { + "$id": "527", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.top_n_documents" + }, + { + "$id": "528", + "kind": "property", + "name": "in_scope", + "serializedName": "in_scope", + "description": "Whether queries should be restricted to use of the indexed data.", + "type": { + "$id": "529", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.in_scope" + }, + { + "$id": "530", + "kind": "property", + "name": "strictness", + "serializedName": "strictness", + "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", + "type": { + "$id": "531", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.strictness" + }, + { + "$id": "532", + "kind": "property", + "name": "max_search_queries", + "serializedName": "max_search_queries", + "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", + "type": { + "$id": "533", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.max_search_queries" + }, + { + "$id": "534", + "kind": "property", + "name": "allow_partial_result", + "serializedName": "allow_partial_result", + "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", + "type": { + "$id": "535", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.allow_partial_result" + }, + { + "$id": "536", + "kind": "property", + "name": "include_contexts", + "serializedName": "include_contexts", + "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", + "type": { + "$id": "537", + "kind": "array", + "name": "Array", + "valueType": { + "$ref": "15" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.include_contexts" + }, + { + "$id": "538", + "kind": "property", + "name": "endpoint", + "serializedName": "endpoint", + "type": { + "$id": "539", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.endpoint" + }, + { + "$id": "540", + "kind": "property", + "name": "index_name", + "serializedName": "index_name", + "type": { + "$id": "541", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.index_name" + }, + { + "$id": "542", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "type": { + "$id": "543", + "kind": "union", + "name": "ElasticsearchChatDataSourceParametersAuthentication", + "variantTypes": [ + { + "$ref": "388" + }, + { + "$ref": "396" + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.authentication" + }, + { + "$id": "544", + "kind": "property", + "name": "fields_mapping", + "serializedName": "fields_mapping", + "type": { + "$id": "545", + "kind": "model", + "name": "ElasticsearchChatDataSourceParametersFieldsMapping", + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous", + "usage": "Input", + "decorators": [], + "properties": [ + { + "$id": "546", + "kind": "property", + "name": "title_field", + "serializedName": "title_field", + "type": { + "$id": "547", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.title_field" + }, + { + "$id": "548", + "kind": "property", + "name": "url_field", + "serializedName": "url_field", + "type": { + "$id": "549", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.url_field" + }, + { + "$id": "550", + "kind": "property", + "name": "filepath_field", + "serializedName": "filepath_field", + "type": { + "$id": "551", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.filepath_field" + }, + { + "$id": "552", + "kind": "property", + "name": "content_fields", + "serializedName": "content_fields", + "type": { + "$id": "553", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "554", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.content_fields" + }, + { + "$id": "555", + "kind": "property", + "name": "content_fields_separator", + "serializedName": "content_fields_separator", + "type": { + "$id": "556", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" + }, + { + "$id": "557", + "kind": "property", + "name": "vector_fields", + "serializedName": "vector_fields", + "type": { + "$id": "558", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "559", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.vector_fields" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.fields_mapping" + }, + { + "$id": "560", + "kind": "property", + "name": "query_type", + "serializedName": "query_type", + "type": { + "$ref": "35" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.query_type" + }, + { + "$id": "561", + "kind": "property", + "name": "embedding_dependency", + "serializedName": "embedding_dependency", + "type": { + "$ref": "446" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.embedding_dependency" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters" + } + ] + }, + "pinecone": { + "$id": "562", + "kind": "model", + "name": "PineconeChatDataSource", + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource", + "access": "public", + "usage": "Input", + "discriminatorValue": "pinecone", + "decorators": [], + "baseModel": { + "$ref": "339" + }, + "properties": [ + { + "$id": "563", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The discriminated type identifier, which is always 'pinecone'.", + "type": { + "$id": "564", + "kind": "constant", + "valueType": { + "$id": "565", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "pinecone", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.type" + }, + { + "$id": "566", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "description": "The parameter information to control the use of the Pinecone data source.", + "type": { + "$id": "567", + "kind": "model", + "name": "PineconeChatDataSourceParameters", + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous", + "usage": "Input", + "decorators": [], + "properties": [ + { + "$id": "568", + "kind": "property", + "name": "top_n_documents", + "serializedName": "top_n_documents", + "description": "The configured number of documents to feature in the query.", + "type": { + "$id": "569", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.top_n_documents" + }, + { + "$id": "570", + "kind": "property", + "name": "in_scope", + "serializedName": "in_scope", + "description": "Whether queries should be restricted to use of the indexed data.", + "type": { + "$id": "571", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.in_scope" + }, + { + "$id": "572", + "kind": "property", + "name": "strictness", + "serializedName": "strictness", + "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", + "type": { + "$id": "573", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.strictness" + }, + { + "$id": "574", + "kind": "property", + "name": "max_search_queries", + "serializedName": "max_search_queries", + "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", + "type": { + "$id": "575", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.max_search_queries" + }, + { + "$id": "576", + "kind": "property", + "name": "allow_partial_result", + "serializedName": "allow_partial_result", + "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", + "type": { + "$id": "577", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.allow_partial_result" + }, + { + "$id": "578", + "kind": "property", + "name": "include_contexts", + "serializedName": "include_contexts", + "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", + "type": { + "$id": "579", + "kind": "array", + "name": "Array", + "valueType": { + "$ref": "15" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.include_contexts" + }, + { + "$id": "580", + "kind": "property", + "name": "environment", + "serializedName": "environment", + "description": "The environment name to use with Pinecone.", + "type": { + "$id": "581", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.environment" + }, + { + "$id": "582", + "kind": "property", + "name": "index_name", + "serializedName": "index_name", + "description": "The name of the Pinecone database index to use.", + "type": { + "$id": "583", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.index_name" + }, + { + "$id": "584", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "description": "The authentication mechanism to use with Pinecone.\nSupported authentication mechanisms for Pinecone include: API key.", + "type": { + "$ref": "367" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.authentication" + }, + { + "$id": "585", + "kind": "property", + "name": "embedding_dependency", + "serializedName": "embedding_dependency", + "description": "The vectorization source to use as an embedding dependency for the Pinecone data source.\nSupported vectorization sources for Pinecone include: deployment name.", + "type": { + "$ref": "446" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.embedding_dependency" + }, + { + "$id": "586", + "kind": "property", + "name": "fields_mapping", + "serializedName": "fields_mapping", + "description": "Field mappings to apply to data used by the Pinecone data source.\nNote that content field mappings are required for Pinecone.", + "type": { + "$id": "587", + "kind": "model", + "name": "PineconeChatDataSourceParametersFieldsMapping", + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous", + "usage": "Input", + "decorators": [], + "properties": [ + { + "$id": "588", + "kind": "property", + "name": "content_fields", + "serializedName": "content_fields", + "type": { + "$id": "589", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "590", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.content_fields" + }, + { + "$id": "591", + "kind": "property", + "name": "title_field", + "serializedName": "title_field", + "type": { + "$id": "592", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.title_field" + }, + { + "$id": "593", + "kind": "property", + "name": "url_field", + "serializedName": "url_field", + "type": { + "$id": "594", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.url_field" + }, + { + "$id": "595", + "kind": "property", + "name": "filepath_field", + "serializedName": "filepath_field", + "type": { + "$id": "596", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.filepath_field" + }, + { + "$id": "597", + "kind": "property", + "name": "content_fields_separator", + "serializedName": "content_fields_separator", + "type": { + "$id": "598", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.fields_mapping" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters" + } + ] + }, + "mongo_db": { + "$id": "599", + "kind": "model", + "name": "MongoDBChatDataSource", + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource", + "usage": "Input", + "discriminatorValue": "mongo_db", + "decorators": [], + "baseModel": { + "$ref": "339" + }, + "properties": [ + { + "$id": "600", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The discriminated type identifier, which is always 'mongo_db'.", + "type": { + "$id": "601", + "kind": "constant", + "valueType": { + "$id": "602", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "mongo_db", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.type" + }, + { + "$id": "603", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "description": "The parameter information to control the use of the MongoDB data source.", + "type": { + "$id": "604", + "kind": "model", + "name": "MongoDBChatDataSourceParameters", + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous", + "usage": "Input", + "decorators": [], + "properties": [ + { + "$id": "605", + "kind": "property", + "name": "top_n_documents", + "serializedName": "top_n_documents", + "description": "The configured number of documents to feature in the query.", + "type": { + "$id": "606", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.top_n_documents" + }, + { + "$id": "607", + "kind": "property", + "name": "in_scope", + "serializedName": "in_scope", + "description": "Whether queries should be restricted to use of the indexed data.", + "type": { + "$id": "608", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.in_scope" + }, + { + "$id": "609", + "kind": "property", + "name": "strictness", + "serializedName": "strictness", + "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", + "type": { + "$id": "610", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.strictness" + }, + { + "$id": "611", + "kind": "property", + "name": "max_search_queries", + "serializedName": "max_search_queries", + "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", + "type": { + "$id": "612", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.max_search_queries" + }, + { + "$id": "613", + "kind": "property", + "name": "allow_partial_result", + "serializedName": "allow_partial_result", + "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", + "type": { + "$id": "614", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.allow_partial_result" + }, + { + "$id": "615", + "kind": "property", + "name": "include_contexts", + "serializedName": "include_contexts", + "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", + "type": { + "$id": "616", + "kind": "array", + "name": "Array", + "valueType": { + "$ref": "15" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.include_contexts" + }, + { + "$id": "617", + "kind": "property", + "name": "endpoint", + "serializedName": "endpoint", + "description": "The name of the MongoDB cluster endpoint.", + "type": { + "$id": "618", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.endpoint" + }, + { + "$id": "619", + "kind": "property", + "name": "database_name", + "serializedName": "database_name", + "description": "The name of the MongoDB database.", + "type": { + "$id": "620", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.database_name" + }, + { + "$id": "621", + "kind": "property", + "name": "collection_name", + "serializedName": "collection_name", + "description": "The name of the MongoDB collection.", + "type": { + "$id": "622", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.collection_name" + }, + { + "$id": "623", + "kind": "property", + "name": "app_name", + "serializedName": "app_name", + "description": "The name of the MongoDB application.", + "type": { + "$id": "624", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.app_name" + }, + { + "$id": "625", + "kind": "property", + "name": "index_name", + "serializedName": "index_name", + "description": "The name of the MongoDB index.", + "type": { + "$id": "626", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.index_name" + }, + { + "$id": "627", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "description": "The authentication mechanism to use with Pinecone.\nSupported authentication mechanisms for Pinecone include: username and password.", + "type": { + "$ref": "408" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.authentication" + }, + { + "$id": "628", + "kind": "property", + "name": "embedding_dependency", + "serializedName": "embedding_dependency", + "description": "The vectorization source to use as an embedding dependency for the MongoDB data source.\nSupported vectorization sources for MongoDB include: endpoint, deployment name.", + "type": { + "$id": "629", + "kind": "union", + "name": "MongoDBChatDataSourceParametersEmbeddingDependency", + "variantTypes": [ + { + "$ref": "450" + }, + { + "$ref": "460" + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.embedding_dependency" + }, + { + "$id": "630", + "kind": "property", + "name": "fields_mapping", + "serializedName": "fields_mapping", + "description": "Field mappings to apply to data used by the MongoDB data source.\nNote that content and vector field mappings are required for MongoDB.", + "type": { + "$id": "631", + "kind": "model", + "name": "MongoDBChatDataSourceParametersFieldsMapping", + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous", + "usage": "Input", + "decorators": [], + "properties": [ + { + "$id": "632", + "kind": "property", + "name": "content_fields", + "serializedName": "content_fields", + "type": { + "$id": "633", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "634", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.content_fields" + }, + { + "$id": "635", + "kind": "property", + "name": "vector_fields", + "serializedName": "vector_fields", + "type": { + "$id": "636", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "637", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.vector_fields" + }, + { + "$id": "638", + "kind": "property", + "name": "title_field", + "serializedName": "title_field", + "type": { + "$id": "639", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.title_field" + }, + { + "$id": "640", + "kind": "property", + "name": "url_field", + "serializedName": "url_field", + "type": { + "$id": "641", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.url_field" + }, + { + "$id": "642", + "kind": "property", + "name": "filepath_field", + "serializedName": "filepath_field", + "type": { + "$id": "643", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.filepath_field" + }, + { + "$id": "644", + "kind": "property", + "name": "content_fields_separator", + "serializedName": "content_fields_separator", + "type": { + "$id": "645", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.fields_mapping" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters" + } + ] + } + } + }, + { + "$ref": "343" + }, + { + "$ref": "348" + }, + { + "$ref": "367" + }, + { + "$ref": "368" + }, + { + "$ref": "372" + }, + { + "$ref": "378" + }, + { + "$ref": "382" + }, + { + "$ref": "388" + }, + { + "$ref": "396" + }, + { + "$ref": "402" + }, + { + "$ref": "408" + }, + { + "$ref": "422" + }, + { + "$ref": "446" + }, + { + "$ref": "450" + }, + { + "$ref": "460" + }, + { + "$ref": "468" + }, + { + "$ref": "474" + }, + { + "$ref": "478" + }, + { + "$ref": "483" + }, + { + "$ref": "505" + }, + { + "$ref": "520" + }, + { + "$ref": "525" + }, + { + "$ref": "545" + }, + { + "$ref": "562" + }, + { + "$ref": "567" + }, + { + "$ref": "587" + }, + { + "$ref": "599" + }, + { + "$ref": "604" + }, + { + "$ref": "631" + }, + { + "$id": "646", + "kind": "model", + "name": "AzureContentFilterResultForChoice", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice", + "access": "public", + "usage": "Output", + "description": "A content filter result for a single response item produced by a generative AI system.", + "decorators": [], + "properties": [ + { + "$id": "647", + "kind": "property", + "name": "sexual", + "serializedName": "sexual", + "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse.", + "type": { + "$ref": "314" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.sexual" + }, + { + "$id": "648", + "kind": "property", + "name": "hate", + "serializedName": "hate", + "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size.", + "type": { + "$ref": "314" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.hate" + }, + { + "$id": "649", + "kind": "property", + "name": "violence", + "serializedName": "violence", + "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on.", + "type": { + "$ref": "314" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.violence" + }, + { + "$id": "650", + "kind": "property", + "name": "self_harm", + "serializedName": "self_harm", + "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself.", + "type": { + "$ref": "314" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.self_harm" + }, + { + "$id": "651", + "kind": "property", + "name": "profanity", + "serializedName": "profanity", + "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent.", + "type": { + "$ref": "322" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.profanity" + }, + { + "$id": "652", + "kind": "property", + "name": "custom_blocklists", + "serializedName": "custom_blocklists", + "description": "A collection of binary filtering outcomes for configured custom blocklists.", + "type": { + "$ref": "328" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.custom_blocklists" + }, + { + "$id": "653", + "kind": "property", + "name": "error", + "serializedName": "error", + "description": "If present, details about an error that prevented content filtering from completing its evaluation.", + "type": { + "$id": "654", + "kind": "model", + "name": "AzureContentFilterResultForChoiceError", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.error.anonymous", + "usage": "Output", + "decorators": [], + "properties": [ + { + "$id": "655", + "kind": "property", + "name": "code", + "serializedName": "code", + "description": "A distinct, machine-readable code associated with the error.", + "type": { + "$id": "656", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.error.anonymous.code" + }, + { + "$id": "657", + "kind": "property", + "name": "message", + "serializedName": "message", + "description": "A human-readable message associated with the error.", + "type": { + "$id": "658", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.error.anonymous.message" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.error" + }, + { + "$id": "659", + "kind": "property", + "name": "protected_material_text", + "serializedName": "protected_material_text", + "description": "A detection result that describes a match against text protected under copyright or other status.", + "type": { + "$ref": "322" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_text" + }, + { + "$id": "660", + "kind": "property", + "name": "protected_material_code", + "serializedName": "protected_material_code", + "description": "A detection result that describes a match against licensed code or other protected source material.", + "type": { + "$id": "661", + "kind": "model", + "name": "AzureContentFilterResultForChoiceProtectedMaterialCode", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.anonymous", + "usage": "Output", + "decorators": [], + "properties": [ + { + "$id": "662", + "kind": "property", + "name": "filtered", + "serializedName": "filtered", + "description": "Whether the content detection resulted in a content filtering action.", + "type": { + "$id": "663", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.anonymous.filtered" + }, + { + "$id": "664", + "kind": "property", + "name": "detected", + "serializedName": "detected", + "description": "Whether the labeled content category was detected in the content.", + "type": { + "$id": "665", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.anonymous.detected" + }, + { + "$id": "666", + "kind": "property", + "name": "citation", + "serializedName": "citation", + "description": "If available, the citation details describing the associated license and its location.", + "type": { + "$id": "667", + "kind": "model", + "name": "AzureContentFilterResultForChoiceProtectedMaterialCodeCitation", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.citation.anonymous", + "usage": "Output", + "decorators": [], + "properties": [ + { + "$id": "668", + "kind": "property", + "name": "license", + "serializedName": "license", + "description": "The name or identifier of the license associated with the detection.", + "type": { + "$id": "669", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.citation.anonymous.license" + }, + { + "$id": "670", + "kind": "property", + "name": "URL", + "serializedName": "URL", + "description": "The URL associated with the license.", + "type": { + "$id": "671", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.citation.anonymous.URL" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.anonymous.citation" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code" + }, + { + "$id": "672", + "kind": "property", + "name": "ungrounded_material", + "serializedName": "ungrounded_material", + "type": { + "$id": "673", + "kind": "model", + "name": "AzureContentFilterCompletionTextSpanDetectionResult", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpanDetectionResult", + "usage": "Output", + "decorators": [], + "properties": [ + { + "$id": "674", + "kind": "property", + "name": "filtered", + "serializedName": "filtered", + "description": "Whether the content detection resulted in a content filtering action.", + "type": { + "$id": "675", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpanDetectionResult.filtered" + }, + { + "$id": "676", + "kind": "property", + "name": "detected", + "serializedName": "detected", + "description": "Whether the labeled content category was detected in the content.", + "type": { + "$id": "677", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpanDetectionResult.detected" + }, + { + "$id": "678", + "kind": "property", + "name": "details", + "serializedName": "details", + "description": "Detailed information about the detected completion text spans.", + "type": { + "$id": "679", + "kind": "array", + "name": "ArrayAzureContentFilterCompletionTextSpan", + "valueType": { + "$id": "680", + "kind": "model", + "name": "AzureContentFilterCompletionTextSpan", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpan", + "usage": "Output", + "description": "A representation of a span of completion text as used by Azure OpenAI content filter results.", + "decorators": [], + "properties": [ + { + "$id": "681", + "kind": "property", + "name": "completion_start_offset", + "serializedName": "completion_start_offset", + "description": "Offset of the UTF32 code point which begins the span.", + "type": { + "$id": "682", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpan.completion_start_offset" + }, + { + "$id": "683", + "kind": "property", + "name": "completion_end_offset", + "serializedName": "completion_end_offset", + "description": "Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans.", + "type": { + "$id": "684", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpan.completion_end_offset" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpanDetectionResult.details" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.ungrounded_material" + } + ] + }, + { + "$ref": "654" + }, + { + "$ref": "661" + }, + { + "$ref": "667" + }, + { + "$ref": "673" + }, + { + "$ref": "680" + }, + { + "$id": "685", + "kind": "model", + "name": "AzureContentFilterResultForPrompt", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt", + "usage": "Output", + "description": "A content filter result associated with a single input prompt item into a generative AI system.", + "decorators": [], + "properties": [ + { + "$id": "686", + "kind": "property", + "name": "prompt_index", + "serializedName": "prompt_index", + "description": "The index of the input prompt associated with the accompanying content filter result categories.", + "type": { + "$id": "687", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.prompt_index" + }, + { + "$id": "688", + "kind": "property", + "name": "content_filter_results", + "serializedName": "content_filter_results", + "description": "The content filter category details for the result.", + "type": { + "$id": "689", + "kind": "model", + "name": "AzureContentFilterResultForPromptContentFilterResults", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous", + "usage": "Output", + "decorators": [], + "properties": [ + { + "$id": "690", + "kind": "property", + "name": "sexual", + "serializedName": "sexual", + "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse.", + "type": { + "$ref": "314" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.sexual" + }, + { + "$id": "691", + "kind": "property", + "name": "hate", + "serializedName": "hate", + "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size.", + "type": { + "$ref": "314" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.hate" + }, + { + "$id": "692", + "kind": "property", + "name": "violence", + "serializedName": "violence", + "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on.", + "type": { + "$ref": "314" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.violence" + }, + { + "$id": "693", + "kind": "property", + "name": "self_harm", + "serializedName": "self_harm", + "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself.", + "type": { + "$ref": "314" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.self_harm" + }, + { + "$id": "694", + "kind": "property", + "name": "profanity", + "serializedName": "profanity", + "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent.", + "type": { + "$ref": "322" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.profanity" + }, + { + "$id": "695", + "kind": "property", + "name": "custom_blocklists", + "serializedName": "custom_blocklists", + "description": "A collection of binary filtering outcomes for configured custom blocklists.", + "type": { + "$ref": "328" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.custom_blocklists" + }, + { + "$id": "696", + "kind": "property", + "name": "error", + "serializedName": "error", + "description": "If present, details about an error that prevented content filtering from completing its evaluation.", + "type": { + "$ref": "654" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.error" + }, + { + "$id": "697", + "kind": "property", + "name": "jailbreak", + "serializedName": "jailbreak", + "description": "A detection result that describes user prompt injection attacks, where malicious users deliberately exploit\nsystem vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content\ngeneration or violations of system-imposed restrictions.", + "type": { + "$ref": "322" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.jailbreak" + }, + { + "$id": "698", + "kind": "property", + "name": "indirect_attack", + "serializedName": "indirect_attack", + "description": "A detection result that describes attacks on systems powered by Generative AI models that can happen every time\nan application processes information that wasn’t directly authored by either the developer of the application or\nthe user.", + "type": { + "$ref": "322" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.indirect_attack" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results" + } + ] + }, + { + "$ref": "689" + }, + { + "$id": "699", + "kind": "model", + "name": "AzureChatMessageContext", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext", + "access": "public", + "usage": "Output", + "description": "An additional property, added to chat completion response messages, produced by the Azure OpenAI service when using\nextension behavior. This includes intent and citation information from the On Your Data feature.", + "decorators": [], + "properties": [ + { + "$id": "700", + "kind": "property", + "name": "intent", + "serializedName": "intent", + "description": "The detected intent from the chat history, which is used to carry conversation context between interactions", + "type": { + "$id": "701", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.intent" + }, + { + "$id": "702", + "kind": "property", + "name": "citations", + "serializedName": "citations", + "description": "The citations produced by the data retrieval.", + "type": { + "$id": "703", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "704", + "kind": "model", + "name": "AzureChatMessageContextCitation", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous", + "usage": "Output", + "decorators": [], + "properties": [ + { + "$id": "705", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The content of the citation.", + "type": { + "$id": "706", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.content" + }, + { + "$id": "707", + "kind": "property", + "name": "title", + "serializedName": "title", + "description": "The title for the citation.", + "type": { + "$id": "708", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.title" + }, + { + "$id": "709", + "kind": "property", + "name": "url", + "serializedName": "url", + "description": "The URL of the citation.", + "type": { + "$id": "710", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.url" + }, + { + "$id": "711", + "kind": "property", + "name": "filepath", + "serializedName": "filepath", + "description": "The file path for the citation.", + "type": { + "$id": "712", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.filepath" + }, + { + "$id": "713", + "kind": "property", + "name": "chunk_id", + "serializedName": "chunk_id", + "description": "The chunk ID for the citation.", + "type": { + "$id": "714", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.chunk_id" + }, + { + "$id": "715", + "kind": "property", + "name": "rerank_score", + "serializedName": "rerank_score", + "description": "The rerank score for the retrieval.", + "type": { + "$id": "716", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.rerank_score" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citations" + }, + { + "$id": "717", + "kind": "property", + "name": "all_retrieved_documents", + "serializedName": "all_retrieved_documents", + "description": "Summary information about documents retrieved by the data retrieval operation.", + "type": { + "$id": "718", + "kind": "model", + "name": "AzureChatMessageContextAllRetrievedDocuments", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous", + "usage": "Output", + "decorators": [], + "properties": [ + { + "$id": "719", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The content of the citation.", + "type": { + "$id": "720", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.content" + }, + { + "$id": "721", + "kind": "property", + "name": "title", + "serializedName": "title", + "description": "The title for the citation.", + "type": { + "$id": "722", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.title" + }, + { + "$id": "723", + "kind": "property", + "name": "url", + "serializedName": "url", + "description": "The URL of the citation.", + "type": { + "$id": "724", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.url" + }, + { + "$id": "725", + "kind": "property", + "name": "filepath", + "serializedName": "filepath", + "description": "The file path for the citation.", + "type": { + "$id": "726", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.filepath" + }, + { + "$id": "727", + "kind": "property", + "name": "chunk_id", + "serializedName": "chunk_id", + "description": "The chunk ID for the citation.", + "type": { + "$id": "728", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.chunk_id" + }, + { + "$id": "729", + "kind": "property", + "name": "rerank_score", + "serializedName": "rerank_score", + "description": "The rerank score for the retrieval.", + "type": { + "$id": "730", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.rerank_score" + }, + { + "$id": "731", + "kind": "property", + "name": "search_queries", + "serializedName": "search_queries", + "description": "The search queries executed to retrieve documents.", + "type": { + "$id": "732", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "733", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.search_queries" + }, + { + "$id": "734", + "kind": "property", + "name": "data_source_index", + "serializedName": "data_source_index", + "description": "The index of the data source used for retrieval.", + "type": { + "$id": "735", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.data_source_index" + }, + { + "$id": "736", + "kind": "property", + "name": "original_search_score", + "serializedName": "original_search_score", + "description": "The original search score for the retrieval.", + "type": { + "$id": "737", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.original_search_score" + }, + { + "$id": "738", + "kind": "property", + "name": "filter_reason", + "serializedName": "filter_reason", + "description": "If applicable, an indication of why the document was filtered.", + "type": { + "$ref": "41" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.filter_reason" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents" + } + ] + }, + { + "$ref": "704" + }, + { + "$ref": "718" + }, + { + "$id": "739", + "kind": "model", + "name": "AzureOpenAIChatErrorResponse", + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatErrorResponse", + "access": "public", + "usage": "Output", + "description": "A structured representation of an error an Azure OpenAI request.", + "decorators": [], + "properties": [ + { + "$id": "740", + "kind": "property", + "name": "error", + "serializedName": "error", + "type": { + "$id": "741", + "kind": "model", + "name": "AzureOpenAIChatError", + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError", + "access": "public", + "usage": "Output", + "description": "The structured representation of an error from an Azure OpenAI chat completion request.", + "decorators": [], + "properties": [ + { + "$id": "742", + "kind": "property", + "name": "code", + "serializedName": "code", + "description": "The distinct, machine-generated identifier for the error.", + "type": { + "$id": "743", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.code" + }, + { + "$id": "744", + "kind": "property", + "name": "message", + "serializedName": "message", + "description": "A human-readable message associated with the error.", + "type": { + "$id": "745", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.message" + }, + { + "$id": "746", + "kind": "property", + "name": "param", + "serializedName": "param", + "description": "If applicable, the request input parameter associated with the error", + "type": { + "$id": "747", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.param" + }, + { + "$id": "748", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "If applicable, the input line number associated with the error.", + "type": { + "$id": "749", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.type" + }, + { + "$id": "750", + "kind": "property", + "name": "inner_error", + "serializedName": "inner_error", + "description": "If applicable, an upstream error that originated this error.", + "type": { + "$id": "751", + "kind": "model", + "name": "AzureOpenAIChatErrorInnerError", + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error.anonymous", + "usage": "Output", + "decorators": [], + "properties": [ + { + "$id": "752", + "kind": "property", + "name": "code", + "serializedName": "code", + "description": "The code associated with the inner error.", + "type": { + "$id": "753", + "kind": "constant", + "valueType": { + "$ref": "47" + }, + "value": "ResponsibleAIPolicyViolation", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error.anonymous.code" + }, + { + "$id": "754", + "kind": "property", + "name": "revised_prompt", + "serializedName": "revised_prompt", + "description": "If applicable, the modified prompt used for generation.", + "type": { + "$id": "755", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error.anonymous.revised_prompt" + }, + { + "$id": "756", + "kind": "property", + "name": "content_filter_results", + "serializedName": "content_filter_results", + "description": "The content filter result details associated with the inner error.", + "type": { + "$ref": "685" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error.anonymous.content_filter_results" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatErrorResponse.error" + } + ] + }, + { + "$ref": "741" + }, + { + "$ref": "751" + }, + { + "$id": "757", + "kind": "model", + "name": "AzureContentFilterBlocklistIdResult", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistIdResult", + "access": "public", + "usage": "Output", + "description": "A content filter result item that associates an existing custom blocklist ID with a value indicating whether or not\nthe corresponding blocklist resulted in content being filtered.", + "decorators": [], + "properties": [ + { + "$id": "758", + "kind": "property", + "name": "id", + "serializedName": "id", + "description": "The ID of the custom blocklist associated with the filtered status.", + "type": { + "$id": "759", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistIdResult.id" + }, + { + "$id": "760", + "kind": "property", + "name": "filtered", + "serializedName": "filtered", + "description": "Whether the associated blocklist resulted in the content being filtered.", + "type": { + "$id": "761", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistIdResult.filtered" + } + ] + }, + { + "$id": "762", + "kind": "model", + "name": "AzureOpenAIFile", + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile", + "access": "public", + "usage": "Output", + "decorators": [], + "properties": [ + { + "$id": "763", + "kind": "property", + "name": "id", + "serializedName": "id", + "description": "The file identifier, which can be referenced in the API endpoints.", + "type": { + "$id": "764", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.id" + }, + { + "$id": "765", + "kind": "property", + "name": "bytes", + "serializedName": "bytes", + "description": "The size of the file, in bytes.", + "type": { + "$id": "766", + "kind": "nullable", + "type": { + "$id": "767", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.bytes" + }, + { + "$id": "768", + "kind": "property", + "name": "created_at", + "serializedName": "created_at", + "description": "The Unix timestamp (in seconds) for when the file was created.", + "type": { + "$id": "769", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "unixTimestamp", + "wireType": { + "$id": "770", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.created_at" + }, + { + "$id": "771", + "kind": "property", + "name": "filename", + "serializedName": "filename", + "description": "The name of the file.", + "type": { + "$id": "772", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.filename" + }, + { + "$id": "773", + "kind": "property", + "name": "object", + "serializedName": "object", + "description": "The object type, which is always `file`.", + "type": { + "$id": "774", + "kind": "constant", + "valueType": { + "$ref": "82" + }, + "value": "file", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.object" + }, + { + "$id": "775", + "kind": "property", + "name": "purpose", + "serializedName": "purpose", + "description": "The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results` and `vision`.", + "type": { + "$ref": "66" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.purpose" + }, + { + "$id": "776", + "kind": "property", + "name": "status_details", + "serializedName": "status_details", + "description": "Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.", + "type": { + "$id": "777", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.status_details" + }, + { + "$id": "778", + "kind": "property", + "name": "status", + "serializedName": "status", + "type": { + "$ref": "85" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.status" + } + ] + }, + { + "$id": "779", + "kind": "model", + "name": "AzureImage", + "crossLanguageDefinitionId": "AzureOpenAI.AzureImage", + "access": "public", + "usage": "Output", + "decorators": [], + "baseModel": { + "$ref": "286" + }, + "properties": [ + { + "$id": "780", + "kind": "property", + "name": "prompt_filter_results", + "serializedName": "prompt_filter_results", + "type": { + "$ref": "311" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureImage.prompt_filter_results" + }, + { + "$id": "781", + "kind": "property", + "name": "content_filter_results", + "serializedName": "content_filter_results", + "type": { + "$ref": "312" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureImage.content_filter_results" + } + ] + }, + { + "$id": "782", + "kind": "model", + "name": "AzureCreateChatCompletionRequest", + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest", + "usage": "None", + "description": "The extended request model for chat completions against the Azure OpenAI service.\nThis adds the ability to provide data sources for the On Your Data feature.", + "decorators": [], + "properties": [ + { + "$id": "783", + "kind": "property", + "name": "messages", + "serializedName": "messages", + "description": "A list of messages comprising the conversation so far. Depending on the\n[model](/docs/models) you use, different message types (modalities) are\nsupported, like [text](/docs/guides/text-generation),\n[images](/docs/guides/vision), and [audio](/docs/guides/audio).", + "type": { + "$id": "784", + "kind": "array", + "name": "ArrayChatCompletionRequestMessage", + "valueType": { + "$id": "785", + "kind": "model", + "name": "ChatCompletionRequestMessage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessage", + "usage": "None", + "decorators": [], + "discriminatorProperty": { + "$id": "786", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the author of this message.", + "type": { + "$id": "787", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessage.role" + }, + "properties": [ + { + "$ref": "786" + } + ], + "discriminatedSubtypes": { + "$id": "788", + "system": { + "$id": "789", + "kind": "model", + "name": "ChatCompletionRequestSystemMessage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestSystemMessage", + "usage": "None", + "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, use `developer` messages\nfor this purpose instead.", + "discriminatorValue": "system", + "decorators": [], + "baseModel": { + "$ref": "785" + }, + "properties": [ + { + "$id": "790", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The contents of the system message.", + "type": { + "$id": "791", + "kind": "union", + "name": "ChatCompletionRequestSystemMessageContent", + "variantTypes": [ + { + "$id": "792", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "793", + "kind": "array", + "name": "ArrayChatCompletionRequestSystemMessageContentPart", + "valueType": { + "$id": "794", + "kind": "union", + "name": "ChatCompletionRequestSystemMessageContentPart", + "variantTypes": [ + { + "$id": "795", + "kind": "model", + "name": "ChatCompletionRequestMessageContentPartText", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartText", + "usage": "None", + "description": "Learn about [text inputs](/docs/guides/text-generation).", + "decorators": [], + "properties": [ + { + "$id": "796", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the content part.", + "type": { + "$id": "797", + "kind": "constant", + "valueType": { + "$ref": "101" + }, + "value": "text", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartText.type" + }, + { + "$id": "798", + "kind": "property", + "name": "text", + "serializedName": "text", + "description": "The text content.", + "type": { + "$id": "799", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartText.text" + } + ] + } + ], + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestSystemMessage.content" + }, + { + "$id": "800", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the messages author, in this case `system`.", + "type": { + "$id": "801", + "kind": "constant", + "valueType": { + "$id": "802", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "system", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestSystemMessage.role" + }, + { + "$id": "803", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", + "type": { + "$id": "804", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestSystemMessage.name" + } + ] + }, + "developer": { + "$id": "805", + "kind": "model", + "name": "ChatCompletionRequestDeveloperMessage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestDeveloperMessage", + "usage": "None", + "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, `developer` messages\nreplace the previous `system` messages.", + "discriminatorValue": "developer", + "decorators": [], + "baseModel": { + "$ref": "785" + }, + "properties": [ + { + "$id": "806", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The contents of the developer message.", + "type": { + "$id": "807", + "kind": "union", + "name": "ChatCompletionRequestDeveloperMessageContent", + "variantTypes": [ + { + "$id": "808", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "809", + "kind": "array", + "name": "ArrayChatCompletionRequestMessageContentPartText", + "valueType": { + "$ref": "795" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestDeveloperMessage.content" + }, + { + "$id": "810", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the messages author, in this case `developer`.", + "type": { + "$id": "811", + "kind": "constant", + "valueType": { + "$id": "812", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "developer", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestDeveloperMessage.role" + }, + { + "$id": "813", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", + "type": { + "$id": "814", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestDeveloperMessage.name" + } + ] + }, + "user": { + "$id": "815", + "kind": "model", + "name": "ChatCompletionRequestUserMessage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestUserMessage", + "usage": "None", + "description": "Messages sent by an end user, containing prompts or additional context\ninformation.", + "discriminatorValue": "user", + "decorators": [], + "baseModel": { + "$ref": "785" + }, + "properties": [ + { + "$id": "816", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The contents of the user message.", + "type": { + "$id": "817", + "kind": "union", + "name": "ChatCompletionRequestUserMessageContent", + "variantTypes": [ + { + "$id": "818", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "819", + "kind": "array", + "name": "ArrayChatCompletionRequestUserMessageContentPart", + "valueType": { + "$id": "820", + "kind": "union", + "name": "ChatCompletionRequestUserMessageContentPart", + "variantTypes": [ + { + "$ref": "795" + }, + { + "$id": "821", + "kind": "model", + "name": "ChatCompletionRequestMessageContentPartImage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage", + "usage": "None", + "description": "Learn about [image inputs](/docs/guides/vision).", + "decorators": [], + "properties": [ + { + "$id": "822", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the content part.", + "type": { + "$id": "823", + "kind": "constant", + "valueType": { + "$ref": "104" + }, + "value": "image_url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.type" + }, + { + "$id": "824", + "kind": "property", + "name": "image_url", + "serializedName": "image_url", + "type": { + "$id": "825", + "kind": "model", + "name": "ChatCompletionRequestMessageContentPartImageImageUrl", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.image_url.anonymous", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "826", + "kind": "property", + "name": "url", + "serializedName": "url", + "description": "Either a URL of the image or the base64 encoded image data.", + "type": { + "$id": "827", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.image_url.anonymous.url" + }, + { + "$id": "828", + "kind": "property", + "name": "detail", + "serializedName": "detail", + "description": "Specifies the detail level of the image. Learn more in the [Vision guide](/docs/guides/vision#low-or-high-fidelity-image-understanding).", + "type": { + "$ref": "107" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.image_url.anonymous.detail" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.image_url" + } + ] + }, + { + "$id": "829", + "kind": "model", + "name": "ChatCompletionRequestMessageContentPartAudio", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio", + "usage": "None", + "description": "Learn about [audio inputs](/docs/guides/audio).", + "decorators": [], + "properties": [ + { + "$id": "830", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the content part. Always `input_audio`.", + "type": { + "$id": "831", + "kind": "constant", + "valueType": { + "$ref": "115" + }, + "value": "input_audio", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.type" + }, + { + "$id": "832", + "kind": "property", + "name": "input_audio", + "serializedName": "input_audio", + "type": { + "$id": "833", + "kind": "model", + "name": "ChatCompletionRequestMessageContentPartAudioInputAudio", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.input_audio.anonymous", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "834", + "kind": "property", + "name": "data", + "serializedName": "data", + "description": "Base64 encoded audio data.", + "type": { + "$id": "835", + "kind": "bytes", + "name": "bytes", + "encode": "base64", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.input_audio.anonymous.data" + }, + { + "$id": "836", + "kind": "property", + "name": "format", + "serializedName": "format", + "description": "The format of the encoded audio data. Currently supports \"wav\" and \"mp3\".", + "type": { + "$ref": "118" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.input_audio.anonymous.format" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.input_audio" + } + ] + } + ], + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestUserMessage.content" + }, + { + "$id": "837", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the messages author, in this case `user`.", + "type": { + "$id": "838", + "kind": "constant", + "valueType": { + "$id": "839", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "user", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestUserMessage.role" + }, + { + "$id": "840", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", + "type": { + "$id": "841", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestUserMessage.name" + } + ] + }, + "assistant": { + "$id": "842", + "kind": "model", + "name": "ChatCompletionRequestAssistantMessage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage", + "usage": "None", + "description": "Messages sent by the model in response to user messages.", + "discriminatorValue": "assistant", + "decorators": [], + "baseModel": { + "$ref": "785" + }, + "properties": [ + { + "$id": "843", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.", + "type": { + "$id": "844", + "kind": "nullable", + "type": { + "$id": "845", + "kind": "union", + "name": "ChatCompletionRequestAssistantMessageContent", + "variantTypes": [ + { + "$id": "846", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "847", + "kind": "array", + "name": "ArrayChatCompletionRequestAssistantMessageContentPart", + "valueType": { + "$id": "848", + "kind": "union", + "name": "ChatCompletionRequestAssistantMessageContentPart", + "variantTypes": [ + { + "$ref": "795" + }, + { + "$id": "849", + "kind": "model", + "name": "ChatCompletionRequestMessageContentPartRefusal", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartRefusal", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "850", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the content part.", + "type": { + "$id": "851", + "kind": "constant", + "valueType": { + "$ref": "124" + }, + "value": "refusal", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartRefusal.type" + }, + { + "$id": "852", + "kind": "property", + "name": "refusal", + "serializedName": "refusal", + "description": "The refusal message generated by the model.", + "type": { + "$id": "853", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartRefusal.refusal" + } + ] + } + ], + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + ], + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.content" + }, + { + "$id": "854", + "kind": "property", + "name": "refusal", + "serializedName": "refusal", + "description": "The refusal message by the assistant.", + "type": { + "$id": "855", + "kind": "nullable", + "type": { + "$id": "856", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.refusal" + }, + { + "$id": "857", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the messages author, in this case `assistant`.", + "type": { + "$id": "858", + "kind": "constant", + "valueType": { + "$id": "859", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "assistant", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.role" + }, + { + "$id": "860", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", + "type": { + "$id": "861", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.name" + }, + { + "$id": "862", + "kind": "property", + "name": "audio", + "serializedName": "audio", + "description": "Data about a previous audio response from the model.\n[Learn more](/docs/guides/audio).", + "type": { + "$id": "863", + "kind": "nullable", + "type": { + "$id": "864", + "kind": "model", + "name": "ChatCompletionRequestAssistantMessageAudio", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.audio.anonymous", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "865", + "kind": "property", + "name": "id", + "serializedName": "id", + "description": "Unique identifier for a previous audio response from the model.", + "type": { + "$id": "866", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.audio.anonymous.id" + } + ] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.audio" + }, + { + "$id": "867", + "kind": "property", + "name": "tool_calls", + "serializedName": "tool_calls", + "type": { + "$id": "868", + "kind": "array", + "name": "ChatCompletionMessageToolCalls", + "valueType": { + "$id": "869", + "kind": "model", + "name": "ChatCompletionMessageToolCall", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "870", + "kind": "property", + "name": "id", + "serializedName": "id", + "description": "The ID of the tool call.", + "type": { + "$id": "871", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.id" + }, + { + "$id": "872", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the tool. Currently, only `function` is supported.", + "type": { + "$id": "873", + "kind": "constant", + "valueType": { + "$ref": "127" + }, + "value": "function", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.type" + }, + { + "$id": "874", + "kind": "property", + "name": "function", + "serializedName": "function", + "description": "The function that the model called.", + "type": { + "$id": "875", + "kind": "model", + "name": "ChatCompletionMessageToolCallFunction", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.function.anonymous", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "876", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "The name of the function to call.", + "type": { + "$id": "877", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.function.anonymous.name" + }, + { + "$id": "878", + "kind": "property", + "name": "arguments", + "serializedName": "arguments", + "description": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.", + "type": { + "$id": "879", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.function.anonymous.arguments" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.function" + } + ] + }, + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCalls", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.tool_calls" + }, + { + "$id": "880", + "kind": "property", + "name": "function_call", + "serializedName": "function_call", + "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.", + "type": { + "$id": "881", + "kind": "nullable", + "type": { + "$id": "882", + "kind": "model", + "name": "ChatCompletionRequestAssistantMessageFunctionCall", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.function_call.anonymous", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "883", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "884", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.function_call.anonymous.name" + }, + { + "$id": "885", + "kind": "property", + "name": "arguments", + "serializedName": "arguments", + "type": { + "$id": "886", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.function_call.anonymous.arguments" + } + ] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.function_call" + } + ] + }, + "tool": { + "$id": "887", + "kind": "model", + "name": "ChatCompletionRequestToolMessage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestToolMessage", + "usage": "None", + "discriminatorValue": "tool", + "decorators": [], + "baseModel": { + "$ref": "785" + }, + "properties": [ + { + "$id": "888", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the messages author, in this case `tool`.", + "type": { + "$id": "889", + "kind": "constant", + "valueType": { + "$id": "890", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "tool", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestToolMessage.role" + }, + { + "$id": "891", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The contents of the tool message.", + "type": { + "$id": "892", + "kind": "union", + "name": "ChatCompletionRequestToolMessageContent", + "variantTypes": [ + { + "$id": "893", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "894", + "kind": "array", + "name": "ArrayChatCompletionRequestToolMessageContentPart", + "valueType": { + "$id": "895", + "kind": "union", + "name": "ChatCompletionRequestToolMessageContentPart", + "variantTypes": [ + { + "$ref": "795" + } + ], + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestToolMessage.content" + }, + { + "$id": "896", + "kind": "property", + "name": "tool_call_id", + "serializedName": "tool_call_id", + "description": "Tool call that this message is responding to.", + "type": { + "$id": "897", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestToolMessage.tool_call_id" + } + ] + }, + "function": { + "$id": "898", + "kind": "model", + "name": "ChatCompletionRequestFunctionMessage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestFunctionMessage", + "usage": "None", + "deprecation": "This field is marked as deprecated.", + "discriminatorValue": "function", + "decorators": [], + "baseModel": { + "$ref": "785" + }, + "properties": [ + { + "$id": "899", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the messages author, in this case `function`.", + "type": { + "$id": "900", + "kind": "constant", + "valueType": { + "$id": "901", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "function", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestFunctionMessage.role" + }, + { + "$id": "902", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The contents of the function message.", + "type": { + "$id": "903", + "kind": "nullable", + "type": { + "$id": "904", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestFunctionMessage.content" + }, + { + "$id": "905", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "The name of the function to call.", + "type": { + "$id": "906", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestFunctionMessage.name" + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.messages" + }, + { + "$id": "907", + "kind": "property", + "name": "store", + "serializedName": "store", + "description": "Whether or not to store the output of this chat completion request for\nuse in our [model distillation](/docs/guides/distillation) or\n[evals](/docs/guides/evals) products.", + "type": { + "$id": "908", + "kind": "nullable", + "type": { + "$id": "909", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.store" + }, + { + "$id": "910", + "kind": "property", + "name": "reasoning_effort", + "serializedName": "reasoning_effort", + "description": "**o1 models only** \n\nConstrains effort on reasoning for \n[reasoning models](https://platform.openai.com/docs/guides/reasoning).\nCurrently supported values are `low`, `medium`, and `high`. Reducing\nreasoning effort can result in faster responses and fewer tokens used\non reasoning in a response.", + "type": { + "$ref": "130" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.reasoning_effort" + }, + { + "$id": "911", + "kind": "property", + "name": "metadata", + "serializedName": "metadata", + "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.", + "type": { + "$id": "912", + "kind": "dict", + "keyType": { + "$id": "913", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "914", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.metadata" + }, + { + "$id": "915", + "kind": "property", + "name": "frequency_penalty", + "serializedName": "frequency_penalty", + "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\ntheir existing frequency in the text so far, decreasing the model's\nlikelihood to repeat the same line verbatim.", + "type": { + "$id": "916", + "kind": "nullable", + "type": { + "$id": "917", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.frequency_penalty" + }, + { + "$id": "918", + "kind": "property", + "name": "logit_bias", + "serializedName": "logit_bias", + "description": "Modify the likelihood of specified tokens appearing in the completion.\n\nAccepts a JSON object that maps tokens (specified by their token ID in the\ntokenizer) to an associated bias value from -100 to 100. Mathematically,\nthe bias is added to the logits generated by the model prior to sampling.\nThe exact effect will vary per model, but values between -1 and 1 should\ndecrease or increase likelihood of selection; values like -100 or 100\nshould result in a ban or exclusive selection of the relevant token.", + "type": { + "$id": "919", + "kind": "nullable", + "type": { + "$id": "920", + "kind": "dict", + "keyType": { + "$id": "921", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "922", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.logit_bias" + }, + { + "$id": "923", + "kind": "property", + "name": "logprobs", + "serializedName": "logprobs", + "description": "Whether to return log probabilities of the output tokens or not. If true,\nreturns the log probabilities of each output token returned in the\n`content` of `message`.", + "type": { + "$id": "924", + "kind": "nullable", + "type": { + "$id": "925", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.logprobs" + }, + { + "$id": "926", + "kind": "property", + "name": "top_logprobs", + "serializedName": "top_logprobs", + "description": "An integer between 0 and 20 specifying the number of most likely tokens to\nreturn at each token position, each with an associated log probability.\n`logprobs` must be set to `true` if this parameter is used.", + "type": { + "$id": "927", + "kind": "nullable", + "type": { + "$id": "928", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.top_logprobs" + }, + { + "$id": "929", + "kind": "property", + "name": "max_tokens", + "serializedName": "max_tokens", + "description": "The maximum number of [tokens](/tokenizer) that can be generated in the\nchat completion. This value can be used to control\n[costs](https://openai.com/api/pricing/) for text generated via API.\n\nThis value is now deprecated in favor of `max_completion_tokens`, and is\nnot compatible with [o1 series models](/docs/guides/reasoning).", + "type": { + "$id": "930", + "kind": "nullable", + "type": { + "$id": "931", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.max_tokens" + }, + { + "$id": "932", + "kind": "property", + "name": "max_completion_tokens", + "serializedName": "max_completion_tokens", + "description": "An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](/docs/guides/reasoning).", + "type": { + "$id": "933", + "kind": "nullable", + "type": { + "$id": "934", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.max_completion_tokens" + }, + { + "$id": "935", + "kind": "property", + "name": "n", + "serializedName": "n", + "description": "How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.", + "type": { + "$id": "936", + "kind": "nullable", + "type": { + "$id": "937", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.n" + }, + { + "$id": "938", + "kind": "property", + "name": "modalities", + "serializedName": "modalities", + "type": { + "$id": "939", + "kind": "nullable", + "type": { + "$id": "940", + "kind": "array", + "name": "ChatCompletionModalities", + "valueType": { + "$ref": "138" + }, + "crossLanguageDefinitionId": "OpenAI.ChatCompletionModalities", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.modalities" + }, + { + "$id": "941", + "kind": "property", + "name": "prediction", + "serializedName": "prediction", + "description": "Configuration for a [Predicted Output](/docs/guides/predicted-outputs),\nwhich can greatly improve response times when large parts of the model\nresponse are known ahead of time. This is most common when you are\nregenerating a file with only minor changes to most of the content.", + "type": { + "$id": "942", + "kind": "nullable", + "type": { + "$id": "943", + "kind": "model", + "name": "ChatOutputPrediction", + "crossLanguageDefinitionId": "OpenAI.ChatOutputPrediction", + "usage": "None", + "description": "Base representation of predicted output from a model.", + "decorators": [], + "discriminatorProperty": { + "$id": "944", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$ref": "144" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatOutputPrediction.type" + }, + "properties": [ + { + "$ref": "944" + } + ], + "discriminatedSubtypes": { + "$id": "945", + "content": { + "$id": "946", + "kind": "model", + "name": "ChatOutputPredictionContent", + "crossLanguageDefinitionId": "OpenAI.ChatOutputPredictionContent", + "usage": "None", + "description": "Static predicted output content, such as the content of a text file that is\nbeing regenerated.", + "discriminatorValue": "content", + "decorators": [], + "baseModel": { + "$ref": "943" + }, + "properties": [ + { + "$id": "947", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the predicted content you want to provide. This type is\ncurrently always `content`.", + "type": { + "$id": "948", + "kind": "constant", + "valueType": { + "$id": "949", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "content", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatOutputPredictionContent.type" + }, + { + "$id": "950", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The content that should be matched when generating a model response.\nIf generated tokens would match this content, the entire model response\ncan be returned much more quickly.", + "type": { + "$id": "951", + "kind": "union", + "name": "ChatOutputPredictionContentContent", + "variantTypes": [ + { + "$id": "952", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "953", + "kind": "array", + "name": "ArrayChatCompletionRequestMessageContentPartText", + "valueType": { + "$ref": "795" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatOutputPredictionContent.content" + } + ] + } + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.prediction" + }, + { + "$id": "954", + "kind": "property", + "name": "audio", + "serializedName": "audio", + "description": "Parameters for audio output. Required when audio output is requested with\n`modalities: [\"audio\"]`. [Learn more](/docs/guides/audio).", + "type": { + "$id": "955", + "kind": "nullable", + "type": { + "$id": "956", + "kind": "model", + "name": "AzureCreateChatCompletionRequestAudio", + "crossLanguageDefinitionId": "OpenAI.AzureCreateChatCompletionRequest.audio.anonymous", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "957", + "kind": "property", + "name": "voice", + "serializedName": "voice", + "description": "The voice the model uses to respond. Supported voices are `ash`, `ballad`, `coral`, `sage`, and `verse` (also supported but not recommended are `alloy`, `echo`, and `shimmer`; these voices are less expressive).", + "type": { + "$ref": "148" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateChatCompletionRequestCommonBase.audio.anonymous.voice" + }, + { + "$id": "958", + "kind": "property", + "name": "format", + "serializedName": "format", + "description": "Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`,\n`opus`, or `pcm16`.", + "type": { + "$ref": "166" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateChatCompletionRequestCommonBase.audio.anonymous.format" + } + ] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.audio" + }, + { + "$id": "959", + "kind": "property", + "name": "presence_penalty", + "serializedName": "presence_penalty", + "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\nwhether they appear in the text so far, increasing the model's likelihood\nto talk about new topics.", + "type": { + "$id": "960", + "kind": "nullable", + "type": { + "$id": "961", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.presence_penalty" + }, + { + "$id": "962", + "kind": "property", + "name": "response_format", + "serializedName": "response_format", + "description": "An object specifying the format that the model must output.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\nStructured Outputs which ensures the model will match your supplied JSON\nschema. Learn more in the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures\nthe message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model\nto produce JSON yourself via a system or user message. Without this, the\nmodel may generate an unending stream of whitespace until the generation\nreaches the token limit, resulting in a long-running and seemingly \"stuck\"\nrequest. Also note that the message content may be partially cut off if\n`finish_reason=\"length\"`, which indicates the generation exceeded\n`max_tokens` or the conversation exceeded the max context length.", + "type": { + "$id": "963", + "kind": "model", + "name": "ChatResponseFormat", + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormat", + "usage": "None", + "decorators": [], + "discriminatorProperty": { + "$id": "964", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "965", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormat.type" + }, + "properties": [ + { + "$ref": "964" + } + ], + "discriminatedSubtypes": { + "$id": "966", + "text": { + "$id": "967", + "kind": "model", + "name": "ChatResponseFormatText", + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatText", + "usage": "None", + "discriminatorValue": "text", + "decorators": [], + "baseModel": { + "$ref": "963" + }, + "properties": [ + { + "$id": "968", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of response format being defined: `text`", + "type": { + "$id": "969", + "kind": "constant", + "valueType": { + "$id": "970", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "text", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatText.type" + } + ] + }, + "json_object": { + "$id": "971", + "kind": "model", + "name": "ChatResponseFormatJsonObject", + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonObject", + "usage": "None", + "discriminatorValue": "json_object", + "decorators": [], + "baseModel": { + "$ref": "963" + }, + "properties": [ + { + "$id": "972", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of response format being defined: `json_object`", + "type": { + "$id": "973", + "kind": "constant", + "valueType": { + "$id": "974", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "json_object", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonObject.type" + } + ] + }, + "json_schema": { + "$id": "975", + "kind": "model", + "name": "ChatResponseFormatJsonSchema", + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema", + "usage": "None", + "discriminatorValue": "json_schema", + "decorators": [], + "baseModel": { + "$ref": "963" + }, + "properties": [ + { + "$id": "976", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of response format being defined: `json_schema`", + "type": { + "$id": "977", + "kind": "constant", + "valueType": { + "$id": "978", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "json_schema", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.type" + }, + { + "$id": "979", + "kind": "property", + "name": "json_schema", + "serializedName": "json_schema", + "type": { + "$id": "980", + "kind": "model", + "name": "ChatResponseFormatJsonSchemaJsonSchema", + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "981", + "kind": "property", + "name": "description", + "serializedName": "description", + "description": "A description of what the response format is for, used by the model to determine how to respond in the format.", + "type": { + "$id": "982", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous.description" + }, + { + "$id": "983", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "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.", + "type": { + "$id": "984", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous.name" + }, + { + "$id": "985", + "kind": "property", + "name": "schema", + "serializedName": "schema", + "type": { + "$id": "986", + "kind": "model", + "name": "ResponseFormatJsonSchemaSchema", + "crossLanguageDefinitionId": "OpenAI.ResponseFormatJsonSchemaSchema", + "usage": "None", + "description": "The schema for the response format, described as a JSON Schema object.", + "decorators": [], + "additionalProperties": { + "$id": "987", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "properties": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous.schema" + }, + { + "$id": "988", + "kind": "property", + "name": "strict", + "serializedName": "strict", + "description": "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](/docs/guides/structured-outputs).", + "type": { + "$id": "989", + "kind": "nullable", + "type": { + "$id": "990", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous.strict" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema" + } + ] + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.response_format" + }, + { + "$id": "991", + "kind": "property", + "name": "seed", + "serializedName": "seed", + "description": "This feature is in Beta.\nIf specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.", + "type": { + "$id": "992", + "kind": "nullable", + "type": { + "$id": "993", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.seed" + }, + { + "$id": "994", + "kind": "property", + "name": "stop", + "serializedName": "stop", + "description": "Up to 4 sequences where the API will stop generating further tokens.", + "type": { + "$id": "995", + "kind": "nullable", + "type": { + "$id": "996", + "kind": "union", + "name": "AzureCreateChatCompletionRequestStop", + "variantTypes": [ + { + "$id": "997", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "998", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "999", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + ], + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.stop" + }, + { + "$id": "1000", + "kind": "property", + "name": "stream", + "serializedName": "stream", + "description": "If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).", + "type": { + "$id": "1001", + "kind": "nullable", + "type": { + "$id": "1002", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.stream" + }, + { + "$id": "1003", + "kind": "property", + "name": "stream_options", + "serializedName": "stream_options", + "type": { + "$id": "1004", + "kind": "nullable", + "type": { + "$id": "1005", + "kind": "model", + "name": "ChatCompletionStreamOptions", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionStreamOptions", + "usage": "None", + "description": "Options for streaming response. Only set this when you set `stream: true`.", + "decorators": [], + "properties": [ + { + "$id": "1006", + "kind": "property", + "name": "include_usage", + "serializedName": "include_usage", + "description": "If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.", + "type": { + "$id": "1007", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionStreamOptions.include_usage" + } + ] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.stream_options" + }, + { + "$id": "1008", + "kind": "property", + "name": "temperature", + "serializedName": "temperature", + "description": "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.\nWe generally recommend altering this or `top_p` but not both.", + "type": { + "$id": "1009", + "kind": "nullable", + "type": { + "$id": "1010", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.temperature" + }, + { + "$id": "1011", + "kind": "property", + "name": "top_p", + "serializedName": "top_p", + "description": "An alternative to sampling with temperature, called nucleus sampling,\nwhere the model considers the results of the tokens with top_p probability\nmass. So 0.1 means only the tokens comprising the top 10% probability mass\nare considered.\n\nWe generally recommend altering this or `temperature` but not both.", + "type": { + "$id": "1012", + "kind": "nullable", + "type": { + "$id": "1013", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.top_p" + }, + { + "$id": "1014", + "kind": "property", + "name": "tools", + "serializedName": "tools", + "description": "A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.", + "type": { + "$id": "1015", + "kind": "array", + "name": "ArrayChatCompletionTool", + "valueType": { + "$id": "1016", + "kind": "model", + "name": "ChatCompletionTool", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionTool", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "1017", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the tool. Currently, only `function` is supported.", + "type": { + "$id": "1018", + "kind": "constant", + "valueType": { + "$ref": "178" + }, + "value": "function", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionTool.type" + }, + { + "$id": "1019", + "kind": "property", + "name": "function", + "serializedName": "function", + "type": { + "$id": "1020", + "kind": "model", + "name": "FunctionObject", + "crossLanguageDefinitionId": "OpenAI.FunctionObject", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "1021", + "kind": "property", + "name": "description", + "serializedName": "description", + "description": "A description of what the function does, used by the model to choose when and how to call the function.", + "type": { + "$id": "1022", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.FunctionObject.description" + }, + { + "$id": "1023", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", + "type": { + "$id": "1024", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.FunctionObject.name" + }, + { + "$id": "1025", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\n\nOmitting `parameters` defines a function with an empty parameter list.", + "type": { + "$id": "1026", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.FunctionObject.parameters" + }, + { + "$id": "1027", + "kind": "property", + "name": "strict", + "serializedName": "strict", + "description": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).", + "type": { + "$id": "1028", + "kind": "nullable", + "type": { + "$id": "1029", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.FunctionObject.strict" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionTool.function" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.tools" + }, + { + "$id": "1030", + "kind": "property", + "name": "tool_choice", + "serializedName": "tool_choice", + "type": { + "$id": "1031", + "kind": "union", + "name": "ChatCompletionToolChoiceOption", + "variantTypes": [ + { + "$ref": "181" + }, + { + "$id": "1032", + "kind": "model", + "name": "ChatCompletionNamedToolChoice", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice", + "usage": "None", + "description": "Specifies a tool the model should use. Use to force the model to call a specific function.", + "decorators": [], + "properties": [ + { + "$id": "1033", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the tool. Currently, only `function` is supported.", + "type": { + "$id": "1034", + "kind": "constant", + "valueType": { + "$ref": "189" + }, + "value": "function", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice.type" + }, + { + "$id": "1035", + "kind": "property", + "name": "function", + "serializedName": "function", + "type": { + "$id": "1036", + "kind": "model", + "name": "ChatCompletionNamedToolChoiceFunction", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice.function.anonymous", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "1037", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "The name of the function to call.", + "type": { + "$id": "1038", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice.function.anonymous.name" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice.function" + } + ] + } + ], + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.tool_choice" + }, + { + "$id": "1039", + "kind": "property", + "name": "parallel_tool_calls", + "serializedName": "parallel_tool_calls", + "type": { + "$id": "1040", + "kind": "boolean", + "name": "ParallelToolCalls", + "crossLanguageDefinitionId": "OpenAI.ParallelToolCalls", + "baseType": { + "$id": "1041", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.parallel_tool_calls" + }, + { + "$id": "1042", + "kind": "property", + "name": "user", + "serializedName": "user", + "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).", + "type": { + "$id": "1043", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.user" + }, + { + "$id": "1044", + "kind": "property", + "name": "function_call", + "serializedName": "function_call", + "description": "Deprecated in favor of `tool_choice`.\n\nControls which (if any) function is called by the model.\n\n`none` means the model will not call a function and instead generates a\nmessage.\n\n`auto` means the model can pick between generating a message or calling a\nfunction.\n\nSpecifying a particular function via `{\"name\": \"my_function\"}` forces the\nmodel to call that function.\n\n`none` is the default when no functions are present. `auto` is the default\nif functions are present.", + "type": { + "$id": "1045", + "kind": "union", + "name": "AzureCreateChatCompletionRequestFunctionCall", + "variantTypes": [ + { + "$id": "1046", + "kind": "constant", + "valueType": { + "$id": "1047", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "none", + "decorators": [] + }, + { + "$id": "1048", + "kind": "constant", + "valueType": { + "$id": "1049", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "auto", + "decorators": [] + }, + { + "$id": "1050", + "kind": "model", + "name": "ChatCompletionFunctionCallOption", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctionCallOption", + "usage": "None", + "description": "Specifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function.", + "decorators": [], + "properties": [ + { + "$id": "1051", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "The name of the function to call.", + "type": { + "$id": "1052", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctionCallOption.name" + } + ] + } + ], + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.function_call" + }, + { + "$id": "1053", + "kind": "property", + "name": "functions", + "serializedName": "functions", + "description": "Deprecated in favor of `tools`.\n\nA list of functions the model may generate JSON inputs for.", + "type": { + "$id": "1054", + "kind": "array", + "name": "ArrayChatCompletionFunctions", + "valueType": { + "$id": "1055", + "kind": "model", + "name": "ChatCompletionFunctions", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctions", + "usage": "None", + "deprecation": "This field is marked as deprecated.", + "decorators": [], + "properties": [ + { + "$id": "1056", + "kind": "property", + "name": "description", + "serializedName": "description", + "description": "A description of what the function does, used by the model to choose when and how to call the function.", + "type": { + "$id": "1057", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctions.description" + }, + { + "$id": "1058", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", + "type": { + "$id": "1059", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctions.name" + }, + { + "$id": "1060", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\n\nOmitting `parameters` defines a function with an empty parameter list.", + "type": { + "$id": "1061", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctions.parameters" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.functions" + }, + { + "$id": "1062", + "kind": "property", + "name": "data_sources", + "serializedName": "data_sources", + "description": "The data sources to use for the On Your Data feature, exclusive to Azure OpenAI.", + "type": { + "$id": "1063", + "kind": "array", + "name": "ArrayAzureChatDataSource", + "valueType": { + "$ref": "339" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.data_sources" + }, + { + "$id": "1064", + "kind": "property", + "name": "user_security_context", + "serializedName": "user_security_context", + "type": { + "$id": "1065", + "kind": "model", + "name": "AzureUserSecurityContext", + "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext", + "usage": "None", + "description": "User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud.", + "decorators": [], + "properties": [ + { + "$id": "1066", + "kind": "property", + "name": "application_name", + "serializedName": "application_name", + "description": "The name of the application. Sensitive personal information should not be included in this field.", + "type": { + "$id": "1067", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext.application_name" + }, + { + "$id": "1068", + "kind": "property", + "name": "end_user_id", + "serializedName": "end_user_id", + "description": "This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field.", + "type": { + "$id": "1069", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext.end_user_id" + }, + { + "$id": "1070", + "kind": "property", + "name": "end_user_tenant_id", + "serializedName": "end_user_tenant_id", + "description": "The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multitenant.", + "type": { + "$id": "1071", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext.end_user_tenant_id" + }, + { + "$id": "1072", + "kind": "property", + "name": "source_ip", + "serializedName": "source_ip", + "description": "Captures the original client's IP address.", + "type": { + "$id": "1073", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext.source_ip" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.user_security_context" + } + ] + }, + { + "$ref": "785" + }, + { + "$ref": "789" + }, + { + "$ref": "795" + }, + { + "$ref": "805" + }, + { + "$ref": "815" + }, + { + "$ref": "821" + }, + { + "$ref": "825" + }, + { + "$ref": "829" + }, + { + "$ref": "833" + }, + { + "$ref": "842" + }, + { + "$ref": "849" + }, + { + "$ref": "864" + }, + { + "$ref": "869" + }, + { + "$ref": "875" + }, + { + "$ref": "882" + }, + { + "$ref": "887" + }, + { + "$ref": "898" + }, + { + "$ref": "943" + }, + { + "$ref": "946" + }, + { + "$ref": "956" + }, + { + "$ref": "963" + }, + { + "$ref": "967" + }, + { + "$ref": "971" + }, + { + "$ref": "975" + }, + { + "$ref": "980" + }, + { + "$ref": "986" + }, + { + "$ref": "1005" + }, + { + "$ref": "1016" + }, + { + "$ref": "1020" + }, + { + "$ref": "1032" + }, + { + "$ref": "1036" + }, + { + "$ref": "1050" + }, + { + "$ref": "1055" + }, + { + "$ref": "1065" + }, + { + "$id": "1074", + "kind": "model", + "name": "CreateImageRequest", + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "1075", + "kind": "property", + "name": "prompt", + "serializedName": "prompt", + "description": "A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.", + "type": { + "$id": "1076", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.prompt" + }, + { + "$id": "1077", + "kind": "property", + "name": "model", + "serializedName": "model", + "description": "The model to use for image generation.", + "type": { + "$id": "1078", + "kind": "nullable", + "type": { + "$ref": "192" + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.model" + }, + { + "$id": "1079", + "kind": "property", + "name": "n", + "serializedName": "n", + "description": "The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.", + "type": { + "$id": "1080", + "kind": "nullable", + "type": { + "$id": "1081", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.n" + }, + { + "$id": "1082", + "kind": "property", + "name": "quality", + "serializedName": "quality", + "description": "The quality of the image that will be generated. `hd` creates images with finer details and greater consistency across the image. This param is only supported for `dall-e-3`.", + "type": { + "$ref": "198" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.quality" + }, + { + "$id": "1083", + "kind": "property", + "name": "response_format", + "serializedName": "response_format", + "description": "The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated.", + "type": { + "$id": "1084", + "kind": "nullable", + "type": { + "$ref": "204" + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.response_format" + }, + { + "$id": "1085", + "kind": "property", + "name": "size", + "serializedName": "size", + "description": "The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models.", + "type": { + "$id": "1086", + "kind": "nullable", + "type": { + "$ref": "210" + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.size" + }, + { + "$id": "1087", + "kind": "property", + "name": "style", + "serializedName": "style", + "description": "The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`.", + "type": { + "$id": "1088", + "kind": "nullable", + "type": { + "$ref": "222" + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.style" + }, + { + "$id": "1089", + "kind": "property", + "name": "user", + "serializedName": "user", + "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).", + "type": { + "$id": "1090", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.user" + } + ] + }, + { + "$id": "1091", + "kind": "model", + "name": "CreateMessageRequest", + "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "1092", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the entity that is creating the message. Allowed values include:\n- `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.\n- `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.", + "type": { + "$ref": "228" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.role" + }, + { + "$id": "1093", + "kind": "property", + "name": "content", + "serializedName": "content", + "type": { + "$id": "1094", + "kind": "array", + "name": "ArrayMessageContent", + "valueType": { + "$ref": "272" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.content" + }, + { + "$id": "1095", + "kind": "property", + "name": "attachments", + "serializedName": "attachments", + "description": "A list of files attached to the message, and the tools they should be added to.", + "type": { + "$id": "1096", + "kind": "nullable", + "type": { + "$id": "1097", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1098", + "kind": "model", + "name": "CreateMessageRequestAttachment", + "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.attachment.anonymous", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "1099", + "kind": "property", + "name": "file_id", + "serializedName": "file_id", + "description": "The ID of the file to attach to the message.", + "type": { + "$id": "1100", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.attachment.anonymous.file_id" + }, + { + "$id": "1101", + "kind": "property", + "name": "tools", + "serializedName": "tools", + "description": "The tools to add this file to.", + "type": { + "$id": "1102", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1103", + "kind": "union", + "name": "CreateMessageRequestAttachmentTool", + "variantTypes": [ + { + "$id": "1104", + "kind": "model", + "name": "AssistantToolsCode", + "crossLanguageDefinitionId": "OpenAI.AssistantToolsCode", + "usage": "None", + "discriminatorValue": "code_interpreter", + "decorators": [], + "baseModel": { + "$id": "1105", + "kind": "model", + "name": "AssistantToolDefinition", + "crossLanguageDefinitionId": "OpenAI.AssistantToolDefinition", + "usage": "None", + "decorators": [], + "discriminatorProperty": { + "$id": "1106", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "1107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolDefinition.type" + }, + "properties": [ + { + "$ref": "1106" + } + ], + "discriminatedSubtypes": { + "$id": "1108", + "code_interpreter": { + "$ref": "1104" + }, + "file_search": { + "$id": "1109", + "kind": "model", + "name": "AssistantToolsFileSearch", + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch", + "usage": "None", + "discriminatorValue": "file_search", + "decorators": [], + "baseModel": { + "$ref": "1105" + }, + "properties": [ + { + "$id": "1110", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of tool being defined: `file_search`", + "type": { + "$id": "1111", + "kind": "constant", + "valueType": { + "$id": "1112", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "file_search", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.type" + }, + { + "$id": "1113", + "kind": "property", + "name": "file_search", + "serializedName": "file_search", + "description": "Overrides for the file search tool.", + "type": { + "$id": "1114", + "kind": "model", + "name": "AssistantToolsFileSearchFileSearch", + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.file_search.anonymous", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "1115", + "kind": "property", + "name": "max_num_results", + "serializedName": "max_num_results", + "description": "The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive.\n\nNote that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.", + "type": { + "$id": "1116", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.file_search.anonymous.max_num_results" + }, + { + "$id": "1117", + "kind": "property", + "name": "ranking_options", + "serializedName": "ranking_options", + "type": { + "$id": "1118", + "kind": "model", + "name": "FileSearchRankingOptions", + "crossLanguageDefinitionId": "OpenAI.FileSearchRankingOptions", + "usage": "None", + "description": "The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.\n\nSee the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.", + "decorators": [], + "properties": [ + { + "$id": "1119", + "kind": "property", + "name": "ranker", + "serializedName": "ranker", + "description": "The ranker to use for the file search. If not specified will use the `auto` ranker.", + "type": { + "$ref": "234" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.FileSearchRankingOptions.ranker" + }, + { + "$id": "1120", + "kind": "property", + "name": "score_threshold", + "serializedName": "score_threshold", + "description": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", + "type": { + "$id": "1121", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.FileSearchRankingOptions.score_threshold" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.file_search.anonymous.ranking_options" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.file_search" + } + ] + }, + "function": { + "$id": "1122", + "kind": "model", + "name": "AssistantToolsFunction", + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFunction", + "usage": "None", + "discriminatorValue": "function", + "decorators": [], + "baseModel": { + "$ref": "1105" + }, + "properties": [ + { + "$id": "1123", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of tool being defined: `function`", + "type": { + "$id": "1124", + "kind": "constant", + "valueType": { + "$id": "1125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "function", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFunction.type" + }, + { + "$id": "1126", + "kind": "property", + "name": "function", + "serializedName": "function", + "type": { + "$ref": "1020" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFunction.function" + } + ] + } + } + }, + "properties": [ + { + "$id": "1127", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of tool being defined: `code_interpreter`", + "type": { + "$id": "1128", + "kind": "constant", + "valueType": { + "$id": "1129", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "code_interpreter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolsCode.type" + } + ] + }, + { + "$id": "1130", + "kind": "model", + "name": "AssistantToolsFileSearchTypeOnly", + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearchTypeOnly", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "1131", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of tool being defined: `file_search`", + "type": { + "$id": "1132", + "kind": "constant", + "valueType": { + "$ref": "240" + }, + "value": "file_search", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearchTypeOnly.type" + } + ] + } + ], + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.attachment.anonymous.tools" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.attachments" + }, + { + "$id": "1133", + "kind": "property", + "name": "metadata", + "serializedName": "metadata", + "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.", + "type": { + "$id": "1134", + "kind": "dict", + "keyType": { + "$id": "1135", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1136", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.metadata" + } + ] + }, + { + "$ref": "1098" + }, + { + "$ref": "1104" + }, + { + "$ref": "1105" + }, + { + "$ref": "1109" + }, + { + "$ref": "1114" + }, + { + "$ref": "1118" + }, + { + "$ref": "1122" + }, + { + "$ref": "1130" + }, + { + "$id": "1137", + "kind": "model", + "name": "MessageObject", + "crossLanguageDefinitionId": "OpenAI.MessageObject", + "usage": "None", + "description": "Represents a message within a [thread](/docs/api-reference/threads).", + "decorators": [], + "properties": [ + { + "$id": "1138", + "kind": "property", + "name": "id", + "serializedName": "id", + "description": "The identifier, which can be referenced in API endpoints.", + "type": { + "$id": "1139", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.id" + }, + { + "$id": "1140", + "kind": "property", + "name": "object", + "serializedName": "object", + "description": "The object type, which is always `thread.message`.", + "type": { + "$id": "1141", + "kind": "constant", + "valueType": { + "$ref": "243" + }, + "value": "thread.message", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.object" + }, + { + "$id": "1142", + "kind": "property", + "name": "created_at", + "serializedName": "created_at", + "description": "The Unix timestamp (in seconds) for when the message was created.", + "type": { + "$id": "1143", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "unixTimestamp", + "wireType": { + "$id": "1144", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.created_at" + }, + { + "$id": "1145", + "kind": "property", + "name": "thread_id", + "serializedName": "thread_id", + "description": "The [thread](/docs/api-reference/threads) ID that this message belongs to.", + "type": { + "$id": "1146", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.thread_id" + }, + { + "$id": "1147", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.", + "type": { + "$ref": "246" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.status" + }, + { + "$id": "1148", + "kind": "property", + "name": "incomplete_details", + "serializedName": "incomplete_details", + "description": "On an incomplete message, details about why the message is incomplete.", + "type": { + "$id": "1149", + "kind": "nullable", + "type": { + "$id": "1150", + "kind": "model", + "name": "MessageObjectIncompleteDetails", + "crossLanguageDefinitionId": "OpenAI.MessageObject.incomplete_details.anonymous", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "1151", + "kind": "property", + "name": "reason", + "serializedName": "reason", + "description": "The reason the message is incomplete.", + "type": { + "$ref": "254" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.incomplete_details.anonymous.reason" + } + ] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.incomplete_details" + }, + { + "$id": "1152", + "kind": "property", + "name": "completed_at", + "serializedName": "completed_at", + "description": "The Unix timestamp (in seconds) for when the message was completed.", + "type": { + "$id": "1153", + "kind": "nullable", + "type": { + "$id": "1154", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "unixTimestamp", + "wireType": { + "$id": "1155", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.completed_at" + }, + { + "$id": "1156", + "kind": "property", + "name": "incomplete_at", + "serializedName": "incomplete_at", + "description": "The Unix timestamp (in seconds) for when the message was marked as incomplete.", + "type": { + "$id": "1157", + "kind": "nullable", + "type": { + "$id": "1158", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "unixTimestamp", + "wireType": { + "$id": "1159", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.incomplete_at" + }, + { + "$id": "1160", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The entity that produced the message. One of `user` or `assistant`.", + "type": { + "$ref": "266" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.role" + }, + { + "$id": "1161", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The content of the message in array of text and/or images.", + "type": { + "$id": "1162", + "kind": "array", + "name": "ArrayMessageContent", + "valueType": { + "$ref": "272" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.content" + }, + { + "$id": "1163", + "kind": "property", + "name": "assistant_id", + "serializedName": "assistant_id", + "description": "If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message.", + "type": { + "$id": "1164", + "kind": "nullable", + "type": { + "$id": "1165", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.assistant_id" + }, + { + "$id": "1166", + "kind": "property", + "name": "run_id", + "serializedName": "run_id", + "description": "The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints.", + "type": { + "$id": "1167", + "kind": "nullable", + "type": { + "$id": "1168", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.run_id" + }, + { + "$id": "1169", + "kind": "property", + "name": "attachments", + "serializedName": "attachments", + "description": "A list of files attached to the message, and the tools they were added to.", + "type": { + "$id": "1170", + "kind": "nullable", + "type": { + "$id": "1171", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1172", + "kind": "model", + "name": "MessageObjectAttachment", + "crossLanguageDefinitionId": "OpenAI.MessageObject.attachment.anonymous", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "1173", + "kind": "property", + "name": "file_id", + "serializedName": "file_id", + "description": "The ID of the file to attach to the message.", + "type": { + "$id": "1174", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.attachment.anonymous.file_id" + }, + { + "$id": "1175", + "kind": "property", + "name": "tools", + "serializedName": "tools", + "description": "The tools to add this file to.", + "type": { + "$id": "1176", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1177", + "kind": "union", + "name": "MessageObjectAttachmentTool", + "variantTypes": [ + { + "$ref": "1104" + }, + { + "$ref": "1130" + } + ], + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.attachment.anonymous.tools" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.attachments" + }, + { + "$id": "1178", + "kind": "property", + "name": "metadata", + "serializedName": "metadata", + "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.", + "type": { + "$id": "1179", + "kind": "nullable", + "type": { + "$id": "1180", + "kind": "dict", + "keyType": { + "$id": "1181", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "1182", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.metadata" + } + ] + }, + { + "$ref": "1150" + }, + { + "$ref": "1172" + } + ], + "Clients": [ + { + "$id": "1183", + "Name": "AzureOpenAIClient", + "Operations": [], + "Protocol": { + "$id": "1184" + }, + "Parameters": [ + { + "$id": "1185", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", + "Type": { + "$id": "1186", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "1187", + "Name": "AzureChat", + "Operations": [ + { + "$id": "1188", + "Name": "createChatCompletion", + "ResourceName": "AzureChat", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1189", + "Name": "deployment_id", + "NameInRequest": "deployment_id", + "Type": { + "$id": "1190", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1191", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1192", + "kind": "constant", + "valueType": { + "$id": "1193", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1194", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1195", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1196", + "Name": "request", + "NameInRequest": "request", + "Type": { + "$ref": "782" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1197", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "739" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json", + "application/json", + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/openai", + "Path": "/{deployment_id}/chat/completions", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "AzureOpenAI.AzureChat.createChatCompletion", + "Decorators": [] + } + ], + "Protocol": { + "$id": "1198" + }, + "Parent": "AzureOpenAIClient", + "Parameters": [ + { + "$id": "1199", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", + "Type": { + "$id": "1200", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "1201", + "Name": "AzureImages", + "Operations": [ + { + "$id": "1202", + "Name": "createImage", + "ResourceName": "AzureImages", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1203", + "Name": "deploymentId", + "NameInRequest": "deploymentId", + "Type": { + "$id": "1204", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1205", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1206", + "kind": "constant", + "valueType": { + "$id": "1207", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1208", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1209", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1210", + "Name": "image", + "NameInRequest": "image", + "Type": { + "$ref": "1074" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1211", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "293" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json", + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/openai", + "Path": "/deployments/{deploymentId}/images/generations", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "AzureOpenAI.AzureImages.createImage", + "Decorators": [] + } + ], + "Protocol": { + "$id": "1212" + }, + "Parent": "AzureOpenAIClient", + "Parameters": [ + { + "$id": "1213", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", + "Type": { + "$id": "1214", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "1215", + "Name": "AzureMessages", + "Operations": [ + { + "$id": "1216", + "Name": "createMessage", + "ResourceName": "AzureMessages", + "Summary": "Create a message.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1217", + "Name": "thread_id", + "NameInRequest": "thread_id", + "Description": "The ID of the [thread](/docs/api-reference/threads) to create a message for.", + "Type": { + "$id": "1218", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1219", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1220", + "kind": "constant", + "valueType": { + "$id": "1221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1222", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1223", + "kind": "constant", + "valueType": { + "$id": "1224", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1225", + "Name": "requestBody", + "NameInRequest": "requestBody", + "Type": { + "$ref": "1091" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1226", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1137" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/openai", + "Path": "/threads/{thread_id}/messages", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": false, + "CrossLanguageDefinitionId": "AzureOpenAI.AzureMessages.createMessage", + "Decorators": [] + } + ], + "Protocol": { + "$id": "1227" + }, + "Parent": "AzureOpenAIClient", + "Parameters": [ + { + "$id": "1228", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", + "Type": { + "$id": "1229", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ], + "Auth": { + "$id": "1230", + "ApiKey": { + "$id": "1231", + "Name": "api-key" + }, + "OAuth2": { + "$id": "1232", + "Scopes": [ + "https://cognitiveservices.azure.com/.default" + ] + } + } +} diff --git a/.plugin.azure/.gitignore b/.plugin.azure/.gitignore new file mode 100644 index 000000000..fe620c83f --- /dev/null +++ b/.plugin.azure/.gitignore @@ -0,0 +1,184 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates +.vs/ +*.lock.json +developer/ +launch.json +launchSettings.json + +# Default Assets restore directory +.assets + +# Default TypeSpec output +tsp-output/ + +temp/ + +# Build results +/artifacts +binaries/ +[Dd]ebug*/ +[Rr]elease/ +build/ +restoredPackages/ +PolicheckOutput/ +tools/net46/ +tools/SdkBuildTools/ +tools/Microsoft.WindowsAzure.Build.Tasks/packages/ +PublishedNugets/ +src/NuGet.Config +tools/7-zip/ +#tools/LocalNugetFeed/Microsoft.Internal.NetSdkBuild.Mgmt.Tools.*.nupkg + +[Tt]est[Rr]esult +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.vspscc +*.vssscc +.builds + +*.pidb + +*.log +*.scc +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf + +# Visual Studio profiler +*.psess +*.vsp + +# VS Code +**/.vscode/* +!.vscode/cspell.json + +# Code analysis +*.CodeAnalysisLog.xml + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ + +*.[Rr]e[Ss]harper + +# Rider IDE +.idea + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish + +# Publish Web Output +*.Publish.xml + +# Others +[Bb]in +[Oo]bj +TestResults +[Tt]est[Rr]esult* +*.Cache +ClientBin +~$* +*.dbmdl + +*.[Pp]ublish.xml + +Generated_Code #added for RIA/Silverlight projects + +# Build tasks +tools/*.dll + +# Sensitive files +*.keys +!Azure.Extensions.AspNetCore.DataProtection.Keys +!Azure.Security.KeyVault.Keys +*.pfx +TestConfigurations.xml +*.json.env +*.bicep.env + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML + +# NuGet +packages +packages/repositories.config +testPackages + +# Mac development +.DS_Store + +# Specification DLLs +*.Specification.dll + +# Generated readme.txt files # +src/*/readme.txt + +build.out +.nuget/ + +# Azure Project +csx/ +*.GhostDoc.xml +pingme.txt + +# TS/Node files +dist/ +node_modules/ + +# MSBuild binary log files +msbuild.binlog + +# BenchmarkDotNet +BenchmarkDotNet.Artifacts + +artifacts +.assets + +# Temporary typespec folders for typespec generation +TempTypeSpecFiles/ diff --git a/.plugin.azure/emitter/src/emitter.ts b/.plugin.azure/emitter/src/emitter.ts new file mode 100644 index 000000000..fcbe21063 --- /dev/null +++ b/.plugin.azure/emitter/src/emitter.ts @@ -0,0 +1,12 @@ +import { EmitContext } from "@typespec/compiler"; + +import { + $onEmit as $OnMGCEmit, + NetEmitterOptions +} from "@typespec/http-client-csharp"; + +export async function $onEmit(context: EmitContext) { + context.options["plugin-name"] = "AzureOpenAILibraryPlugin"; + context.options["emitter-extension-path"] = import.meta.url; + await $OnMGCEmit(context); +} \ No newline at end of file diff --git a/.plugin.azure/emitter/src/index.ts b/.plugin.azure/emitter/src/index.ts new file mode 100644 index 000000000..8b2630d57 --- /dev/null +++ b/.plugin.azure/emitter/src/index.ts @@ -0,0 +1 @@ +export * from "./emitter.js"; \ No newline at end of file diff --git a/.plugin.azure/generator/AzureOpenAI.Library.Plugin.sln b/.plugin.azure/generator/AzureOpenAI.Library.Plugin.sln new file mode 100644 index 000000000..8ec10ceb0 --- /dev/null +++ b/.plugin.azure/generator/AzureOpenAI.Library.Plugin.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35327.3 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AzureOpenAI.Library.Plugin", "src\AzureOpenAI.Library.Plugin.csproj", "{E46178E4-F3F0-4E2F-8D42-A7F021B23E63}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E46178E4-F3F0-4E2F-8D42-A7F021B23E63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E46178E4-F3F0-4E2F-8D42-A7F021B23E63}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E46178E4-F3F0-4E2F-8D42-A7F021B23E63}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E46178E4-F3F0-4E2F-8D42-A7F021B23E63}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/.plugin.azure/generator/src/AzureOpenAI.Library.Plugin.csproj b/.plugin.azure/generator/src/AzureOpenAI.Library.Plugin.csproj new file mode 100644 index 000000000..230f57888 --- /dev/null +++ b/.plugin.azure/generator/src/AzureOpenAI.Library.Plugin.csproj @@ -0,0 +1,23 @@ + + + + net8.0 + enable + OpenAI.Microsoft.Generator.CSharp.ClientModel.Plugin + true + + + + + + + + + + + + + + + + diff --git a/.plugin.azure/generator/src/AzureOpenAILibraryPlugin.cs b/.plugin.azure/generator/src/AzureOpenAILibraryPlugin.cs new file mode 100644 index 000000000..16b818c44 --- /dev/null +++ b/.plugin.azure/generator/src/AzureOpenAILibraryPlugin.cs @@ -0,0 +1,21 @@ +using System.ComponentModel.Composition; +using Microsoft.Generator.CSharp; +using Microsoft.Generator.CSharp.ClientModel; + +namespace AzureOpenAILibraryPlugin +{ + [Export(typeof(CodeModelPlugin))] + [ExportMetadata("PluginName", nameof(AzureOpenAILibraryPlugin))] + public class AzureOpenAILibraryPlugin : ClientModelPlugin + { + [ImportingConstructor] + public AzureOpenAILibraryPlugin(GeneratorContext context) : base(context) { } + + public override void Configure() + { + base.Configure(); + AddVisitor(new AzureOpenAILibraryVisitor()); + AddVisitor(new DocEditVisitor()); + } + } +} \ No newline at end of file diff --git a/.plugin.azure/generator/src/AzureOpenAILibraryVisitor.cs b/.plugin.azure/generator/src/AzureOpenAILibraryVisitor.cs new file mode 100644 index 000000000..32d6c42bc --- /dev/null +++ b/.plugin.azure/generator/src/AzureOpenAILibraryVisitor.cs @@ -0,0 +1,187 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using Microsoft.Generator.CSharp.ClientModel; +using Microsoft.Generator.CSharp.ClientModel.Providers; +using Microsoft.Generator.CSharp.Primitives; +using Microsoft.Generator.CSharp.Providers; +using Microsoft.Generator.CSharp.Snippets; +using Microsoft.Generator.CSharp.Statements; +using static Microsoft.Generator.CSharp.Snippets.Snippet; + +namespace AzureOpenAILibraryPlugin +{ + public class AzureOpenAILibraryVisitor : ScmLibraryVisitor + { + private const string RawDataPropertyName = "SerializedAdditionalRawData"; + private const string AdditionalPropertiesFieldName = "_additionalBinaryDataProperties"; + private const string SentinelValueFieldName = "_sentinelValue"; + private const string WritePropertyNameMethodCall = "WritePropertyName(\""; + private const string ModelSerializationExtensionsTypeName = "ModelSerializationExtensions"; + private const string IsSentinelValueMethodName = "IsSentinelValue"; + private const string JsonModelWriteCoreMethodName = "JsonModelWriteCore"; + + protected override TypeProvider Visit(TypeProvider type) + { + if (type is ModelProvider { BaseModelProvider: null }) + { + // Add an internal AdditionalProperties property to all base models + var additionalPropertiesField = type.Fields.Single(f => f.Name == AdditionalPropertiesFieldName); + var properties = new List(type.Properties) + { + new PropertyProvider($"", MethodSignatureModifiers.Internal, + typeof(IDictionary), RawDataPropertyName, + new ExpressionPropertyBody( + additionalPropertiesField, + type.DeclarationModifiers.HasFlag(TypeSignatureModifiers.ReadOnly) ? null : additionalPropertiesField.Assign(Value)), + type) + }; + + type.Update(properties: properties); + } + else if (type.Name == ModelSerializationExtensionsTypeName) + { + // Add a static BinaryData field representing the sentinel value + var sentinelValueField = new FieldProvider( + FieldModifiers.Private | FieldModifiers.Static | FieldModifiers.ReadOnly, + typeof(BinaryData), + SentinelValueFieldName, + type, + $"", + BinaryDataSnippets.FromBytes(LiteralU8("\"__EMPTY__\"").Invoke("ToArray"))); + var fields = new List(type.Fields) + { + sentinelValueField + }; + + // Add the IsSentinelValue method + var valueParameter = new ParameterProvider("value", $"", typeof(BinaryData)); + var methods = new List(type.Methods) + { + new MethodProvider( + new MethodSignature( + IsSentinelValueMethodName, + $"", + MethodSignatureModifiers.Internal | MethodSignatureModifiers.Static, + typeof(bool), + $"", + [valueParameter]), + new[] + { + Declare("sentinelSpan", typeof(ReadOnlySpan), sentinelValueField.As().ToMemory().Property("Span"), out var sentinelVariable), + Declare("valueSpan", typeof(ReadOnlySpan), valueParameter.As().ToMemory().Property("Span"), out var valueVariable), + Return(sentinelVariable.Invoke("SequenceEqual", valueVariable)) + }, + type) + }; + + type.Update(fields: fields, methods: methods); + } + return type; + } + + protected override FieldProvider Visit(FieldProvider field) + { + // Make the backing additional properties field not be read only as long as the type is not readonly. + if (field.Name == AdditionalPropertiesFieldName && !field.EnclosingType.DeclarationModifiers.HasFlag(TypeSignatureModifiers.ReadOnly)) + { + field.Modifiers &= ~FieldModifiers.ReadOnly; + } + return field; + } + + protected override MethodProvider Visit(MethodProvider method) + { + if (method.Signature.Name != JsonModelWriteCoreMethodName) + { + return method; + } + + // If there are no body statements, return the method as is + if (method.BodyStatements == null) + { + return method; + } + + // If the body statements are not MethodBodyStatements, return the method as is + if (method.BodyStatements is not MethodBodyStatements statements) + { + return method; + } + + var updatedStatements = new List(); + var flattenedStatements = statements.Flatten().ToArray(); + + for (int line = 0; line < flattenedStatements.Length; line++) + { + var statement = flattenedStatements[line]; + + if (statement is IfStatement ifStatement) + { + var body = ifStatement.Body.ToDisplayString(); + + // If we already have an if statement that contains property writing, we need to add the condition to the existing if statement + if (body.Contains(WritePropertyNameMethodCall)) + { + ifStatement.Condition = ifStatement.Condition.As().And(GetContainsKeyCondition(body)); + } + + // Handle writing AdditionalProperties + else if (ifStatement.Body.Flatten().First() is ForeachStatement foreachStatement) + { + foreachStatement.Body.Insert( + 0, + new IfStatement( + Static(new ModelSerializationExtensionsDefinition().Type).Invoke( + IsSentinelValueMethodName, + foreachStatement.ItemVariable.Property("Value"))) + { + Continue + }); + } + + updatedStatements.Add(ifStatement); + continue; + } + + var displayString = statement.ToDisplayString(); + if (displayString.Contains(WritePropertyNameMethodCall)) + { + var ifSt = new IfStatement(GetContainsKeyCondition(displayString)) { statement }; + + // If this is a plain expression statement, we need to add the next statement as well which + // will either write the property value or start writing an array + if (statement is ExpressionStatement) + { + ifSt.Add(flattenedStatements[++line]); + // Include array writing in the if statement + if (flattenedStatements[line + 1] is ForeachStatement) + { + // Foreach + ifSt.Add(flattenedStatements[++line]); + // End array + ifSt.Add(flattenedStatements[++line]); + } + } + updatedStatements.Add(ifSt); + } + else + { + updatedStatements.Add(statement); + } + } + + method.Update(bodyStatements: updatedStatements); + return method; + } + + private static ScopedApi GetContainsKeyCondition(string displayString) + { + var propertyName = displayString.Split('"')[1]; + return This.Property(AdditionalPropertiesFieldName) + .NullConditional() + .Invoke("ContainsKey", Literal(propertyName)).NotEqual(True); + } + } +} diff --git a/.plugin.azure/generator/src/DocEditVisitor.cs b/.plugin.azure/generator/src/DocEditVisitor.cs new file mode 100644 index 000000000..94ca5ed60 --- /dev/null +++ b/.plugin.azure/generator/src/DocEditVisitor.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using Microsoft.Generator.CSharp.ClientModel; +using Microsoft.Generator.CSharp.ClientModel.Providers; +using Microsoft.Generator.CSharp.Primitives; +using Microsoft.Generator.CSharp.Providers; +using Microsoft.Generator.CSharp.Snippets; +using Microsoft.Generator.CSharp.Statements; +using static Microsoft.Generator.CSharp.Snippets.Snippet; + +namespace AzureOpenAILibraryPlugin +{ + public class DocEditVisitor : ScmLibraryVisitor + { + protected override PropertyProvider? Visit(PropertyProvider property) + { + if (TryUpdateXmlDocs(property.XmlDocs)) + { + property.Update(xmlDocs: property.XmlDocs); + } + return base.Visit(property); + } + + protected override TypeProvider Visit(TypeProvider type) + { + if (TryUpdateXmlDocs(type.XmlDocs)) + { + type.Update(xmlDocs: type.XmlDocs); + } + return type; + } + + protected override MethodProvider? Visit(MethodProvider method) + { + if (TryUpdateXmlDocs(method.XmlDocs)) + { + method.Update(xmlDocProvider: method.XmlDocs); + } + return base.Visit(method); + } + + private static bool TryUpdateXmlDocs(XmlDocProvider? xmlDocs) + { + if (xmlDocs?.Summary?.Lines is IReadOnlyList existingSummaryLines + && existingSummaryLines.Count > 0) + { + List reprocessedSummaryLines = []; + foreach (var line in existingSummaryLines) + { + string[] linesInTheLine = line.ToString().Split('\n'); + reprocessedSummaryLines.AddRange(linesInTheLine.Select(lineInTheLine => (FormattableString)$"{lineInTheLine}")); + } + if (reprocessedSummaryLines.Count > existingSummaryLines.Count) + { + xmlDocs.Summary = new XmlDocSummaryStatement(reprocessedSummaryLines, [.. xmlDocs.Summary.InnerStatements]); + return true; + } + } + return false; + } + } +} diff --git a/.plugin.azure/generator/src/Properties/launchSettings.json b/.plugin.azure/generator/src/Properties/launchSettings.json new file mode 100644 index 000000000..c6d6231e1 --- /dev/null +++ b/.plugin.azure/generator/src/Properties/launchSettings.json @@ -0,0 +1,9 @@ +{ + "profiles": { + "AzureOpenAIPlugin": { + "commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.dll $(SolutionDir)/../../.dotnet.azure/sdk/openai/Azure.AI.OpenAI -p AzureOpenAILibraryPlugin", + "commandName": "Executable", + "executablePath": "dotnet" + } + } +} \ No newline at end of file diff --git a/.plugin.azure/nuget.config b/.plugin.azure/nuget.config new file mode 100644 index 000000000..b6b1e7faf --- /dev/null +++ b/.plugin.azure/nuget.config @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.plugin.azure/package.json b/.plugin.azure/package.json new file mode 100644 index 000000000..5be417a2c --- /dev/null +++ b/.plugin.azure/package.json @@ -0,0 +1,45 @@ +{ + "name": "@azure-openai/plugin", + "version": "1.0.0", + "description": "Azure OpenAI plugin", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/joseharriaga/openai-in-typespec.git" + }, + "bugs": { + "url": "https://github.com/joseharriaga/openai-in-typespec/issues" + }, + "type": "module", + "main": "dist/emitter/index.js", + "exports": { + ".": "./dist/emitter/index.js" + }, + "scripts": { + "clean": "rimraf ./dist ./emitter/temp && dotnet clean ./generator", + "build:emitter": "tsc -p ./tsconfig.build.json", + "build:generator": "dotnet build ./generator", + "build": "npm run build:emitter && npm run build:generator && copyfiles -E -f ../node_modules/@typespec/http-client-csharp/dist/generator/Microsoft.Generator.CSharp.runtimeconfig.json ./dist/generator", + "test:emitter": "vitest run -c ./emitter/vitest.config.ts", + "test:generator": "dotnet test ./generator", + "test": "npm run test:emitter && npm run test:generator" + }, + "files": [ + "dist/**" + ], + "dependencies": { + "@azure-tools/cadl-ranch-expect": "latest", + "@open-ai/plugin": "file:", + "@typespec/http-client-csharp": "latest" + }, + "devDependencies": { + "@types/node": "^22.8.1", + "@vitest/coverage-v8": "^1.4.0", + "@vitest/ui": "^1.4.0", + "c8": "^9.1.0", + "copyfiles": "^2.4.1", + "rimraf": "~5.0.5", + "typescript": "^5.6.3", + "vitest": "^1.4.0" + } +} diff --git a/.plugin.azure/tsconfig.build.json b/.plugin.azure/tsconfig.build.json new file mode 100644 index 000000000..20573897d --- /dev/null +++ b/.plugin.azure/tsconfig.build.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "rootDir": "./emitter/src", + "outDir": "./dist/emitter", + "tsBuildInfoFile": "./emitter/temp/tsconfig.tsbuildinfo" + }, + "references": [], + "include": ["emitter/src"] + } \ No newline at end of file diff --git a/.plugin.azure/tsconfig.json b/.plugin.azure/tsconfig.json new file mode 100644 index 000000000..10e7b7230 --- /dev/null +++ b/.plugin.azure/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "noEmit": true, + "composite": true, + "alwaysStrict": true, + "forceConsistentCasingInFileNames": true, + "module": "Node16", + "moduleResolution": "Node16", + "esModuleInterop": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "sourceMap": true, + "declarationMap": true, + "strict": true, + "declaration": true, + "stripInternal": true, + "noEmitHelpers": false, + "target": "ES2022", + "types": ["node"], + "lib": ["es2022", "DOM"], + "experimentalDecorators": true, + "newLine": "LF" + }, + "include": ["src/**/*.ts", "test/**/*.ts", "vitest.config.ts", "**/*.ts", "**/*.tsx", "**/.storybook/**/*.ts", "**/.storybook/**/*.tsx"], + "exclude": ["**/node_modules/", "**/dist/", "**/build/", "**/coverage/"] +} \ No newline at end of file diff --git a/.plugin.azure/tspconfig.yaml b/.plugin.azure/tspconfig.yaml new file mode 100644 index 000000000..6e4a491f2 --- /dev/null +++ b/.plugin.azure/tspconfig.yaml @@ -0,0 +1,4 @@ +"emit": + - "@azure-openai/plugin" +"options": + "@azure-openai/plugin": \ No newline at end of file diff --git a/.scripts.azure/Invoke-CodeGen.ps1 b/.scripts.azure/Invoke-CodeGen.ps1 index c0f426418..1d0ace522 100644 --- a/.scripts.azure/Invoke-CodeGen.ps1 +++ b/.scripts.azure/Invoke-CodeGen.ps1 @@ -77,9 +77,11 @@ function Prune-Generated-Files { Push-Location $repoRoot try { Invoke { npm ci } + Invoke { npm run build -w .plugin.azure } Set-Location $repoRoot/.typespec.azure Invoke { npm exec --no -- tsp format **/*tsp } Invoke { npm exec --no -- tsp compile . } + Invoke { Move-Item $generatedFolder/Models/* $generatedFolder } Prune-Generated-Files Make-Internals-Settable Partialize-ClientPipelineExtensions diff --git a/.typespec.azure/tspconfig.yaml b/.typespec.azure/tspconfig.yaml index 9adc4a453..7c1d801be 100644 --- a/.typespec.azure/tspconfig.yaml +++ b/.typespec.azure/tspconfig.yaml @@ -1,13 +1,13 @@ emit: - "@typespec/openapi3" - - "@azure-tools/typespec-csharp" + - "@azure-openai/plugin" options: "@typespec/openapi3": output-file: "{project-root}/../.openapi3.azure/openapi3-azure-openai-{version}-generated.yaml" omit-unreachable-types: true - "@azure-tools/typespec-csharp": + "@azure-openai/plugin": namespace: "Azure.AI.OpenAI" - emitter-output-dir: "{project-root}/../.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src" + emitter-output-dir: "{project-root}/../.dotnet.azure/sdk/openai/Azure.AI.OpenAI" generate-convenience-methods: false unreferenced-types-handling: keepAll model-namespace: false @@ -16,3 +16,6 @@ options: new-project: false flavor: "unbranded" enable-internal-raw-data: true + # disable-xml-docs: true + save-inputs: true + generate-model-factory: false diff --git a/package-lock.json b/package-lock.json index d9e349249..2eaf9990f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,10 +8,12 @@ "name": "openai-tsp", "version": "0.1.0", "workspaces": [ - ".plugin" + ".plugin", + ".plugin.azure" ], "dependencies": { "@autorest/csharp": "3.0.0-beta.20240904.1", + "@azure-openai/plugin": "file:.plugin.azure", "@azure-tools/typespec-csharp": "0.2.0-beta.20241201.1", "@open-ai/plugin": "file:.plugin", "@typespec/openapi3": "^0.62.0", @@ -38,6 +40,30 @@ "vitest": "^1.4.0" } }, + ".plugin.azure": { + "name": "@azure-openai/plugin", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@azure-tools/cadl-ranch-expect": "latest", + "@open-ai/plugin": "file:", + "@typespec/http-client-csharp": "latest" + }, + "devDependencies": { + "@types/node": "^22.8.1", + "@vitest/coverage-v8": "^1.4.0", + "@vitest/ui": "^1.4.0", + "c8": "^9.1.0", + "copyfiles": "^2.4.1", + "rimraf": "~5.0.5", + "typescript": "^5.6.3", + "vitest": "^1.4.0" + } + }, + ".plugin.azure/node_modules/@open-ai/plugin": { + "resolved": ".plugin.azure", + "link": true + }, "node_modules/@ampproject/remapping": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", @@ -61,6 +87,10 @@ "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20240904.1.tgz", "integrity": "sha512-fS5W+dQS0hMR/ubLN7L5VL834LzAJh26LkJSb4BLy2cWargem9T8xZf5GEwTKfVWosX7JC1sd/k5nX2z2Do+fg==" }, + "node_modules/@azure-openai/plugin": { + "resolved": ".plugin.azure", + "link": true + }, "node_modules/@azure-tools/cadl-ranch-expect": { "version": "0.15.6", "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch-expect/-/cadl-ranch-expect-0.15.6.tgz", diff --git a/package.json b/package.json index fa1cead1b..b4de14d84 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,8 @@ { "name": "openai-tsp", "workspaces": [ - ".plugin" + ".plugin", + ".plugin.azure" ], "version": "0.1.0", "type": "module", @@ -9,6 +10,7 @@ "@autorest/csharp": "3.0.0-beta.20240904.1", "@azure-tools/typespec-csharp": "0.2.0-beta.20241201.1", "@open-ai/plugin": "file:.plugin", + "@azure-openai/plugin": "file:.plugin.azure", "@typespec/openapi3": "^0.62.0", "openai-tsp": "file:" }, From 338c0dc192a5c4e678ee08cd642977b3a0b5ed8d Mon Sep 17 00:00:00 2001 From: Travis Wilson Date: Thu, 13 Feb 2025 17:23:50 -0800 Subject: [PATCH 2/8] address serialization delta --- .../src/Custom/Common/AdditionalPropertyHelpers.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/AdditionalPropertyHelpers.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/AdditionalPropertyHelpers.cs index 2658db88a..b724d26f2 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/AdditionalPropertyHelpers.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/AdditionalPropertyHelpers.cs @@ -20,7 +20,7 @@ private static T GetAdditionalProperty(IDictionary additi } using JsonDocument document = JsonDocument.Parse(additionalPropertyValue); - return deserializeFunction(document.RootElement, null); + return deserializeFunction(document.RootElement, ModelSerializationExtensions.WireOptions); } private static IList GetAdditionalPropertyAsList(IDictionary additionalProperties, string additionalPropertyKey, Func deserializeFunction) where T : class, IJsonModel @@ -35,7 +35,7 @@ private static IList GetAdditionalPropertyAsList(IDictionary Date: Thu, 13 Feb 2025 17:30:31 -0800 Subject: [PATCH 3/8] a few consistency issues --- .../InternalElasticsearchChatDataSourceParameters.cs | 6 +++--- .../src/Custom/Internal/AzureOpenAIChatError.cs | 2 +- .../src/Custom/Internal/AzureOpenAIDalleError.cs | 2 +- ...alElasticsearchChatDataSourceParameters.Serialization.cs | 4 ++-- .../InternalElasticsearchChatDataSourceParameters.cs | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/Internal/InternalElasticsearchChatDataSourceParameters.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/Internal/InternalElasticsearchChatDataSourceParameters.cs index 75f7b137d..83490d49d 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/Internal/InternalElasticsearchChatDataSourceParameters.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/Internal/InternalElasticsearchChatDataSourceParameters.cs @@ -11,17 +11,17 @@ namespace Azure.AI.OpenAI.Chat; internal partial class InternalElasticsearchChatDataSourceParameters { [CodeGenMember("IncludeContexts")] - private IList _internalIncludeContexts { get; set; } = new ChangeTrackingList(); + private IList InternalIncludeContexts { get; set; } = new ChangeTrackingList(); private DataSourceOutputContexts? _outputContexts; /// public DataSourceOutputContexts? OutputContexts { - get => DataSourceOutputContextsExtensions.FromStringList(_internalIncludeContexts); + get => DataSourceOutputContextsExtensions.FromStringList(InternalIncludeContexts); internal set { _outputContexts = value; - _internalIncludeContexts = _outputContexts?.ToStringList(); + InternalIncludeContexts = _outputContexts?.ToStringList(); } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureOpenAIChatError.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureOpenAIChatError.cs index 2f61a1094..7bb381e75 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureOpenAIChatError.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureOpenAIChatError.cs @@ -18,7 +18,7 @@ internal static AzureOpenAIChatError TryCreateFromResponse(PipelineResponse resp { using JsonDocument errorDocument = JsonDocument.Parse(response.Content); AzureOpenAIChatErrorResponse errorResponse - = AzureOpenAIChatErrorResponse.DeserializeAzureOpenAIChatErrorResponse(errorDocument.RootElement, null); + = AzureOpenAIChatErrorResponse.DeserializeAzureOpenAIChatErrorResponse(errorDocument.RootElement, ModelSerializationExtensions.WireOptions); return errorResponse.Error; } catch (InvalidOperationException) diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureOpenAIDalleError.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureOpenAIDalleError.cs index 10bc8401f..bc0988c81 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureOpenAIDalleError.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureOpenAIDalleError.cs @@ -18,7 +18,7 @@ internal static AzureOpenAIDalleError TryCreateFromResponse(PipelineResponse res { using JsonDocument errorDocument = JsonDocument.Parse(response.Content); AzureOpenAIDalleErrorResponse errorResponse - = AzureOpenAIDalleErrorResponse.DeserializeAzureOpenAIDalleErrorResponse(errorDocument.RootElement, null); + = AzureOpenAIDalleErrorResponse.DeserializeAzureOpenAIDalleErrorResponse(errorDocument.RootElement, ModelSerializationExtensions.WireOptions); return errorResponse.Error; } catch (InvalidOperationException) diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs index 20677c407..bc34bb1dd 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs @@ -66,11 +66,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("index_name"u8); writer.WriteStringValue(IndexName); } - if (Optional.IsCollectionDefined(_internalIncludeContexts) && _additionalBinaryDataProperties?.ContainsKey("include_contexts") != true) + if (Optional.IsCollectionDefined(InternalIncludeContexts) && _additionalBinaryDataProperties?.ContainsKey("include_contexts") != true) { writer.WritePropertyName("include_contexts"u8); writer.WriteStartArray(); - foreach (string item in _internalIncludeContexts) + foreach (string item in InternalIncludeContexts) { if (item == null) { diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs index b83f75a54..56853fac0 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs @@ -21,7 +21,7 @@ public InternalElasticsearchChatDataSourceParameters(Uri endpoint, string indexN Endpoint = endpoint; IndexName = indexName; - _internalIncludeContexts = new ChangeTrackingList(); + InternalIncludeContexts = new ChangeTrackingList(); Authentication = authentication; } @@ -34,7 +34,7 @@ internal InternalElasticsearchChatDataSourceParameters(int? topNDocuments, bool? AllowPartialResult = allowPartialResult; Endpoint = endpoint; IndexName = indexName; - _internalIncludeContexts = internalIncludeContexts; + InternalIncludeContexts = internalIncludeContexts; Authentication = authentication; FieldMappings = fieldMappings; QueryType = queryType; From 2efa3ba6798c25ee81d86fbb6168042d8190ee4a Mon Sep 17 00:00:00 2001 From: Travis Wilson Date: Thu, 13 Feb 2025 18:34:01 -0800 Subject: [PATCH 4/8] cleanup -- it's pretty nice now! --- .../openai/Azure.AI.OpenAI/Configuration.json | 10 - .../AzureOpenAIChatError.Serialization.cs | 0 .../{ => Models}/AzureOpenAIChatError.cs | 0 ...reOpenAIChatErrorResponse.Serialization.cs | 0 .../AzureOpenAIChatErrorResponse.cs | 0 .../AzureOpenAIDalleError.Serialization.cs | 0 .../{ => Models}/AzureOpenAIDalleError.cs | 0 ...eOpenAIDalleErrorResponse.Serialization.cs | 0 .../AzureOpenAIDalleErrorResponse.cs | 0 ...AzureSearchChatDataSource.Serialization.cs | 0 .../{ => Models}/AzureSearchChatDataSource.cs | 0 .../ChatCitation.Serialization.cs | 0 .../Generated/{ => Models}/ChatCitation.cs | 0 .../ChatDataSource.Serialization.cs | 0 .../Generated/{ => Models}/ChatDataSource.cs | 0 .../{ => Models}/ChatDocumentFilterReason.cs | 0 .../ChatMessageContext.Serialization.cs | 0 .../{ => Models}/ChatMessageContext.cs | 0 .../ChatRetrievedDocument.Serialization.cs | 0 .../{ => Models}/ChatRetrievedDocument.cs | 0 ...tentFilterBlocklistResult.Serialization.cs | 0 .../ContentFilterBlocklistResult.cs | 0 ...tentFilterDetectionResult.Serialization.cs | 0 .../ContentFilterDetectionResult.cs | 0 ...tedMaterialCitationResult.Serialization.cs | 0 ...ntFilterProtectedMaterialCitationResult.cs | 0 ...erProtectedMaterialResult.Serialization.cs | 0 .../ContentFilterProtectedMaterialResult.cs | 0 .../{ => Models}/ContentFilterSeverity.cs | 0 ...ntentFilterSeverityResult.Serialization.cs | 0 .../ContentFilterSeverityResult.cs | 0 .../ContentFilterTextSpan.Serialization.cs | 0 .../{ => Models}/ContentFilterTextSpan.cs | 0 ...ntentFilterTextSpanResult.Serialization.cs | 0 .../ContentFilterTextSpanResult.cs | 0 .../CosmosChatDataSource.Serialization.cs | 0 .../{ => Models}/CosmosChatDataSource.cs | 0 .../DataSourceAuthentication.Serialization.cs | 0 .../{ => Models}/DataSourceAuthentication.cs | 0 .../DataSourceFieldMappings.Serialization.cs | 0 .../{ => Models}/DataSourceFieldMappings.cs | 0 .../{ => Models}/DataSourceQueryType.cs | 0 .../DataSourceVectorizer.Serialization.cs | 0 .../{ => Models}/DataSourceVectorizer.cs | 0 ...asticsearchChatDataSource.Serialization.cs | 0 .../ElasticsearchChatDataSource.cs | 0 ...SourceParametersQueryType.Serialization.cs | 31 + ...searchChatDataSourceParametersQueryType.cs | 15 + ...okenAuthenticationOptions.Serialization.cs | 0 ...aSourceAccessTokenAuthenticationOptions.cs | 2 +- ...iKeyAuthenticationOptions.Serialization.cs | 0 ...atDataSourceApiKeyAuthenticationOptions.cs | 2 +- ...ringAuthenticationOptions.Serialization.cs | 0 ...ceConnectionStringAuthenticationOptions.cs | 2 +- ...ntNameVectorizationSource.Serialization.cs | 0 ...SourceDeploymentNameVectorizationSource.cs | 2 +- ...iKeyAuthenticationOptions.Serialization.cs | 0 ...ourceEncodedApiKeyAuthenticationOptions.cs | 2 +- ...dpointVectorizationSource.Serialization.cs | 0 ...atDataSourceEndpointVectorizationSource.cs | 2 +- ...gratedVectorizationSource.Serialization.cs | 0 ...DataSourceIntegratedVectorizationSource.cs | 0 ...eyIdAuthenticationOptions.Serialization.cs | 0 ...aSourceKeyAndKeyIdAuthenticationOptions.cs | 4 +- ...odelIdVectorizationSource.Serialization.cs | 0 ...hatDataSourceModelIdVectorizationSource.cs | 2 +- ...tityAuthenticationOptions.Serialization.cs | 0 ...nedManagedIdentityAuthenticationOptions.cs | 0 ...tityAuthenticationOptions.Serialization.cs | 0 ...nedManagedIdentityAuthenticationOptions.cs | 2 +- ...wordAuthenticationOptions.Serialization.cs | 0 ...sernameAndPasswordAuthenticationOptions.cs | 4 +- ...ntFilterBlocklistIdResult.Serialization.cs | 0 ...rnalAzureContentFilterBlocklistIdResult.cs | 4 +- ...lterBlocklistResultDetail.Serialization.cs | 0 ...AzureContentFilterBlocklistResultDetail.cs | 4 +- ...ilterResultForChoiceError.Serialization.cs | 0 ...lAzureContentFilterResultForChoiceError.cs | 4 +- ...romptContentFilterResults.Serialization.cs | 0 ...lterResultForPromptContentFilterResults.cs | 18 +- ...BChatDataSourceParameters.Serialization.cs | 0 ...alAzureCosmosDBChatDataSourceParameters.cs | 6 +- ...OpenAIChatErrorInnerError.Serialization.cs | 0 .../InternalAzureOpenAIChatErrorInnerError.cs | 6 +- ...ernalAzureOpenAIChatErrorInnerErrorCode.cs | 2 +- ...penAIDalleErrorInnerError.Serialization.cs | 0 ...InternalAzureOpenAIDalleErrorInnerError.cs | 6 +- ...rnalAzureOpenAIDalleErrorInnerErrorCode.cs | 2 +- ...hChatDataSourceParameters.Serialization.cs | 0 ...rnalAzureSearchChatDataSourceParameters.cs | 4 +- ...hChatDataSourceParametersIncludeContext.cs | 6 +- ...hChatDataSourceParameters.Serialization.cs | 0 ...alElasticsearchChatDataSourceParameters.cs | 4 +- ...BChatDataSourceParameters.Serialization.cs | 0 ...InternalMongoDBChatDataSourceParameters.cs | 10 +- ...eChatDataSourceParameters.Serialization.cs | 0 ...nternalPineconeChatDataSourceParameters.cs | 4 +- ...nknownAzureChatDataSource.Serialization.cs | 0 .../InternalUnknownAzureChatDataSource.cs | 0 ...urceAuthenticationOptions.Serialization.cs | 0 ...zureChatDataSourceAuthenticationOptions.cs | 0 ...SourceVectorizationSource.Serialization.cs | 0 ...nAzureChatDataSourceVectorizationSource.cs | 0 .../MongoDBChatDataSource.Serialization.cs | 0 .../{ => Models}/MongoDBChatDataSource.cs | 0 .../PineconeChatDataSource.Serialization.cs | 0 .../{ => Models}/PineconeChatDataSource.cs | 0 ...equestContentFilterResult.Serialization.cs | 0 .../RequestContentFilterResult.cs | 0 ...tImageContentFilterResult.Serialization.cs | 0 .../RequestImageContentFilterResult.cs | 0 ...sponseContentFilterResult.Serialization.cs | 0 .../ResponseContentFilterResult.cs | 0 ...eImageContentFilterResult.Serialization.cs | 0 .../ResponseImageContentFilterResult.cs | 0 .../UserSecurityContext.Serialization.cs | 0 .../{ => Models}/UserSecurityContext.cs | 0 .../openai/Azure.AI.OpenAI/tspCodeModel.json | 12494 ---------------- .../generator/src/AzureOpenAILibraryPlugin.cs | 7 +- .../AdditionalPropertiesVisitor.cs} | 58 +- .../src/{ => Visitors}/DocEditVisitor.cs | 0 .../InternalSettablePropertiesVisitor.cs | 39 + .../ModelSerializationEmptySentinelVisitor.cs | 64 + .../src/Visitors/TypeRemovalVisitor.cs | 60 + .../src/Visitors/WriteableSardVisitor.cs | 29 + .scripts.azure/Invoke-CodeGen.ps1 | 78 +- .typespec.azure/tspconfig.yaml | 11 +- 127 files changed, 304 insertions(+), 12696 deletions(-) delete mode 100644 .dotnet.azure/sdk/openai/Azure.AI.OpenAI/Configuration.json rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/AzureOpenAIChatError.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/AzureOpenAIChatError.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/AzureOpenAIChatErrorResponse.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/AzureOpenAIChatErrorResponse.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/AzureOpenAIDalleError.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/AzureOpenAIDalleError.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/AzureOpenAIDalleErrorResponse.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/AzureOpenAIDalleErrorResponse.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/AzureSearchChatDataSource.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/AzureSearchChatDataSource.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ChatCitation.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ChatCitation.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ChatDataSource.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ChatDataSource.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ChatDocumentFilterReason.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ChatMessageContext.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ChatMessageContext.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ChatRetrievedDocument.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ChatRetrievedDocument.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ContentFilterBlocklistResult.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ContentFilterBlocklistResult.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ContentFilterDetectionResult.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ContentFilterDetectionResult.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ContentFilterProtectedMaterialCitationResult.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ContentFilterProtectedMaterialCitationResult.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ContentFilterProtectedMaterialResult.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ContentFilterProtectedMaterialResult.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ContentFilterSeverity.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ContentFilterSeverityResult.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ContentFilterSeverityResult.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ContentFilterTextSpan.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ContentFilterTextSpan.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ContentFilterTextSpanResult.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ContentFilterTextSpanResult.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/CosmosChatDataSource.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/CosmosChatDataSource.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/DataSourceAuthentication.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/DataSourceAuthentication.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/DataSourceFieldMappings.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/DataSourceFieldMappings.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/DataSourceQueryType.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/DataSourceVectorizer.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/DataSourceVectorizer.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ElasticsearchChatDataSource.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ElasticsearchChatDataSource.cs (100%) create mode 100644 .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ElasticsearchChatDataSourceParametersQueryType.Serialization.cs create mode 100644 .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ElasticsearchChatDataSourceParametersQueryType.cs rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs (94%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs (94%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs (94%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs (94%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs (94%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceEndpointVectorizationSource.cs (96%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceIntegratedVectorizationSource.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs (91%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceModelIdVectorizationSource.cs (94%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs (93%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs (91%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureContentFilterBlocklistIdResult.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureContentFilterBlocklistIdResult.cs (92%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureContentFilterBlocklistResultDetail.cs (92%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureContentFilterResultForChoiceError.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureContentFilterResultForChoiceError.cs (92%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureContentFilterResultForPromptContentFilterResults.cs (74%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureCosmosDBChatDataSourceParameters.cs (95%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureOpenAIChatErrorInnerError.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureOpenAIChatErrorInnerError.cs (84%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureOpenAIChatErrorInnerErrorCode.cs (90%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureOpenAIDalleErrorInnerError.cs (84%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureOpenAIDalleErrorInnerErrorCode.cs (89%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureSearchChatDataSourceParameters.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureSearchChatDataSourceParameters.cs (96%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalAzureSearchChatDataSourceParametersIncludeContext.cs (77%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalElasticsearchChatDataSourceParameters.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalElasticsearchChatDataSourceParameters.cs (96%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalMongoDBChatDataSourceParameters.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalMongoDBChatDataSourceParameters.cs (93%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalPineconeChatDataSourceParameters.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalPineconeChatDataSourceParameters.cs (96%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalUnknownAzureChatDataSource.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalUnknownAzureChatDataSource.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/InternalUnknownAzureChatDataSourceVectorizationSource.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/MongoDBChatDataSource.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/MongoDBChatDataSource.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/PineconeChatDataSource.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/PineconeChatDataSource.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/RequestContentFilterResult.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/RequestContentFilterResult.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/RequestImageContentFilterResult.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/RequestImageContentFilterResult.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ResponseContentFilterResult.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ResponseContentFilterResult.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ResponseImageContentFilterResult.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/ResponseImageContentFilterResult.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/UserSecurityContext.Serialization.cs (100%) rename .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/{ => Models}/UserSecurityContext.cs (100%) delete mode 100644 .dotnet.azure/sdk/openai/Azure.AI.OpenAI/tspCodeModel.json rename .plugin.azure/generator/src/{AzureOpenAILibraryVisitor.cs => Visitors/AdditionalPropertiesVisitor.cs} (68%) rename .plugin.azure/generator/src/{ => Visitors}/DocEditVisitor.cs (100%) create mode 100644 .plugin.azure/generator/src/Visitors/InternalSettablePropertiesVisitor.cs create mode 100644 .plugin.azure/generator/src/Visitors/ModelSerializationEmptySentinelVisitor.cs create mode 100644 .plugin.azure/generator/src/Visitors/TypeRemovalVisitor.cs create mode 100644 .plugin.azure/generator/src/Visitors/WriteableSardVisitor.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/Configuration.json b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/Configuration.json deleted file mode 100644 index af0888870..000000000 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/Configuration.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "output-folder": ".", - "namespace": "Azure.AI.OpenAI", - "library-name": "Azure.AI.OpenAI", - "single-top-level-client": true, - "unreferenced-types-handling": "keepAll", - "model-namespace": false, - "flavor": "unbranded", - "use-model-reader-writer": true -} diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureOpenAIChatError.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureOpenAIChatError.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureOpenAIChatError.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureOpenAIChatError.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureOpenAIChatErrorResponse.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureOpenAIChatErrorResponse.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureOpenAIChatErrorResponse.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureOpenAIChatErrorResponse.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureOpenAIDalleError.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureOpenAIDalleError.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureOpenAIDalleError.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureOpenAIDalleError.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureOpenAIDalleErrorResponse.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureOpenAIDalleErrorResponse.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureOpenAIDalleErrorResponse.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureOpenAIDalleErrorResponse.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureSearchChatDataSource.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureSearchChatDataSource.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureSearchChatDataSource.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/AzureSearchChatDataSource.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatCitation.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatCitation.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatCitation.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatCitation.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatCitation.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatDataSource.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatDataSource.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatDataSource.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDataSource.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatDataSource.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDocumentFilterReason.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatDocumentFilterReason.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatDocumentFilterReason.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatDocumentFilterReason.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatMessageContext.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatMessageContext.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatMessageContext.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatMessageContext.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatMessageContext.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatRetrievedDocument.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatRetrievedDocument.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatRetrievedDocument.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ChatRetrievedDocument.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ChatRetrievedDocument.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterBlocklistResult.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterBlocklistResult.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterBlocklistResult.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterBlocklistResult.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterDetectionResult.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterDetectionResult.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterDetectionResult.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterDetectionResult.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterProtectedMaterialCitationResult.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterProtectedMaterialCitationResult.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterProtectedMaterialCitationResult.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitationResult.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterProtectedMaterialCitationResult.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterProtectedMaterialResult.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterProtectedMaterialResult.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterProtectedMaterialResult.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterProtectedMaterialResult.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterSeverity.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterSeverity.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterSeverityResult.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterSeverityResult.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterSeverityResult.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterSeverityResult.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterTextSpan.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterTextSpan.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterTextSpan.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpan.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterTextSpan.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterTextSpanResult.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterTextSpanResult.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterTextSpanResult.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterTextSpanResult.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ContentFilterTextSpanResult.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/CosmosChatDataSource.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/CosmosChatDataSource.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/CosmosChatDataSource.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/CosmosChatDataSource.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/CosmosChatDataSource.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/DataSourceAuthentication.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/DataSourceAuthentication.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/DataSourceAuthentication.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/DataSourceAuthentication.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/DataSourceFieldMappings.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/DataSourceFieldMappings.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/DataSourceFieldMappings.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/DataSourceFieldMappings.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/DataSourceQueryType.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/DataSourceQueryType.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/DataSourceVectorizer.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/DataSourceVectorizer.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/DataSourceVectorizer.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/DataSourceVectorizer.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ElasticsearchChatDataSource.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ElasticsearchChatDataSource.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ElasticsearchChatDataSource.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ElasticsearchChatDataSource.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ElasticsearchChatDataSourceParametersQueryType.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ElasticsearchChatDataSourceParametersQueryType.Serialization.cs new file mode 100644 index 000000000..f3da4e8cf --- /dev/null +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ElasticsearchChatDataSourceParametersQueryType.Serialization.cs @@ -0,0 +1,31 @@ +// + +#nullable disable + +using System; + +namespace Azure.AI.OpenAI.Models +{ + internal static partial class ElasticsearchChatDataSourceParametersQueryTypeExtensions + { + public static string ToSerialString(this ElasticsearchChatDataSourceParametersQueryType value) => value switch + { + ElasticsearchChatDataSourceParametersQueryType.Simple => "simple", + ElasticsearchChatDataSourceParametersQueryType.Vector => "vector", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ElasticsearchChatDataSourceParametersQueryType value.") + }; + + public static ElasticsearchChatDataSourceParametersQueryType ToElasticsearchChatDataSourceParametersQueryType(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "simple")) + { + return ElasticsearchChatDataSourceParametersQueryType.Simple; + } + if (StringComparer.OrdinalIgnoreCase.Equals(value, "vector")) + { + return ElasticsearchChatDataSourceParametersQueryType.Vector; + } + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ElasticsearchChatDataSourceParametersQueryType value."); + } + } +} diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ElasticsearchChatDataSourceParametersQueryType.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ElasticsearchChatDataSourceParametersQueryType.cs new file mode 100644 index 000000000..ff8508875 --- /dev/null +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ElasticsearchChatDataSourceParametersQueryType.cs @@ -0,0 +1,15 @@ +// + +#nullable disable + +namespace Azure.AI.OpenAI.Models +{ + /// + public enum ElasticsearchChatDataSourceParametersQueryType + { + /// Simple. + Simple, + /// Vector. + Vector + } +} diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs similarity index 94% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs index 7be771ec0..927d0cae0 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs @@ -22,6 +22,6 @@ internal InternalAzureChatDataSourceAccessTokenAuthenticationOptions(string @typ AccessToken = accessToken; } - internal string AccessToken { get; set; } + public string AccessToken { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs similarity index 94% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs index 60fd30256..1d961aa82 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs @@ -22,6 +22,6 @@ internal InternalAzureChatDataSourceApiKeyAuthenticationOptions(string @type, ID Key = key; } - internal string Key { get; set; } + public string Key { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs similarity index 94% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs index 262ebfcb9..604747811 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs @@ -22,6 +22,6 @@ internal InternalAzureChatDataSourceConnectionStringAuthenticationOptions(string ConnectionString = connectionString; } - internal string ConnectionString { get; set; } + public string ConnectionString { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs similarity index 94% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs index 501a7101c..483a2aa2e 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceDeploymentNameVectorizationSource.cs @@ -23,7 +23,7 @@ internal InternalAzureChatDataSourceDeploymentNameVectorizationSource(string @ty Dimensions = dimensions; } - internal string DeploymentName { get; set; } + public string DeploymentName { get; set; } public int? Dimensions { get; set; } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs similarity index 94% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs index 026156e43..d44b6a65b 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs @@ -22,6 +22,6 @@ internal InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(string @t EncodedApiKey = encodedApiKey; } - internal string EncodedApiKey { get; set; } + public string EncodedApiKey { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceEndpointVectorizationSource.cs similarity index 96% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceEndpointVectorizationSource.cs index 652e67943..667c981ea 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceEndpointVectorizationSource.cs @@ -26,7 +26,7 @@ internal InternalAzureChatDataSourceEndpointVectorizationSource(string @type, ID Authentication = authentication; } - internal Uri Endpoint { get; set; } + public Uri Endpoint { get; set; } public int? Dimensions { get; set; } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceIntegratedVectorizationSource.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceIntegratedVectorizationSource.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceIntegratedVectorizationSource.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceIntegratedVectorizationSource.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs similarity index 91% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs index 8cf84e008..c44f34cae 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs @@ -25,8 +25,8 @@ internal InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(string @typ KeyId = keyId; } - internal string Key { get; set; } + public string Key { get; set; } - internal string KeyId { get; set; } + public string KeyId { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceModelIdVectorizationSource.cs similarity index 94% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceModelIdVectorizationSource.cs index a0767cfd2..39674da9d 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceModelIdVectorizationSource.cs @@ -22,6 +22,6 @@ internal InternalAzureChatDataSourceModelIdVectorizationSource(string @type, IDi ModelId = modelId; } - internal string ModelId { get; set; } + public string ModelId { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs similarity index 93% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs index 3b3085dca..5a652ca3c 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs @@ -22,6 +22,6 @@ internal InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOpt ManagedIdentityResourceId = managedIdentityResourceId; } - internal string ManagedIdentityResourceId { get; set; } + public string ManagedIdentityResourceId { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs similarity index 91% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs index 993e8897b..929edfffe 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions.cs @@ -25,8 +25,8 @@ internal InternalAzureChatDataSourceUsernameAndPasswordAuthenticationOptions(str Password = password; } - internal string Username { get; set; } + public string Username { get; set; } - internal string Password { get; set; } + public string Password { get; set; } } } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterBlocklistIdResult.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterBlocklistIdResult.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterBlocklistIdResult.cs similarity index 92% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterBlocklistIdResult.cs index 43d5826e5..3003ef08a 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterBlocklistIdResult.cs @@ -25,9 +25,9 @@ internal InternalAzureContentFilterBlocklistIdResult(string id, bool filtered, I _additionalBinaryDataProperties = additionalBinaryDataProperties; } - internal string Id { get; set; } + public string Id { get; set; } - internal bool Filtered { get; set; } + public bool Filtered { get; set; } internal IDictionary SerializedAdditionalRawData { diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterBlocklistResultDetail.cs similarity index 92% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterBlocklistResultDetail.cs index 8564be4d9..1964113da 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterBlocklistResultDetail.cs @@ -25,9 +25,9 @@ internal InternalAzureContentFilterBlocklistResultDetail(bool filtered, string i _additionalBinaryDataProperties = additionalBinaryDataProperties; } - internal bool Filtered { get; set; } + public bool Filtered { get; set; } - internal string Id { get; set; } + public string Id { get; set; } internal IDictionary SerializedAdditionalRawData { diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForChoiceError.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterResultForChoiceError.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForChoiceError.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterResultForChoiceError.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForChoiceError.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterResultForChoiceError.cs similarity index 92% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForChoiceError.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterResultForChoiceError.cs index 77673df0c..39955abc6 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForChoiceError.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterResultForChoiceError.cs @@ -25,9 +25,9 @@ internal InternalAzureContentFilterResultForChoiceError(int code, string message _additionalBinaryDataProperties = additionalBinaryDataProperties; } - internal int Code { get; set; } + public int Code { get; set; } - internal string Message { get; set; } + public string Message { get; set; } internal IDictionary SerializedAdditionalRawData { diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterResultForPromptContentFilterResults.cs similarity index 74% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterResultForPromptContentFilterResults.cs index 625a04ccb..d3f839aac 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureContentFilterResultForPromptContentFilterResults.cs @@ -32,23 +32,23 @@ internal InternalAzureContentFilterResultForPromptContentFilterResults(ContentFi _additionalBinaryDataProperties = additionalBinaryDataProperties; } - internal ContentFilterSeverityResult Sexual { get; set; } + public ContentFilterSeverityResult Sexual { get; set; } - internal ContentFilterSeverityResult Hate { get; set; } + public ContentFilterSeverityResult Hate { get; set; } - internal ContentFilterSeverityResult Violence { get; set; } + public ContentFilterSeverityResult Violence { get; set; } - internal ContentFilterSeverityResult SelfHarm { get; set; } + public ContentFilterSeverityResult SelfHarm { get; set; } - internal ContentFilterDetectionResult Profanity { get; set; } + public ContentFilterDetectionResult Profanity { get; set; } - internal ContentFilterBlocklistResult CustomBlocklists { get; set; } + public ContentFilterBlocklistResult CustomBlocklists { get; set; } - internal InternalAzureContentFilterResultForChoiceError Error { get; set; } + public InternalAzureContentFilterResultForChoiceError Error { get; set; } - internal ContentFilterDetectionResult Jailbreak { get; set; } + public ContentFilterDetectionResult Jailbreak { get; set; } - internal ContentFilterDetectionResult IndirectAttack { get; set; } + public ContentFilterDetectionResult IndirectAttack { get; set; } internal IDictionary SerializedAdditionalRawData { diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureCosmosDBChatDataSourceParameters.cs similarity index 95% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureCosmosDBChatDataSourceParameters.cs index 1113ac762..40fe9015b 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureCosmosDBChatDataSourceParameters.cs @@ -58,11 +58,11 @@ internal InternalAzureCosmosDBChatDataSourceParameters(int? topNDocuments, bool? public bool? AllowPartialResult { get; set; } - internal string ContainerName { get; set; } + public string ContainerName { get; set; } - internal string DatabaseName { get; set; } + public string DatabaseName { get; set; } - internal string IndexName { get; set; } + public string IndexName { get; set; } internal IDictionary SerializedAdditionalRawData { diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureOpenAIChatErrorInnerError.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureOpenAIChatErrorInnerError.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureOpenAIChatErrorInnerError.cs similarity index 84% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureOpenAIChatErrorInnerError.cs index e796e5aa0..221e6fef0 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureOpenAIChatErrorInnerError.cs @@ -24,11 +24,11 @@ internal InternalAzureOpenAIChatErrorInnerError(InternalAzureOpenAIChatErrorInne _additionalBinaryDataProperties = additionalBinaryDataProperties; } - internal InternalAzureOpenAIChatErrorInnerErrorCode? Code { get; set; } + public InternalAzureOpenAIChatErrorInnerErrorCode? Code { get; set; } - internal string RevisedPrompt { get; set; } + public string RevisedPrompt { get; set; } - internal RequestContentFilterResult ContentFilterResults { get; set; } + public RequestContentFilterResult ContentFilterResults { get; set; } internal IDictionary SerializedAdditionalRawData { diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureOpenAIChatErrorInnerErrorCode.cs similarity index 90% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureOpenAIChatErrorInnerErrorCode.cs index 5bad53ad3..1f02d1c42 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureOpenAIChatErrorInnerErrorCode.cs @@ -20,7 +20,7 @@ public InternalAzureOpenAIChatErrorInnerErrorCode(string value) _value = value; } - internal static InternalAzureOpenAIChatErrorInnerErrorCode ResponsibleAIPolicyViolation { get; set; } = new InternalAzureOpenAIChatErrorInnerErrorCode(ResponsibleAIPolicyViolationValue); + public static InternalAzureOpenAIChatErrorInnerErrorCode ResponsibleAIPolicyViolation { get; set; } = new InternalAzureOpenAIChatErrorInnerErrorCode(ResponsibleAIPolicyViolationValue); public static bool operator ==(InternalAzureOpenAIChatErrorInnerErrorCode left, InternalAzureOpenAIChatErrorInnerErrorCode right) => left.Equals(right); diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureOpenAIDalleErrorInnerError.cs similarity index 84% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureOpenAIDalleErrorInnerError.cs index a8ae69bcb..a993030f4 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureOpenAIDalleErrorInnerError.cs @@ -24,11 +24,11 @@ internal InternalAzureOpenAIDalleErrorInnerError(InternalAzureOpenAIDalleErrorIn _additionalBinaryDataProperties = additionalBinaryDataProperties; } - internal InternalAzureOpenAIDalleErrorInnerErrorCode? Code { get; set; } + public InternalAzureOpenAIDalleErrorInnerErrorCode? Code { get; set; } - internal string RevisedPrompt { get; set; } + public string RevisedPrompt { get; set; } - internal RequestImageContentFilterResult ContentFilterResults { get; set; } + public RequestImageContentFilterResult ContentFilterResults { get; set; } internal IDictionary SerializedAdditionalRawData { diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureOpenAIDalleErrorInnerErrorCode.cs similarity index 89% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureOpenAIDalleErrorInnerErrorCode.cs index 9c9b22e30..8585b396a 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureOpenAIDalleErrorInnerErrorCode.cs @@ -20,7 +20,7 @@ public InternalAzureOpenAIDalleErrorInnerErrorCode(string value) _value = value; } - internal static InternalAzureOpenAIDalleErrorInnerErrorCode ResponsibleAIPolicyViolation { get; set; } = new InternalAzureOpenAIDalleErrorInnerErrorCode(ResponsibleAIPolicyViolationValue); + public static InternalAzureOpenAIDalleErrorInnerErrorCode ResponsibleAIPolicyViolation { get; set; } = new InternalAzureOpenAIDalleErrorInnerErrorCode(ResponsibleAIPolicyViolationValue); public static bool operator ==(InternalAzureOpenAIDalleErrorInnerErrorCode left, InternalAzureOpenAIDalleErrorInnerErrorCode right) => left.Equals(right); diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureSearchChatDataSourceParameters.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureSearchChatDataSourceParameters.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureSearchChatDataSourceParameters.cs similarity index 96% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureSearchChatDataSourceParameters.cs index 7b06fa6cb..fb1d2c47c 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureSearchChatDataSourceParameters.cs @@ -54,9 +54,9 @@ internal InternalAzureSearchChatDataSourceParameters(int? topNDocuments, bool? i public bool? AllowPartialResult { get; set; } - internal Uri Endpoint { get; set; } + public Uri Endpoint { get; set; } - internal string IndexName { get; set; } + public string IndexName { get; set; } public string SemanticConfiguration { get; set; } diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureSearchChatDataSourceParametersIncludeContext.cs similarity index 77% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureSearchChatDataSourceParametersIncludeContext.cs index 64fcc7934..60c378f4b 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalAzureSearchChatDataSourceParametersIncludeContext.cs @@ -22,11 +22,11 @@ public InternalAzureSearchChatDataSourceParametersIncludeContext(string value) _value = value; } - internal static InternalAzureSearchChatDataSourceParametersIncludeContext Citations { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(CitationsValue); + public static InternalAzureSearchChatDataSourceParametersIncludeContext Citations { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(CitationsValue); - internal static InternalAzureSearchChatDataSourceParametersIncludeContext Intent { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(IntentValue); + public static InternalAzureSearchChatDataSourceParametersIncludeContext Intent { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(IntentValue); - internal static InternalAzureSearchChatDataSourceParametersIncludeContext AllRetrievedDocuments { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(AllRetrievedDocumentsValue); + public static InternalAzureSearchChatDataSourceParametersIncludeContext AllRetrievedDocuments { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(AllRetrievedDocumentsValue); public static bool operator ==(InternalAzureSearchChatDataSourceParametersIncludeContext left, InternalAzureSearchChatDataSourceParametersIncludeContext right) => left.Equals(right); diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalElasticsearchChatDataSourceParameters.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalElasticsearchChatDataSourceParameters.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalElasticsearchChatDataSourceParameters.cs similarity index 96% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalElasticsearchChatDataSourceParameters.cs index 56853fac0..ec14841d8 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalElasticsearchChatDataSourceParameters.cs @@ -52,9 +52,9 @@ internal InternalElasticsearchChatDataSourceParameters(int? topNDocuments, bool? public bool? AllowPartialResult { get; set; } - internal Uri Endpoint { get; set; } + public Uri Endpoint { get; set; } - internal string IndexName { get; set; } + public string IndexName { get; set; } internal IDictionary SerializedAdditionalRawData { diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalMongoDBChatDataSourceParameters.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalMongoDBChatDataSourceParameters.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalMongoDBChatDataSourceParameters.cs similarity index 93% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalMongoDBChatDataSourceParameters.cs index 8f34af30b..9d06bc0fa 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalMongoDBChatDataSourceParameters.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalMongoDBChatDataSourceParameters.cs @@ -64,15 +64,15 @@ internal InternalMongoDBChatDataSourceParameters(int? topNDocuments, bool? inSco public bool? AllowPartialResult { get; set; } - internal string Endpoint { get; set; } + public string Endpoint { get; set; } - internal string DatabaseName { get; set; } + public string DatabaseName { get; set; } - internal string CollectionName { get; set; } + public string CollectionName { get; set; } - internal string AppName { get; set; } + public string AppName { get; set; } - internal string IndexName { get; set; } + public string IndexName { get; set; } internal IDictionary SerializedAdditionalRawData { diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalPineconeChatDataSourceParameters.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalPineconeChatDataSourceParameters.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalPineconeChatDataSourceParameters.cs similarity index 96% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalPineconeChatDataSourceParameters.cs index d16b93871..06dec9c44 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalPineconeChatDataSourceParameters.cs @@ -55,9 +55,9 @@ internal InternalPineconeChatDataSourceParameters(int? topNDocuments, bool? inSc public bool? AllowPartialResult { get; set; } - internal string Environment { get; set; } + public string Environment { get; set; } - internal string IndexName { get; set; } + public string IndexName { get; set; } internal IDictionary SerializedAdditionalRawData { diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalUnknownAzureChatDataSource.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalUnknownAzureChatDataSource.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalUnknownAzureChatDataSource.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalUnknownAzureChatDataSource.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalUnknownAzureChatDataSourceVectorizationSource.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/InternalUnknownAzureChatDataSourceVectorizationSource.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/MongoDBChatDataSource.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/MongoDBChatDataSource.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/MongoDBChatDataSource.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/MongoDBChatDataSource.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/MongoDBChatDataSource.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/PineconeChatDataSource.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/PineconeChatDataSource.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/PineconeChatDataSource.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/PineconeChatDataSource.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/RequestContentFilterResult.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/RequestContentFilterResult.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/RequestContentFilterResult.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestContentFilterResult.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/RequestContentFilterResult.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/RequestImageContentFilterResult.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/RequestImageContentFilterResult.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/RequestImageContentFilterResult.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/RequestImageContentFilterResult.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/RequestImageContentFilterResult.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ResponseContentFilterResult.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ResponseContentFilterResult.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ResponseContentFilterResult.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseContentFilterResult.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ResponseContentFilterResult.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ResponseImageContentFilterResult.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ResponseImageContentFilterResult.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ResponseImageContentFilterResult.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/ResponseImageContentFilterResult.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/ResponseImageContentFilterResult.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/UserSecurityContext.Serialization.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/UserSecurityContext.Serialization.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/UserSecurityContext.Serialization.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/UserSecurityContext.Serialization.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/UserSecurityContext.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/UserSecurityContext.cs similarity index 100% rename from .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/UserSecurityContext.cs rename to .dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Generated/Models/UserSecurityContext.cs diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/tspCodeModel.json b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/tspCodeModel.json deleted file mode 100644 index 33ca3c05c..000000000 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/tspCodeModel.json +++ /dev/null @@ -1,12494 +0,0 @@ -{ - "$id": "1", - "Name": "AzureOpenAI", - "ApiVersions": [ - "2024-06-01", - "2024-08-01-preview", - "2024-09-01-preview", - "2024-10-01-preview", - "2024-10-21", - "2024-12-01-preview", - "2025-01-01-preview" - ], - "Enums": [ - { - "$id": "2", - "kind": "enum", - "name": "AzureOpenAIDalleErrorInnerError_code", - "valueType": { - "$id": "3", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "4", - "kind": "enumvalue", - "name": "ResponsibleAIPolicyViolation", - "value": "ResponsibleAIPolicyViolation", - "description": "ResponsibleAIPolicyViolation", - "valueType": { - "$ref": "3" - }, - "enumType": { - "$ref": "2" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The AzureOpenAIDalleErrorInnerError_code", - "isFixed": false, - "isFlags": false, - "usage": "Output", - "decorators": [] - }, - { - "$id": "5", - "kind": "enum", - "name": "AzureContentFilterSeverityResultSeverity", - "crossLanguageDefinitionId": "AzureContentFilterSeverityResult.severity.anonymous", - "valueType": { - "$id": "6", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "7", - "kind": "enumvalue", - "name": "safe", - "value": "safe", - "valueType": { - "$id": "8", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "5" - }, - "decorators": [] - }, - { - "$id": "9", - "kind": "enumvalue", - "name": "low", - "value": "low", - "valueType": { - "$id": "10", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "5" - }, - "decorators": [] - }, - { - "$id": "11", - "kind": "enumvalue", - "name": "medium", - "value": "medium", - "valueType": { - "$id": "12", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "5" - }, - "decorators": [] - }, - { - "$id": "13", - "kind": "enumvalue", - "name": "high", - "value": "high", - "valueType": { - "$id": "14", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "5" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Output", - "decorators": [] - }, - { - "$id": "15", - "kind": "enum", - "name": "AzureSearchChatDataSourceParametersIncludeContext", - "crossLanguageDefinitionId": "AzureSearchChatDataSource.parameters.include_context.anonymous", - "valueType": { - "$id": "16", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "17", - "kind": "enumvalue", - "name": "citations", - "value": "citations", - "valueType": { - "$id": "18", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "15" - }, - "decorators": [] - }, - { - "$id": "19", - "kind": "enumvalue", - "name": "intent", - "value": "intent", - "valueType": { - "$id": "20", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "15" - }, - "decorators": [] - }, - { - "$id": "21", - "kind": "enumvalue", - "name": "all_retrieved_documents", - "value": "all_retrieved_documents", - "valueType": { - "$id": "22", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "15" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input", - "decorators": [] - }, - { - "$id": "23", - "kind": "enum", - "name": "AzureSearchChatDataSourceParametersQueryType", - "crossLanguageDefinitionId": "AzureSearchChatDataSource.parameters.query_type.anonymous", - "valueType": { - "$id": "24", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "25", - "kind": "enumvalue", - "name": "simple", - "value": "simple", - "valueType": { - "$id": "26", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "23" - }, - "decorators": [] - }, - { - "$id": "27", - "kind": "enumvalue", - "name": "semantic", - "value": "semantic", - "valueType": { - "$id": "28", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "23" - }, - "decorators": [] - }, - { - "$id": "29", - "kind": "enumvalue", - "name": "vector", - "value": "vector", - "valueType": { - "$id": "30", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "23" - }, - "decorators": [] - }, - { - "$id": "31", - "kind": "enumvalue", - "name": "vector_simple_hybrid", - "value": "vector_simple_hybrid", - "valueType": { - "$id": "32", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "23" - }, - "decorators": [] - }, - { - "$id": "33", - "kind": "enumvalue", - "name": "vector_semantic_hybrid", - "value": "vector_semantic_hybrid", - "valueType": { - "$id": "34", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "23" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input", - "decorators": [] - }, - { - "$id": "35", - "kind": "enum", - "name": "ElasticsearchChatDataSourceParametersQueryType", - "crossLanguageDefinitionId": "ElasticsearchChatDataSource.parameters.query_type.anonymous", - "valueType": { - "$id": "36", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "37", - "kind": "enumvalue", - "name": "simple", - "value": "simple", - "valueType": { - "$id": "38", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "35" - }, - "decorators": [] - }, - { - "$id": "39", - "kind": "enumvalue", - "name": "vector", - "value": "vector", - "valueType": { - "$id": "40", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "35" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input", - "decorators": [] - }, - { - "$id": "41", - "kind": "enum", - "name": "AzureChatMessageContextAllRetrievedDocumentsFilterReason", - "crossLanguageDefinitionId": "AzureChatMessageContext.all_retrieved_documents.filter_reason.anonymous", - "valueType": { - "$id": "42", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "43", - "kind": "enumvalue", - "name": "score", - "value": "score", - "valueType": { - "$id": "44", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "41" - }, - "decorators": [] - }, - { - "$id": "45", - "kind": "enumvalue", - "name": "rerank", - "value": "rerank", - "valueType": { - "$id": "46", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "41" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Output", - "decorators": [] - }, - { - "$id": "47", - "kind": "enum", - "name": "AzureOpenAIChatErrorInnerError_code", - "valueType": { - "$id": "48", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "49", - "kind": "enumvalue", - "name": "ResponsibleAIPolicyViolation", - "value": "ResponsibleAIPolicyViolation", - "description": "ResponsibleAIPolicyViolation", - "valueType": { - "$ref": "48" - }, - "enumType": { - "$ref": "47" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The AzureOpenAIChatErrorInnerError_code", - "isFixed": false, - "isFlags": false, - "usage": "Output", - "decorators": [] - }, - { - "$id": "50", - "kind": "enum", - "name": "AzureOpenAIServiceApiVersion", - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIServiceApiVersion", - "valueType": { - "$id": "51", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "52", - "kind": "enumvalue", - "name": "v2024_06_01", - "value": "2024-06-01", - "valueType": { - "$id": "53", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "50" - }, - "description": "The 2024-06-01 (stable) service API version label.", - "decorators": [] - }, - { - "$id": "54", - "kind": "enumvalue", - "name": "v2024_08_01_preview", - "value": "2024-08-01-preview", - "valueType": { - "$id": "55", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "50" - }, - "description": "The 2024-08-01-preview service API version label.", - "decorators": [] - }, - { - "$id": "56", - "kind": "enumvalue", - "name": "v2024_09_01_preview", - "value": "2024-09-01-preview", - "valueType": { - "$id": "57", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "50" - }, - "description": "The 2024-09-01-preview service API version label.", - "decorators": [] - }, - { - "$id": "58", - "kind": "enumvalue", - "name": "v2024_10_01_preview", - "value": "2024-10-01-preview", - "valueType": { - "$id": "59", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "50" - }, - "description": "The 2024-10-01-preview service API version label.", - "decorators": [] - }, - { - "$id": "60", - "kind": "enumvalue", - "name": "v2024_10_21", - "value": "2024-10-21", - "valueType": { - "$id": "61", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "50" - }, - "description": "The 2024-10-21 (stable) service API version label.", - "decorators": [] - }, - { - "$id": "62", - "kind": "enumvalue", - "name": "v2024_12_01_preview", - "value": "2024-12-01-preview", - "valueType": { - "$id": "63", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "50" - }, - "description": "The 2024-12-01-preview service API version label.", - "decorators": [] - }, - { - "$id": "64", - "kind": "enumvalue", - "name": "v2025_01_01_preview", - "value": "2025-01-01-preview", - "valueType": { - "$id": "65", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "50" - }, - "description": "The 2025-01-01-preview service API version label.", - "decorators": [] - } - ], - "description": "Known service API versions for Azure OpenAI.", - "isFixed": true, - "isFlags": false, - "usage": "ApiVersionEnum", - "decorators": [] - }, - { - "$id": "66", - "kind": "enum", - "name": "OpenAIFileWithOmittedPropertiesPurpose", - "crossLanguageDefinitionId": "OpenAIFileWithOmittedProperties.purpose.anonymous", - "valueType": { - "$id": "67", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "68", - "kind": "enumvalue", - "name": "assistants", - "value": "assistants", - "valueType": { - "$id": "69", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "66" - }, - "decorators": [] - }, - { - "$id": "70", - "kind": "enumvalue", - "name": "assistants_output", - "value": "assistants_output", - "valueType": { - "$id": "71", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "66" - }, - "decorators": [] - }, - { - "$id": "72", - "kind": "enumvalue", - "name": "batch", - "value": "batch", - "valueType": { - "$id": "73", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "66" - }, - "decorators": [] - }, - { - "$id": "74", - "kind": "enumvalue", - "name": "batch_output", - "value": "batch_output", - "valueType": { - "$id": "75", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "66" - }, - "decorators": [] - }, - { - "$id": "76", - "kind": "enumvalue", - "name": "fine-tune", - "value": "fine-tune", - "valueType": { - "$id": "77", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "66" - }, - "decorators": [] - }, - { - "$id": "78", - "kind": "enumvalue", - "name": "fine-tune-results", - "value": "fine-tune-results", - "valueType": { - "$id": "79", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "66" - }, - "decorators": [] - }, - { - "$id": "80", - "kind": "enumvalue", - "name": "vision", - "value": "vision", - "valueType": { - "$id": "81", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "66" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Output", - "decorators": [] - }, - { - "$id": "82", - "kind": "enum", - "name": "AzureOpenAIFile_object", - "valueType": { - "$id": "83", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "84", - "kind": "enumvalue", - "name": "file", - "value": "file", - "description": "file", - "valueType": { - "$ref": "83" - }, - "enumType": { - "$ref": "82" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The AzureOpenAIFile_object", - "isFixed": false, - "isFlags": false, - "usage": "Output", - "decorators": [] - }, - { - "$id": "85", - "kind": "enum", - "name": "AzureOpenAIFileStatus", - "crossLanguageDefinitionId": "AzureOpenAIFile.status.anonymous", - "valueType": { - "$id": "86", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "87", - "kind": "enumvalue", - "name": "uploaded", - "value": "uploaded", - "valueType": { - "$id": "88", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "85" - }, - "decorators": [] - }, - { - "$id": "89", - "kind": "enumvalue", - "name": "pending", - "value": "pending", - "valueType": { - "$id": "90", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "85" - }, - "decorators": [] - }, - { - "$id": "91", - "kind": "enumvalue", - "name": "running", - "value": "running", - "valueType": { - "$id": "92", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "85" - }, - "decorators": [] - }, - { - "$id": "93", - "kind": "enumvalue", - "name": "processed", - "value": "processed", - "valueType": { - "$id": "94", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "85" - }, - "decorators": [] - }, - { - "$id": "95", - "kind": "enumvalue", - "name": "error", - "value": "error", - "valueType": { - "$id": "96", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "85" - }, - "decorators": [] - }, - { - "$id": "97", - "kind": "enumvalue", - "name": "deleting", - "value": "deleting", - "valueType": { - "$id": "98", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "85" - }, - "decorators": [] - }, - { - "$id": "99", - "kind": "enumvalue", - "name": "deleted", - "value": "deleted", - "valueType": { - "$id": "100", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "85" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Output", - "decorators": [] - }, - { - "$id": "101", - "kind": "enum", - "name": "ChatCompletionRequestMessageContentPartText_type", - "valueType": { - "$id": "102", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "103", - "kind": "enumvalue", - "name": "text", - "value": "text", - "description": "text", - "valueType": { - "$ref": "102" - }, - "enumType": { - "$ref": "101" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The ChatCompletionRequestMessageContentPartText_type", - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "104", - "kind": "enum", - "name": "ChatCompletionRequestMessageContentPartImage_type", - "valueType": { - "$id": "105", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "106", - "kind": "enumvalue", - "name": "image_url", - "value": "image_url", - "description": "image_url", - "valueType": { - "$ref": "105" - }, - "enumType": { - "$ref": "104" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The ChatCompletionRequestMessageContentPartImage_type", - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "107", - "kind": "enum", - "name": "ChatCompletionRequestMessageContentPartImageImageUrlDetail", - "crossLanguageDefinitionId": "ChatCompletionRequestMessageContentPartImage.image_url.detail.anonymous", - "valueType": { - "$id": "108", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "109", - "kind": "enumvalue", - "name": "auto", - "value": "auto", - "valueType": { - "$id": "110", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "107" - }, - "decorators": [] - }, - { - "$id": "111", - "kind": "enumvalue", - "name": "low", - "value": "low", - "valueType": { - "$id": "112", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "107" - }, - "decorators": [] - }, - { - "$id": "113", - "kind": "enumvalue", - "name": "high", - "value": "high", - "valueType": { - "$id": "114", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "107" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "115", - "kind": "enum", - "name": "ChatCompletionRequestMessageContentPartAudio_type", - "valueType": { - "$id": "116", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "117", - "kind": "enumvalue", - "name": "input_audio", - "value": "input_audio", - "description": "input_audio", - "valueType": { - "$ref": "116" - }, - "enumType": { - "$ref": "115" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The ChatCompletionRequestMessageContentPartAudio_type", - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "118", - "kind": "enum", - "name": "ChatCompletionRequestMessageContentPartAudioInputAudioFormat", - "crossLanguageDefinitionId": "ChatCompletionRequestMessageContentPartAudio.input_audio.format.anonymous", - "valueType": { - "$id": "119", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "120", - "kind": "enumvalue", - "name": "wav", - "value": "wav", - "valueType": { - "$id": "121", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "118" - }, - "decorators": [] - }, - { - "$id": "122", - "kind": "enumvalue", - "name": "mp3", - "value": "mp3", - "valueType": { - "$id": "123", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "118" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "124", - "kind": "enum", - "name": "ChatCompletionRequestMessageContentPartRefusal_type", - "valueType": { - "$id": "125", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "126", - "kind": "enumvalue", - "name": "refusal", - "value": "refusal", - "description": "refusal", - "valueType": { - "$ref": "125" - }, - "enumType": { - "$ref": "124" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The ChatCompletionRequestMessageContentPartRefusal_type", - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "127", - "kind": "enum", - "name": "ChatCompletionMessageToolCall_type", - "valueType": { - "$id": "128", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "129", - "kind": "enumvalue", - "name": "function", - "value": "function", - "description": "function", - "valueType": { - "$ref": "128" - }, - "enumType": { - "$ref": "127" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The ChatCompletionMessageToolCall_type", - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "130", - "kind": "enum", - "name": "AzureCreateChatCompletionRequestReasoningEffort", - "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.reasoning_effort.anonymous", - "valueType": { - "$id": "131", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "132", - "kind": "enumvalue", - "name": "low", - "value": "low", - "valueType": { - "$id": "133", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "130" - }, - "decorators": [] - }, - { - "$id": "134", - "kind": "enumvalue", - "name": "medium", - "value": "medium", - "valueType": { - "$id": "135", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "130" - }, - "decorators": [] - }, - { - "$id": "136", - "kind": "enumvalue", - "name": "high", - "value": "high", - "valueType": { - "$id": "137", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "130" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "138", - "kind": "enum", - "name": "AzureCreateChatCompletionRequestModality", - "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.modality.anonymous", - "valueType": { - "$id": "139", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "140", - "kind": "enumvalue", - "name": "text", - "value": "text", - "valueType": { - "$id": "141", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "138" - }, - "decorators": [] - }, - { - "$id": "142", - "kind": "enumvalue", - "name": "audio", - "value": "audio", - "valueType": { - "$id": "143", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "138" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "144", - "kind": "enum", - "name": "ChatOutputPredictionType", - "crossLanguageDefinitionId": "ChatOutputPrediction.type.anonymous", - "valueType": { - "$id": "145", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "146", - "kind": "enumvalue", - "name": "content", - "value": "content", - "valueType": { - "$id": "147", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "144" - }, - "decorators": [] - } - ], - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "148", - "kind": "enum", - "name": "AzureCreateChatCompletionRequestAudioVoice", - "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.audio.voice.anonymous", - "valueType": { - "$id": "149", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "150", - "kind": "enumvalue", - "name": "alloy", - "value": "alloy", - "valueType": { - "$id": "151", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "148" - }, - "decorators": [] - }, - { - "$id": "152", - "kind": "enumvalue", - "name": "ash", - "value": "ash", - "valueType": { - "$id": "153", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "148" - }, - "decorators": [] - }, - { - "$id": "154", - "kind": "enumvalue", - "name": "ballad", - "value": "ballad", - "valueType": { - "$id": "155", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "148" - }, - "decorators": [] - }, - { - "$id": "156", - "kind": "enumvalue", - "name": "coral", - "value": "coral", - "valueType": { - "$id": "157", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "148" - }, - "decorators": [] - }, - { - "$id": "158", - "kind": "enumvalue", - "name": "echo", - "value": "echo", - "valueType": { - "$id": "159", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "148" - }, - "decorators": [] - }, - { - "$id": "160", - "kind": "enumvalue", - "name": "sage", - "value": "sage", - "valueType": { - "$id": "161", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "148" - }, - "decorators": [] - }, - { - "$id": "162", - "kind": "enumvalue", - "name": "shimmer", - "value": "shimmer", - "valueType": { - "$id": "163", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "148" - }, - "decorators": [] - }, - { - "$id": "164", - "kind": "enumvalue", - "name": "verse", - "value": "verse", - "valueType": { - "$id": "165", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "148" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "166", - "kind": "enum", - "name": "AzureCreateChatCompletionRequestAudioFormat", - "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.audio.format.anonymous", - "valueType": { - "$id": "167", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "168", - "kind": "enumvalue", - "name": "wav", - "value": "wav", - "valueType": { - "$id": "169", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "166" - }, - "decorators": [] - }, - { - "$id": "170", - "kind": "enumvalue", - "name": "mp3", - "value": "mp3", - "valueType": { - "$id": "171", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "166" - }, - "decorators": [] - }, - { - "$id": "172", - "kind": "enumvalue", - "name": "flac", - "value": "flac", - "valueType": { - "$id": "173", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "166" - }, - "decorators": [] - }, - { - "$id": "174", - "kind": "enumvalue", - "name": "opus", - "value": "opus", - "valueType": { - "$id": "175", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "166" - }, - "decorators": [] - }, - { - "$id": "176", - "kind": "enumvalue", - "name": "pcm16", - "value": "pcm16", - "valueType": { - "$id": "177", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "166" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "178", - "kind": "enum", - "name": "ChatCompletionTool_type", - "valueType": { - "$id": "179", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "180", - "kind": "enumvalue", - "name": "function", - "value": "function", - "description": "function", - "valueType": { - "$ref": "179" - }, - "enumType": { - "$ref": "178" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The ChatCompletionTool_type", - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "181", - "kind": "enum", - "name": "AzureCreateChatCompletionRequestToolChoice", - "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.tool_choice.anonymous", - "valueType": { - "$id": "182", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "183", - "kind": "enumvalue", - "name": "none", - "value": "none", - "valueType": { - "$id": "184", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "181" - }, - "decorators": [] - }, - { - "$id": "185", - "kind": "enumvalue", - "name": "auto", - "value": "auto", - "valueType": { - "$id": "186", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "181" - }, - "decorators": [] - }, - { - "$id": "187", - "kind": "enumvalue", - "name": "required", - "value": "required", - "valueType": { - "$id": "188", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "181" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "189", - "kind": "enum", - "name": "ChatCompletionNamedToolChoice_type", - "valueType": { - "$id": "190", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "191", - "kind": "enumvalue", - "name": "function", - "value": "function", - "description": "function", - "valueType": { - "$ref": "190" - }, - "enumType": { - "$ref": "189" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The ChatCompletionNamedToolChoice_type", - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "192", - "kind": "enum", - "name": "CreateImageRequestModel", - "crossLanguageDefinitionId": "CreateImageRequest.model.anonymous", - "valueType": { - "$id": "193", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "194", - "kind": "enumvalue", - "name": "dall-e-2", - "value": "dall-e-2", - "valueType": { - "$id": "195", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "192" - }, - "decorators": [] - }, - { - "$id": "196", - "kind": "enumvalue", - "name": "dall-e-3", - "value": "dall-e-3", - "valueType": { - "$id": "197", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "192" - }, - "decorators": [] - } - ], - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "198", - "kind": "enum", - "name": "CreateImageRequestQuality", - "crossLanguageDefinitionId": "CreateImageRequest.quality.anonymous", - "valueType": { - "$id": "199", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "200", - "kind": "enumvalue", - "name": "standard", - "value": "standard", - "valueType": { - "$id": "201", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "198" - }, - "decorators": [] - }, - { - "$id": "202", - "kind": "enumvalue", - "name": "hd", - "value": "hd", - "valueType": { - "$id": "203", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "198" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "204", - "kind": "enum", - "name": "CreateImageRequestResponseFormat", - "crossLanguageDefinitionId": "CreateImageRequest.response_format.anonymous", - "valueType": { - "$id": "205", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "206", - "kind": "enumvalue", - "name": "url", - "value": "url", - "valueType": { - "$id": "207", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "204" - }, - "decorators": [] - }, - { - "$id": "208", - "kind": "enumvalue", - "name": "b64_json", - "value": "b64_json", - "valueType": { - "$id": "209", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "204" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "210", - "kind": "enum", - "name": "CreateImageRequestSize", - "crossLanguageDefinitionId": "CreateImageRequest.size.anonymous", - "valueType": { - "$id": "211", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "212", - "kind": "enumvalue", - "name": "256x256", - "value": "256x256", - "valueType": { - "$id": "213", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "210" - }, - "decorators": [] - }, - { - "$id": "214", - "kind": "enumvalue", - "name": "512x512", - "value": "512x512", - "valueType": { - "$id": "215", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "210" - }, - "decorators": [] - }, - { - "$id": "216", - "kind": "enumvalue", - "name": "1024x1024", - "value": "1024x1024", - "valueType": { - "$id": "217", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "210" - }, - "decorators": [] - }, - { - "$id": "218", - "kind": "enumvalue", - "name": "1792x1024", - "value": "1792x1024", - "valueType": { - "$id": "219", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "210" - }, - "decorators": [] - }, - { - "$id": "220", - "kind": "enumvalue", - "name": "1024x1792", - "value": "1024x1792", - "valueType": { - "$id": "221", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "210" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "222", - "kind": "enum", - "name": "CreateImageRequestStyle", - "crossLanguageDefinitionId": "CreateImageRequest.style.anonymous", - "valueType": { - "$id": "223", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "224", - "kind": "enumvalue", - "name": "vivid", - "value": "vivid", - "valueType": { - "$id": "225", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "222" - }, - "decorators": [] - }, - { - "$id": "226", - "kind": "enumvalue", - "name": "natural", - "value": "natural", - "valueType": { - "$id": "227", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "222" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "228", - "kind": "enum", - "name": "CreateMessageRequestRole", - "crossLanguageDefinitionId": "CreateMessageRequest.role.anonymous", - "valueType": { - "$id": "229", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "230", - "kind": "enumvalue", - "name": "user", - "value": "user", - "valueType": { - "$id": "231", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "228" - }, - "decorators": [] - }, - { - "$id": "232", - "kind": "enumvalue", - "name": "assistant", - "value": "assistant", - "valueType": { - "$id": "233", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "228" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "234", - "kind": "enum", - "name": "FileSearchRankingOptionsRanker", - "crossLanguageDefinitionId": "FileSearchRankingOptions.ranker.anonymous", - "valueType": { - "$id": "235", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "236", - "kind": "enumvalue", - "name": "auto", - "value": "auto", - "valueType": { - "$id": "237", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "234" - }, - "decorators": [] - }, - { - "$id": "238", - "kind": "enumvalue", - "name": "default_2024_08_21", - "value": "default_2024_08_21", - "valueType": { - "$id": "239", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "234" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "240", - "kind": "enum", - "name": "AssistantToolsFileSearchTypeOnly_type", - "valueType": { - "$id": "241", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "242", - "kind": "enumvalue", - "name": "file_search", - "value": "file_search", - "description": "file_search", - "valueType": { - "$ref": "241" - }, - "enumType": { - "$ref": "240" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The AssistantToolsFileSearchTypeOnly_type", - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "243", - "kind": "enum", - "name": "MessageObject_object", - "valueType": { - "$id": "244", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "245", - "kind": "enumvalue", - "name": "thread.message", - "value": "thread.message", - "description": "thread.message", - "valueType": { - "$ref": "244" - }, - "enumType": { - "$ref": "243" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The MessageObject_object", - "isFixed": false, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "246", - "kind": "enum", - "name": "MessageObjectStatus", - "crossLanguageDefinitionId": "MessageObject.status.anonymous", - "valueType": { - "$id": "247", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "248", - "kind": "enumvalue", - "name": "in_progress", - "value": "in_progress", - "valueType": { - "$id": "249", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "246" - }, - "decorators": [] - }, - { - "$id": "250", - "kind": "enumvalue", - "name": "incomplete", - "value": "incomplete", - "valueType": { - "$id": "251", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "246" - }, - "decorators": [] - }, - { - "$id": "252", - "kind": "enumvalue", - "name": "completed", - "value": "completed", - "valueType": { - "$id": "253", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "246" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "254", - "kind": "enum", - "name": "MessageObjectIncompleteDetailsReason", - "crossLanguageDefinitionId": "MessageObject.incomplete_details.reason.anonymous", - "valueType": { - "$id": "255", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "256", - "kind": "enumvalue", - "name": "content_filter", - "value": "content_filter", - "valueType": { - "$id": "257", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "254" - }, - "decorators": [] - }, - { - "$id": "258", - "kind": "enumvalue", - "name": "max_tokens", - "value": "max_tokens", - "valueType": { - "$id": "259", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "254" - }, - "decorators": [] - }, - { - "$id": "260", - "kind": "enumvalue", - "name": "run_cancelled", - "value": "run_cancelled", - "valueType": { - "$id": "261", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "254" - }, - "decorators": [] - }, - { - "$id": "262", - "kind": "enumvalue", - "name": "run_expired", - "value": "run_expired", - "valueType": { - "$id": "263", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "254" - }, - "decorators": [] - }, - { - "$id": "264", - "kind": "enumvalue", - "name": "run_failed", - "value": "run_failed", - "valueType": { - "$id": "265", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "254" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "266", - "kind": "enum", - "name": "MessageObjectRole", - "crossLanguageDefinitionId": "MessageObject.role.anonymous", - "valueType": { - "$id": "267", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "268", - "kind": "enumvalue", - "name": "user", - "value": "user", - "valueType": { - "$id": "269", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "266" - }, - "decorators": [] - }, - { - "$id": "270", - "kind": "enumvalue", - "name": "assistant", - "value": "assistant", - "valueType": { - "$id": "271", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "266" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - } - ], - "Models": [ - { - "$id": "272", - "kind": "model", - "name": "MessageContent", - "crossLanguageDefinitionId": "OpenAI.MessageContent", - "access": "public", - "usage": "Input,Output", - "description": "Represents a single piece of content in an Assistants API message.", - "decorators": [], - "properties": [] - }, - { - "$id": "273", - "kind": "model", - "name": "ErrorResponse", - "crossLanguageDefinitionId": "OpenAI.ErrorResponse", - "usage": "Error", - "decorators": [], - "properties": [ - { - "$id": "274", - "kind": "property", - "name": "error", - "serializedName": "error", - "type": { - "$id": "275", - "kind": "model", - "name": "Error", - "crossLanguageDefinitionId": "OpenAI.Error", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "276", - "kind": "property", - "name": "code", - "serializedName": "code", - "type": { - "$id": "277", - "kind": "nullable", - "type": { - "$id": "278", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.Error.code" - }, - { - "$id": "279", - "kind": "property", - "name": "message", - "serializedName": "message", - "type": { - "$id": "280", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.Error.message" - }, - { - "$id": "281", - "kind": "property", - "name": "param", - "serializedName": "param", - "type": { - "$id": "282", - "kind": "nullable", - "type": { - "$id": "283", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.Error.param" - }, - { - "$id": "284", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "285", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.Error.type" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ErrorResponse.error" - } - ] - }, - { - "$ref": "275" - }, - { - "$id": "286", - "kind": "model", - "name": "Image", - "crossLanguageDefinitionId": "OpenAI.Image", - "usage": "Output", - "description": "Represents the url or the content of an image generated by the OpenAI API.", - "decorators": [], - "properties": [ - { - "$id": "287", - "kind": "property", - "name": "b64_json", - "serializedName": "b64_json", - "description": "The base64-encoded JSON of the generated image, if `response_format` is `b64_json`.", - "type": { - "$id": "288", - "kind": "bytes", - "name": "bytes", - "encode": "base64", - "crossLanguageDefinitionId": "TypeSpec.bytes", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.Image.b64_json" - }, - { - "$id": "289", - "kind": "property", - "name": "url", - "serializedName": "url", - "description": "The URL of the generated image, if `response_format` is `url` (default).", - "type": { - "$id": "290", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.Image.url" - }, - { - "$id": "291", - "kind": "property", - "name": "revised_prompt", - "serializedName": "revised_prompt", - "description": "The prompt that was used to generate the image, if there was any revision to the prompt.", - "type": { - "$id": "292", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.Image.revised_prompt" - } - ] - }, - { - "$id": "293", - "kind": "model", - "name": "AzureOpenAIDalleErrorResponse", - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleErrorResponse", - "access": "public", - "usage": "Output", - "description": "A structured representation of an error an Azure OpenAI request.", - "decorators": [], - "properties": [ - { - "$id": "294", - "kind": "property", - "name": "error", - "serializedName": "error", - "type": { - "$id": "295", - "kind": "model", - "name": "AzureOpenAIDalleError", - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError", - "access": "public", - "usage": "Output", - "description": "The structured representation of an error from an Azure OpenAI image generation request.", - "decorators": [], - "properties": [ - { - "$id": "296", - "kind": "property", - "name": "code", - "serializedName": "code", - "description": "The distinct, machine-generated identifier for the error.", - "type": { - "$id": "297", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.code" - }, - { - "$id": "298", - "kind": "property", - "name": "message", - "serializedName": "message", - "description": "A human-readable message associated with the error.", - "type": { - "$id": "299", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.message" - }, - { - "$id": "300", - "kind": "property", - "name": "param", - "serializedName": "param", - "description": "If applicable, the request input parameter associated with the error", - "type": { - "$id": "301", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.param" - }, - { - "$id": "302", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "If applicable, the input line number associated with the error.", - "type": { - "$id": "303", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.type" - }, - { - "$id": "304", - "kind": "property", - "name": "inner_error", - "serializedName": "inner_error", - "description": "If applicable, an upstream error that originated this error.", - "type": { - "$id": "305", - "kind": "model", - "name": "AzureOpenAIDalleErrorInnerError", - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error.anonymous", - "usage": "Output", - "decorators": [], - "properties": [ - { - "$id": "306", - "kind": "property", - "name": "code", - "serializedName": "code", - "description": "The code associated with the inner error.", - "type": { - "$id": "307", - "kind": "constant", - "valueType": { - "$ref": "2" - }, - "value": "ResponsibleAIPolicyViolation", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error.anonymous.code" - }, - { - "$id": "308", - "kind": "property", - "name": "revised_prompt", - "serializedName": "revised_prompt", - "description": "If applicable, the modified prompt used for generation.", - "type": { - "$id": "309", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error.anonymous.revised_prompt" - }, - { - "$id": "310", - "kind": "property", - "name": "content_filter_results", - "serializedName": "content_filter_results", - "description": "The content filter result details associated with the inner error.", - "type": { - "$id": "311", - "kind": "model", - "name": "AzureContentFilterImagePromptResults", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImagePromptResults", - "usage": "Output", - "description": "A content filter result for an image generation operation's input request content.", - "decorators": [], - "baseModel": { - "$id": "312", - "kind": "model", - "name": "AzureContentFilterImageResponseResults", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults", - "usage": "Output", - "description": "A content filter result for an image generation operation's output response content.", - "decorators": [], - "properties": [ - { - "$id": "313", - "kind": "property", - "name": "sexual", - "serializedName": "sexual", - "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse.", - "type": { - "$id": "314", - "kind": "model", - "name": "AzureContentFilterSeverityResult", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterSeverityResult", - "usage": "Output", - "description": "A labeled content filter result item that indicates whether the content was filtered and what the qualitative\nseverity level of the content was, as evaluated against content filter configuration for the category.", - "decorators": [], - "properties": [ - { - "$id": "315", - "kind": "property", - "name": "filtered", - "serializedName": "filtered", - "description": "Whether the content severity resulted in a content filtering action.", - "type": { - "$id": "316", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterSeverityResult.filtered" - }, - { - "$id": "317", - "kind": "property", - "name": "severity", - "serializedName": "severity", - "description": "The labeled severity of the content.", - "type": { - "$ref": "5" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterSeverityResult.severity" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults.sexual" - }, - { - "$id": "318", - "kind": "property", - "name": "violence", - "serializedName": "violence", - "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on.", - "type": { - "$ref": "314" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults.violence" - }, - { - "$id": "319", - "kind": "property", - "name": "hate", - "serializedName": "hate", - "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size.", - "type": { - "$ref": "314" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults.hate" - }, - { - "$id": "320", - "kind": "property", - "name": "self_harm", - "serializedName": "self_harm", - "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself.", - "type": { - "$ref": "314" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults.self_harm" - } - ] - }, - "properties": [ - { - "$id": "321", - "kind": "property", - "name": "profanity", - "serializedName": "profanity", - "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent.", - "type": { - "$id": "322", - "kind": "model", - "name": "AzureContentFilterDetectionResult", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterDetectionResult", - "usage": "Output", - "description": "A labeled content filter result item that indicates whether the content was detected and whether the content was\nfiltered.", - "decorators": [], - "properties": [ - { - "$id": "323", - "kind": "property", - "name": "filtered", - "serializedName": "filtered", - "description": "Whether the content detection resulted in a content filtering action.", - "type": { - "$id": "324", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterDetectionResult.filtered" - }, - { - "$id": "325", - "kind": "property", - "name": "detected", - "serializedName": "detected", - "description": "Whether the labeled content category was detected in the content.", - "type": { - "$id": "326", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterDetectionResult.detected" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImagePromptResults.profanity" - }, - { - "$id": "327", - "kind": "property", - "name": "custom_blocklists", - "serializedName": "custom_blocklists", - "description": "A collection of binary filtering outcomes for configured custom blocklists.", - "type": { - "$id": "328", - "kind": "model", - "name": "AzureContentFilterBlocklistResult", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult", - "access": "public", - "usage": "Output", - "description": "A collection of true/false filtering results for configured custom blocklists.", - "decorators": [], - "properties": [ - { - "$id": "329", - "kind": "property", - "name": "filtered", - "serializedName": "filtered", - "description": "A value indicating whether any of the detailed blocklists resulted in a filtering action.", - "type": { - "$id": "330", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.filtered" - }, - { - "$id": "331", - "kind": "property", - "name": "details", - "serializedName": "details", - "description": "The pairs of individual blocklist IDs and whether they resulted in a filtering action.", - "type": { - "$id": "332", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "333", - "kind": "model", - "name": "AzureContentFilterBlocklistResultDetail", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.detail.anonymous", - "usage": "Output", - "decorators": [], - "properties": [ - { - "$id": "334", - "kind": "property", - "name": "filtered", - "serializedName": "filtered", - "description": "A value indicating whether the blocklist produced a filtering action.", - "type": { - "$id": "335", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.detail.anonymous.filtered" - }, - { - "$id": "336", - "kind": "property", - "name": "id", - "serializedName": "id", - "description": "The ID of the custom blocklist evaluated.", - "type": { - "$id": "337", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.detail.anonymous.id" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.details" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImagePromptResults.custom_blocklists" - }, - { - "$id": "338", - "kind": "property", - "name": "jailbreak", - "serializedName": "jailbreak", - "description": "A detection result that describes user prompt injection attacks, where malicious users deliberately exploit\nsystem vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content\ngeneration or violations of system-imposed restrictions.", - "type": { - "$ref": "322" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImagePromptResults.jailbreak" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error.anonymous.content_filter_results" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleErrorResponse.error" - } - ] - }, - { - "$ref": "295" - }, - { - "$ref": "305" - }, - { - "$ref": "311" - }, - { - "$ref": "322" - }, - { - "$ref": "328" - }, - { - "$ref": "333" - }, - { - "$ref": "312" - }, - { - "$ref": "314" - }, - { - "$id": "339", - "kind": "model", - "name": "AzureChatDataSource", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSource", - "access": "public", - "usage": "Input", - "description": "A representation of configuration data for a single Azure OpenAI chat data source.\nThis will be used by a chat completions request that should use Azure OpenAI chat extensions to augment the\nresponse behavior.\nThe use of this configuration is compatible only with Azure OpenAI.", - "decorators": [], - "discriminatorProperty": { - "$id": "340", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The differentiating type identifier for the data source.", - "type": { - "$id": "341", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSource.type" - }, - "properties": [ - { - "$ref": "340" - } - ], - "discriminatedSubtypes": { - "$id": "342", - "azure_search": { - "$id": "343", - "kind": "model", - "name": "AzureSearchChatDataSource", - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource", - "access": "public", - "usage": "Input", - "description": "Represents a data source configuration that will use an Azure Search resource.", - "discriminatorValue": "azure_search", - "decorators": [], - "baseModel": { - "$ref": "339" - }, - "properties": [ - { - "$id": "344", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The discriminated type identifier, which is always 'azure_search'.", - "type": { - "$id": "345", - "kind": "constant", - "valueType": { - "$id": "346", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "azure_search", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.type" - }, - { - "$id": "347", - "kind": "property", - "name": "parameters", - "serializedName": "parameters", - "description": "The parameter information to control the use of the Azure Search data source.", - "type": { - "$id": "348", - "kind": "model", - "name": "AzureSearchChatDataSourceParameters", - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous", - "usage": "Input", - "decorators": [], - "properties": [ - { - "$id": "349", - "kind": "property", - "name": "top_n_documents", - "serializedName": "top_n_documents", - "description": "The configured number of documents to feature in the query.", - "type": { - "$id": "350", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.top_n_documents" - }, - { - "$id": "351", - "kind": "property", - "name": "in_scope", - "serializedName": "in_scope", - "description": "Whether queries should be restricted to use of the indexed data.", - "type": { - "$id": "352", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.in_scope" - }, - { - "$id": "353", - "kind": "property", - "name": "strictness", - "serializedName": "strictness", - "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", - "type": { - "$id": "354", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.strictness" - }, - { - "$id": "355", - "kind": "property", - "name": "max_search_queries", - "serializedName": "max_search_queries", - "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", - "type": { - "$id": "356", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.max_search_queries" - }, - { - "$id": "357", - "kind": "property", - "name": "allow_partial_result", - "serializedName": "allow_partial_result", - "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", - "type": { - "$id": "358", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.allow_partial_result" - }, - { - "$id": "359", - "kind": "property", - "name": "include_contexts", - "serializedName": "include_contexts", - "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", - "type": { - "$id": "360", - "kind": "array", - "name": "Array", - "valueType": { - "$ref": "15" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.include_contexts" - }, - { - "$id": "361", - "kind": "property", - "name": "endpoint", - "serializedName": "endpoint", - "description": "The absolute endpoint path for the Azure Search resource to use.", - "type": { - "$id": "362", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.endpoint" - }, - { - "$id": "363", - "kind": "property", - "name": "index_name", - "serializedName": "index_name", - "description": "The name of the index to use, as specified in the Azure Search resource.", - "type": { - "$id": "364", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.index_name" - }, - { - "$id": "365", - "kind": "property", - "name": "authentication", - "serializedName": "authentication", - "description": "The authentication mechanism to use with Azure Search.", - "type": { - "$id": "366", - "kind": "union", - "name": "AzureSearchChatDataSourceParametersAuthentication", - "variantTypes": [ - { - "$id": "367", - "kind": "model", - "name": "AzureChatDataSourceApiKeyAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceApiKeyAuthenticationOptions", - "usage": "Input", - "discriminatorValue": "api_key", - "decorators": [], - "baseModel": { - "$id": "368", - "kind": "model", - "name": "AzureChatDataSourceAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAuthenticationOptions", - "usage": "Input", - "decorators": [], - "discriminatorProperty": { - "$id": "369", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "370", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAuthenticationOptions.type" - }, - "properties": [ - { - "$ref": "369" - } - ], - "discriminatedSubtypes": { - "$id": "371", - "api_key": { - "$ref": "367" - }, - "connection_string": { - "$id": "372", - "kind": "model", - "name": "AzureChatDataSourceConnectionStringAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceConnectionStringAuthenticationOptions", - "usage": "Input", - "discriminatorValue": "connection_string", - "decorators": [], - "baseModel": { - "$ref": "368" - }, - "properties": [ - { - "$id": "373", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "374", - "kind": "constant", - "valueType": { - "$id": "375", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "connection_string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceConnectionStringAuthenticationOptions.type" - }, - { - "$id": "376", - "kind": "property", - "name": "connection_string", - "serializedName": "connection_string", - "type": { - "$id": "377", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceConnectionStringAuthenticationOptions.connection_string" - } - ] - }, - "system_assigned_managed_identity": { - "$id": "378", - "kind": "model", - "name": "AzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions", - "usage": "Input", - "discriminatorValue": "system_assigned_managed_identity", - "decorators": [], - "baseModel": { - "$ref": "368" - }, - "properties": [ - { - "$id": "379", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "380", - "kind": "constant", - "valueType": { - "$id": "381", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "system_assigned_managed_identity", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.type" - } - ] - }, - "user_assigned_managed_identity": { - "$id": "382", - "kind": "model", - "name": "AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions", - "usage": "Input", - "discriminatorValue": "user_assigned_managed_identity", - "decorators": [], - "baseModel": { - "$ref": "368" - }, - "properties": [ - { - "$id": "383", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "384", - "kind": "constant", - "valueType": { - "$id": "385", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "user_assigned_managed_identity", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.type" - }, - { - "$id": "386", - "kind": "property", - "name": "managed_identity_resource_id", - "serializedName": "managed_identity_resource_id", - "type": { - "$id": "387", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.managed_identity_resource_id" - } - ] - }, - "key_and_key_id": { - "$id": "388", - "kind": "model", - "name": "AzureChatDataSourceKeyAndKeyIdAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceKeyAndKeyIdAuthenticationOptions", - "usage": "Input", - "discriminatorValue": "key_and_key_id", - "decorators": [], - "baseModel": { - "$ref": "368" - }, - "properties": [ - { - "$id": "389", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "390", - "kind": "constant", - "valueType": { - "$id": "391", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "key_and_key_id", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceKeyAndKeyIdAuthenticationOptions.type" - }, - { - "$id": "392", - "kind": "property", - "name": "key", - "serializedName": "key", - "type": { - "$id": "393", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceKeyAndKeyIdAuthenticationOptions.key" - }, - { - "$id": "394", - "kind": "property", - "name": "key_id", - "serializedName": "key_id", - "type": { - "$id": "395", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceKeyAndKeyIdAuthenticationOptions.key_id" - } - ] - }, - "encoded_api_key": { - "$id": "396", - "kind": "model", - "name": "AzureChatDataSourceEncodedApiKeyAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEncodedApiKeyAuthenticationOptions", - "usage": "Input", - "discriminatorValue": "encoded_api_key", - "decorators": [], - "baseModel": { - "$ref": "368" - }, - "properties": [ - { - "$id": "397", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "398", - "kind": "constant", - "valueType": { - "$id": "399", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "encoded_api_key", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEncodedApiKeyAuthenticationOptions.type" - }, - { - "$id": "400", - "kind": "property", - "name": "encoded_api_key", - "serializedName": "encoded_api_key", - "type": { - "$id": "401", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEncodedApiKeyAuthenticationOptions.encoded_api_key" - } - ] - }, - "access_token": { - "$id": "402", - "kind": "model", - "name": "AzureChatDataSourceAccessTokenAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAccessTokenAuthenticationOptions", - "usage": "Input", - "discriminatorValue": "access_token", - "decorators": [], - "baseModel": { - "$ref": "368" - }, - "properties": [ - { - "$id": "403", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "404", - "kind": "constant", - "valueType": { - "$id": "405", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "access_token", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAccessTokenAuthenticationOptions.type" - }, - { - "$id": "406", - "kind": "property", - "name": "access_token", - "serializedName": "access_token", - "type": { - "$id": "407", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAccessTokenAuthenticationOptions.access_token" - } - ] - }, - "username_and_password": { - "$id": "408", - "kind": "model", - "name": "AzureChatDataSourceUsernameAndPasswordAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUsernameAndPasswordAuthenticationOptions", - "usage": "Input", - "discriminatorValue": "username_and_password", - "decorators": [], - "baseModel": { - "$ref": "368" - }, - "properties": [ - { - "$id": "409", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "410", - "kind": "constant", - "valueType": { - "$id": "411", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "username_and_password", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUsernameAndPasswordAuthenticationOptions.type" - }, - { - "$id": "412", - "kind": "property", - "name": "username", - "serializedName": "username", - "type": { - "$id": "413", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUsernameAndPasswordAuthenticationOptions.username" - }, - { - "$id": "414", - "kind": "property", - "name": "password", - "serializedName": "password", - "type": { - "$id": "415", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUsernameAndPasswordAuthenticationOptions.password" - } - ] - } - } - }, - "properties": [ - { - "$id": "416", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "417", - "kind": "constant", - "valueType": { - "$id": "418", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "api_key", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceApiKeyAuthenticationOptions.type" - }, - { - "$id": "419", - "kind": "property", - "name": "key", - "serializedName": "key", - "type": { - "$id": "420", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceApiKeyAuthenticationOptions.key" - } - ] - }, - { - "$ref": "378" - }, - { - "$ref": "382" - }, - { - "$ref": "402" - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.authentication" - }, - { - "$id": "421", - "kind": "property", - "name": "fields_mapping", - "serializedName": "fields_mapping", - "description": "The field mappings to use with the Azure Search resource.", - "type": { - "$id": "422", - "kind": "model", - "name": "AzureSearchChatDataSourceParametersFieldsMapping", - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous", - "usage": "Input", - "decorators": [], - "properties": [ - { - "$id": "423", - "kind": "property", - "name": "title_field", - "serializedName": "title_field", - "description": "The name of the index field to use as a title.", - "type": { - "$id": "424", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.title_field" - }, - { - "$id": "425", - "kind": "property", - "name": "url_field", - "serializedName": "url_field", - "description": "The name of the index field to use as a URL.", - "type": { - "$id": "426", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.url_field" - }, - { - "$id": "427", - "kind": "property", - "name": "filepath_field", - "serializedName": "filepath_field", - "description": "The name of the index field to use as a filepath.", - "type": { - "$id": "428", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.filepath_field" - }, - { - "$id": "429", - "kind": "property", - "name": "content_fields", - "serializedName": "content_fields", - "description": "The names of index fields that should be treated as content.", - "type": { - "$id": "430", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "431", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.content_fields" - }, - { - "$id": "432", - "kind": "property", - "name": "content_fields_separator", - "serializedName": "content_fields_separator", - "description": "The separator pattern that content fields should use.", - "type": { - "$id": "433", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" - }, - { - "$id": "434", - "kind": "property", - "name": "vector_fields", - "serializedName": "vector_fields", - "description": "The names of fields that represent vector data.", - "type": { - "$id": "435", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "436", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.vector_fields" - }, - { - "$id": "437", - "kind": "property", - "name": "image_vector_fields", - "serializedName": "image_vector_fields", - "description": "The names of fields that represent image vector data.", - "type": { - "$id": "438", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "439", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.image_vector_fields" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.fields_mapping" - }, - { - "$id": "440", - "kind": "property", - "name": "query_type", - "serializedName": "query_type", - "description": "The query type for the Azure Search resource to use.", - "type": { - "$ref": "23" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.query_type" - }, - { - "$id": "441", - "kind": "property", - "name": "semantic_configuration", - "serializedName": "semantic_configuration", - "description": "Additional semantic configuration for the query.", - "type": { - "$id": "442", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.semantic_configuration" - }, - { - "$id": "443", - "kind": "property", - "name": "filter", - "serializedName": "filter", - "description": "A filter to apply to the search.", - "type": { - "$id": "444", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.filter" - }, - { - "$id": "445", - "kind": "property", - "name": "embedding_dependency", - "serializedName": "embedding_dependency", - "description": "The vectorization source to use with Azure Search.\nSupported sources for Azure Search include endpoint, deployment name, and integrated.", - "type": { - "$id": "446", - "kind": "model", - "name": "AzureChatDataSourceVectorizationSource", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceVectorizationSource", - "access": "public", - "usage": "Input", - "description": "A representation of a data vectorization source usable as an embedding resource with a data source.", - "decorators": [], - "discriminatorProperty": { - "$id": "447", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The differentiating identifier for the concrete vectorization source.", - "type": { - "$id": "448", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceVectorizationSource.type" - }, - "properties": [ - { - "$ref": "447" - } - ], - "discriminatedSubtypes": { - "$id": "449", - "endpoint": { - "$id": "450", - "kind": "model", - "name": "AzureChatDataSourceEndpointVectorizationSource", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource", - "access": "public", - "usage": "Input", - "description": "Represents a vectorization source that makes public service calls against an Azure OpenAI embedding model deployment.", - "discriminatorValue": "endpoint", - "decorators": [], - "baseModel": { - "$ref": "446" - }, - "properties": [ - { - "$id": "451", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type identifier, always 'endpoint' for this vectorization source type.", - "type": { - "$id": "452", - "kind": "constant", - "valueType": { - "$id": "453", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "endpoint", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource.type" - }, - { - "$id": "454", - "kind": "property", - "name": "endpoint", - "serializedName": "endpoint", - "description": "Specifies the resource endpoint URL from which embeddings should be retrieved.\nIt should be in the format of:\nhttps://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings.\nThe api-version query parameter is not allowed.", - "type": { - "$id": "455", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource.endpoint" - }, - { - "$id": "456", - "kind": "property", - "name": "authentication", - "serializedName": "authentication", - "description": "The authentication mechanism to use with the endpoint-based vectorization source.\nEndpoint authentication supports API key and access token mechanisms.", - "type": { - "$id": "457", - "kind": "union", - "name": "AzureChatDataSourceEndpointVectorizationSourceAuthentication", - "variantTypes": [ - { - "$ref": "367" - }, - { - "$ref": "402" - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource.authentication" - }, - { - "$id": "458", - "kind": "property", - "name": "dimensions", - "serializedName": "dimensions", - "description": "The number of dimensions to request on embeddings.\nOnly supported in 'text-embedding-3' and later models.", - "type": { - "$id": "459", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource.dimensions" - } - ] - }, - "deployment_name": { - "$id": "460", - "kind": "model", - "name": "AzureChatDataSourceDeploymentNameVectorizationSource", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceDeploymentNameVectorizationSource", - "access": "public", - "usage": "Input", - "description": "Represents a vectorization source that makes internal service calls against an Azure OpenAI embedding model\ndeployment. In contrast with the endpoint-based vectorization source, a deployment-name-based vectorization source\nmust be part of the same Azure OpenAI resource but can be used even in private networks.", - "discriminatorValue": "deployment_name", - "decorators": [], - "baseModel": { - "$ref": "446" - }, - "properties": [ - { - "$id": "461", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type identifier, always 'deployment_name' for this vectorization source type.", - "type": { - "$id": "462", - "kind": "constant", - "valueType": { - "$id": "463", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "deployment_name", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceDeploymentNameVectorizationSource.type" - }, - { - "$id": "464", - "kind": "property", - "name": "deployment_name", - "serializedName": "deployment_name", - "description": "The embedding model deployment to use for vectorization. This deployment must exist within the same Azure OpenAI\nresource as the model deployment being used for chat completions.", - "type": { - "$id": "465", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceDeploymentNameVectorizationSource.deployment_name" - }, - { - "$id": "466", - "kind": "property", - "name": "dimensions", - "serializedName": "dimensions", - "description": "The number of dimensions to request on embeddings.\nOnly supported in 'text-embedding-3' and later models.", - "type": { - "$id": "467", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceDeploymentNameVectorizationSource.dimensions" - } - ] - }, - "model_id": { - "$id": "468", - "kind": "model", - "name": "AzureChatDataSourceModelIdVectorizationSource", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceModelIdVectorizationSource", - "access": "public", - "usage": "Input", - "description": "Represents a vectorization source that makes service calls based on a search service model ID.\nThis source type is currently only supported by Elasticsearch.", - "discriminatorValue": "model_id", - "decorators": [], - "baseModel": { - "$ref": "446" - }, - "properties": [ - { - "$id": "469", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type identifier, always 'model_id' for this vectorization source type.", - "type": { - "$id": "470", - "kind": "constant", - "valueType": { - "$id": "471", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "model_id", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceModelIdVectorizationSource.type" - }, - { - "$id": "472", - "kind": "property", - "name": "model_id", - "serializedName": "model_id", - "description": "The embedding model build ID to use for vectorization.", - "type": { - "$id": "473", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceModelIdVectorizationSource.model_id" - } - ] - }, - "integrated": { - "$id": "474", - "kind": "model", - "name": "AzureChatDataSourceIntegratedVectorizationSource", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceIntegratedVectorizationSource", - "usage": "Input", - "description": "Represents an integrated vectorization source as defined within the supporting search resource.", - "discriminatorValue": "integrated", - "decorators": [], - "baseModel": { - "$ref": "446" - }, - "properties": [ - { - "$id": "475", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type identifier, always 'integrated' for this vectorization source type.", - "type": { - "$id": "476", - "kind": "constant", - "valueType": { - "$id": "477", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "integrated", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceIntegratedVectorizationSource.type" - } - ] - } - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.embedding_dependency" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters" - } - ] - }, - "azure_cosmos_db": { - "$id": "478", - "kind": "model", - "name": "AzureCosmosDBChatDataSource", - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource", - "access": "public", - "usage": "Input", - "description": "Represents a data source configuration that will use an Azure CosmosDB resource.", - "discriminatorValue": "azure_cosmos_db", - "decorators": [], - "baseModel": { - "$ref": "339" - }, - "properties": [ - { - "$id": "479", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The discriminated type identifier, which is always 'azure_cosmos_db'.", - "type": { - "$id": "480", - "kind": "constant", - "valueType": { - "$id": "481", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "azure_cosmos_db", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.type" - }, - { - "$id": "482", - "kind": "property", - "name": "parameters", - "serializedName": "parameters", - "description": "The parameter information to control the use of the Azure CosmosDB data source.", - "type": { - "$id": "483", - "kind": "model", - "name": "AzureCosmosDBChatDataSourceParameters", - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous", - "usage": "Input", - "decorators": [], - "properties": [ - { - "$id": "484", - "kind": "property", - "name": "top_n_documents", - "serializedName": "top_n_documents", - "description": "The configured number of documents to feature in the query.", - "type": { - "$id": "485", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.top_n_documents" - }, - { - "$id": "486", - "kind": "property", - "name": "in_scope", - "serializedName": "in_scope", - "description": "Whether queries should be restricted to use of the indexed data.", - "type": { - "$id": "487", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.in_scope" - }, - { - "$id": "488", - "kind": "property", - "name": "strictness", - "serializedName": "strictness", - "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", - "type": { - "$id": "489", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.strictness" - }, - { - "$id": "490", - "kind": "property", - "name": "max_search_queries", - "serializedName": "max_search_queries", - "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", - "type": { - "$id": "491", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.max_search_queries" - }, - { - "$id": "492", - "kind": "property", - "name": "allow_partial_result", - "serializedName": "allow_partial_result", - "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", - "type": { - "$id": "493", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.allow_partial_result" - }, - { - "$id": "494", - "kind": "property", - "name": "include_contexts", - "serializedName": "include_contexts", - "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", - "type": { - "$id": "495", - "kind": "array", - "name": "Array", - "valueType": { - "$ref": "15" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.include_contexts" - }, - { - "$id": "496", - "kind": "property", - "name": "container_name", - "serializedName": "container_name", - "type": { - "$id": "497", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.container_name" - }, - { - "$id": "498", - "kind": "property", - "name": "database_name", - "serializedName": "database_name", - "type": { - "$id": "499", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.database_name" - }, - { - "$id": "500", - "kind": "property", - "name": "embedding_dependency", - "serializedName": "embedding_dependency", - "type": { - "$ref": "446" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.embedding_dependency" - }, - { - "$id": "501", - "kind": "property", - "name": "index_name", - "serializedName": "index_name", - "type": { - "$id": "502", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.index_name" - }, - { - "$id": "503", - "kind": "property", - "name": "authentication", - "serializedName": "authentication", - "type": { - "$ref": "372" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.authentication" - }, - { - "$id": "504", - "kind": "property", - "name": "fields_mapping", - "serializedName": "fields_mapping", - "type": { - "$id": "505", - "kind": "model", - "name": "AzureCosmosDBChatDataSourceParametersFieldsMapping", - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous", - "usage": "Input", - "decorators": [], - "properties": [ - { - "$id": "506", - "kind": "property", - "name": "content_fields", - "serializedName": "content_fields", - "type": { - "$id": "507", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "508", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.content_fields" - }, - { - "$id": "509", - "kind": "property", - "name": "vector_fields", - "serializedName": "vector_fields", - "type": { - "$id": "510", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "511", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.vector_fields" - }, - { - "$id": "512", - "kind": "property", - "name": "title_field", - "serializedName": "title_field", - "type": { - "$id": "513", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.title_field" - }, - { - "$id": "514", - "kind": "property", - "name": "url_field", - "serializedName": "url_field", - "type": { - "$id": "515", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.url_field" - }, - { - "$id": "516", - "kind": "property", - "name": "filepath_field", - "serializedName": "filepath_field", - "type": { - "$id": "517", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.filepath_field" - }, - { - "$id": "518", - "kind": "property", - "name": "content_fields_separator", - "serializedName": "content_fields_separator", - "type": { - "$id": "519", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.fields_mapping" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters" - } - ] - }, - "elasticsearch": { - "$id": "520", - "kind": "model", - "name": "ElasticsearchChatDataSource", - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource", - "access": "public", - "usage": "Input", - "discriminatorValue": "elasticsearch", - "decorators": [], - "baseModel": { - "$ref": "339" - }, - "properties": [ - { - "$id": "521", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The discriminated type identifier, which is always 'elasticsearch'.", - "type": { - "$id": "522", - "kind": "constant", - "valueType": { - "$id": "523", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "elasticsearch", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.type" - }, - { - "$id": "524", - "kind": "property", - "name": "parameters", - "serializedName": "parameters", - "description": "The parameter information to control the use of the Elasticsearch data source.", - "type": { - "$id": "525", - "kind": "model", - "name": "ElasticsearchChatDataSourceParameters", - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous", - "usage": "Input", - "decorators": [], - "properties": [ - { - "$id": "526", - "kind": "property", - "name": "top_n_documents", - "serializedName": "top_n_documents", - "description": "The configured number of documents to feature in the query.", - "type": { - "$id": "527", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.top_n_documents" - }, - { - "$id": "528", - "kind": "property", - "name": "in_scope", - "serializedName": "in_scope", - "description": "Whether queries should be restricted to use of the indexed data.", - "type": { - "$id": "529", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.in_scope" - }, - { - "$id": "530", - "kind": "property", - "name": "strictness", - "serializedName": "strictness", - "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", - "type": { - "$id": "531", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.strictness" - }, - { - "$id": "532", - "kind": "property", - "name": "max_search_queries", - "serializedName": "max_search_queries", - "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", - "type": { - "$id": "533", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.max_search_queries" - }, - { - "$id": "534", - "kind": "property", - "name": "allow_partial_result", - "serializedName": "allow_partial_result", - "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", - "type": { - "$id": "535", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.allow_partial_result" - }, - { - "$id": "536", - "kind": "property", - "name": "include_contexts", - "serializedName": "include_contexts", - "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", - "type": { - "$id": "537", - "kind": "array", - "name": "Array", - "valueType": { - "$ref": "15" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.include_contexts" - }, - { - "$id": "538", - "kind": "property", - "name": "endpoint", - "serializedName": "endpoint", - "type": { - "$id": "539", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.endpoint" - }, - { - "$id": "540", - "kind": "property", - "name": "index_name", - "serializedName": "index_name", - "type": { - "$id": "541", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.index_name" - }, - { - "$id": "542", - "kind": "property", - "name": "authentication", - "serializedName": "authentication", - "type": { - "$id": "543", - "kind": "union", - "name": "ElasticsearchChatDataSourceParametersAuthentication", - "variantTypes": [ - { - "$ref": "388" - }, - { - "$ref": "396" - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.authentication" - }, - { - "$id": "544", - "kind": "property", - "name": "fields_mapping", - "serializedName": "fields_mapping", - "type": { - "$id": "545", - "kind": "model", - "name": "ElasticsearchChatDataSourceParametersFieldsMapping", - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous", - "usage": "Input", - "decorators": [], - "properties": [ - { - "$id": "546", - "kind": "property", - "name": "title_field", - "serializedName": "title_field", - "type": { - "$id": "547", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.title_field" - }, - { - "$id": "548", - "kind": "property", - "name": "url_field", - "serializedName": "url_field", - "type": { - "$id": "549", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.url_field" - }, - { - "$id": "550", - "kind": "property", - "name": "filepath_field", - "serializedName": "filepath_field", - "type": { - "$id": "551", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.filepath_field" - }, - { - "$id": "552", - "kind": "property", - "name": "content_fields", - "serializedName": "content_fields", - "type": { - "$id": "553", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "554", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.content_fields" - }, - { - "$id": "555", - "kind": "property", - "name": "content_fields_separator", - "serializedName": "content_fields_separator", - "type": { - "$id": "556", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" - }, - { - "$id": "557", - "kind": "property", - "name": "vector_fields", - "serializedName": "vector_fields", - "type": { - "$id": "558", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "559", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.vector_fields" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.fields_mapping" - }, - { - "$id": "560", - "kind": "property", - "name": "query_type", - "serializedName": "query_type", - "type": { - "$ref": "35" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.query_type" - }, - { - "$id": "561", - "kind": "property", - "name": "embedding_dependency", - "serializedName": "embedding_dependency", - "type": { - "$ref": "446" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.embedding_dependency" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters" - } - ] - }, - "pinecone": { - "$id": "562", - "kind": "model", - "name": "PineconeChatDataSource", - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource", - "access": "public", - "usage": "Input", - "discriminatorValue": "pinecone", - "decorators": [], - "baseModel": { - "$ref": "339" - }, - "properties": [ - { - "$id": "563", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The discriminated type identifier, which is always 'pinecone'.", - "type": { - "$id": "564", - "kind": "constant", - "valueType": { - "$id": "565", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "pinecone", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.type" - }, - { - "$id": "566", - "kind": "property", - "name": "parameters", - "serializedName": "parameters", - "description": "The parameter information to control the use of the Pinecone data source.", - "type": { - "$id": "567", - "kind": "model", - "name": "PineconeChatDataSourceParameters", - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous", - "usage": "Input", - "decorators": [], - "properties": [ - { - "$id": "568", - "kind": "property", - "name": "top_n_documents", - "serializedName": "top_n_documents", - "description": "The configured number of documents to feature in the query.", - "type": { - "$id": "569", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.top_n_documents" - }, - { - "$id": "570", - "kind": "property", - "name": "in_scope", - "serializedName": "in_scope", - "description": "Whether queries should be restricted to use of the indexed data.", - "type": { - "$id": "571", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.in_scope" - }, - { - "$id": "572", - "kind": "property", - "name": "strictness", - "serializedName": "strictness", - "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", - "type": { - "$id": "573", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.strictness" - }, - { - "$id": "574", - "kind": "property", - "name": "max_search_queries", - "serializedName": "max_search_queries", - "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", - "type": { - "$id": "575", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.max_search_queries" - }, - { - "$id": "576", - "kind": "property", - "name": "allow_partial_result", - "serializedName": "allow_partial_result", - "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", - "type": { - "$id": "577", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.allow_partial_result" - }, - { - "$id": "578", - "kind": "property", - "name": "include_contexts", - "serializedName": "include_contexts", - "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", - "type": { - "$id": "579", - "kind": "array", - "name": "Array", - "valueType": { - "$ref": "15" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.include_contexts" - }, - { - "$id": "580", - "kind": "property", - "name": "environment", - "serializedName": "environment", - "description": "The environment name to use with Pinecone.", - "type": { - "$id": "581", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.environment" - }, - { - "$id": "582", - "kind": "property", - "name": "index_name", - "serializedName": "index_name", - "description": "The name of the Pinecone database index to use.", - "type": { - "$id": "583", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.index_name" - }, - { - "$id": "584", - "kind": "property", - "name": "authentication", - "serializedName": "authentication", - "description": "The authentication mechanism to use with Pinecone.\nSupported authentication mechanisms for Pinecone include: API key.", - "type": { - "$ref": "367" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.authentication" - }, - { - "$id": "585", - "kind": "property", - "name": "embedding_dependency", - "serializedName": "embedding_dependency", - "description": "The vectorization source to use as an embedding dependency for the Pinecone data source.\nSupported vectorization sources for Pinecone include: deployment name.", - "type": { - "$ref": "446" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.embedding_dependency" - }, - { - "$id": "586", - "kind": "property", - "name": "fields_mapping", - "serializedName": "fields_mapping", - "description": "Field mappings to apply to data used by the Pinecone data source.\nNote that content field mappings are required for Pinecone.", - "type": { - "$id": "587", - "kind": "model", - "name": "PineconeChatDataSourceParametersFieldsMapping", - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous", - "usage": "Input", - "decorators": [], - "properties": [ - { - "$id": "588", - "kind": "property", - "name": "content_fields", - "serializedName": "content_fields", - "type": { - "$id": "589", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "590", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.content_fields" - }, - { - "$id": "591", - "kind": "property", - "name": "title_field", - "serializedName": "title_field", - "type": { - "$id": "592", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.title_field" - }, - { - "$id": "593", - "kind": "property", - "name": "url_field", - "serializedName": "url_field", - "type": { - "$id": "594", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.url_field" - }, - { - "$id": "595", - "kind": "property", - "name": "filepath_field", - "serializedName": "filepath_field", - "type": { - "$id": "596", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.filepath_field" - }, - { - "$id": "597", - "kind": "property", - "name": "content_fields_separator", - "serializedName": "content_fields_separator", - "type": { - "$id": "598", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.fields_mapping" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters" - } - ] - }, - "mongo_db": { - "$id": "599", - "kind": "model", - "name": "MongoDBChatDataSource", - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource", - "usage": "Input", - "discriminatorValue": "mongo_db", - "decorators": [], - "baseModel": { - "$ref": "339" - }, - "properties": [ - { - "$id": "600", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The discriminated type identifier, which is always 'mongo_db'.", - "type": { - "$id": "601", - "kind": "constant", - "valueType": { - "$id": "602", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "mongo_db", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.type" - }, - { - "$id": "603", - "kind": "property", - "name": "parameters", - "serializedName": "parameters", - "description": "The parameter information to control the use of the MongoDB data source.", - "type": { - "$id": "604", - "kind": "model", - "name": "MongoDBChatDataSourceParameters", - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous", - "usage": "Input", - "decorators": [], - "properties": [ - { - "$id": "605", - "kind": "property", - "name": "top_n_documents", - "serializedName": "top_n_documents", - "description": "The configured number of documents to feature in the query.", - "type": { - "$id": "606", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.top_n_documents" - }, - { - "$id": "607", - "kind": "property", - "name": "in_scope", - "serializedName": "in_scope", - "description": "Whether queries should be restricted to use of the indexed data.", - "type": { - "$id": "608", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.in_scope" - }, - { - "$id": "609", - "kind": "property", - "name": "strictness", - "serializedName": "strictness", - "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", - "type": { - "$id": "610", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.strictness" - }, - { - "$id": "611", - "kind": "property", - "name": "max_search_queries", - "serializedName": "max_search_queries", - "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", - "type": { - "$id": "612", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.max_search_queries" - }, - { - "$id": "613", - "kind": "property", - "name": "allow_partial_result", - "serializedName": "allow_partial_result", - "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", - "type": { - "$id": "614", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.allow_partial_result" - }, - { - "$id": "615", - "kind": "property", - "name": "include_contexts", - "serializedName": "include_contexts", - "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", - "type": { - "$id": "616", - "kind": "array", - "name": "Array", - "valueType": { - "$ref": "15" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.include_contexts" - }, - { - "$id": "617", - "kind": "property", - "name": "endpoint", - "serializedName": "endpoint", - "description": "The name of the MongoDB cluster endpoint.", - "type": { - "$id": "618", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.endpoint" - }, - { - "$id": "619", - "kind": "property", - "name": "database_name", - "serializedName": "database_name", - "description": "The name of the MongoDB database.", - "type": { - "$id": "620", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.database_name" - }, - { - "$id": "621", - "kind": "property", - "name": "collection_name", - "serializedName": "collection_name", - "description": "The name of the MongoDB collection.", - "type": { - "$id": "622", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.collection_name" - }, - { - "$id": "623", - "kind": "property", - "name": "app_name", - "serializedName": "app_name", - "description": "The name of the MongoDB application.", - "type": { - "$id": "624", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.app_name" - }, - { - "$id": "625", - "kind": "property", - "name": "index_name", - "serializedName": "index_name", - "description": "The name of the MongoDB index.", - "type": { - "$id": "626", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.index_name" - }, - { - "$id": "627", - "kind": "property", - "name": "authentication", - "serializedName": "authentication", - "description": "The authentication mechanism to use with Pinecone.\nSupported authentication mechanisms for Pinecone include: username and password.", - "type": { - "$ref": "408" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.authentication" - }, - { - "$id": "628", - "kind": "property", - "name": "embedding_dependency", - "serializedName": "embedding_dependency", - "description": "The vectorization source to use as an embedding dependency for the MongoDB data source.\nSupported vectorization sources for MongoDB include: endpoint, deployment name.", - "type": { - "$id": "629", - "kind": "union", - "name": "MongoDBChatDataSourceParametersEmbeddingDependency", - "variantTypes": [ - { - "$ref": "450" - }, - { - "$ref": "460" - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.embedding_dependency" - }, - { - "$id": "630", - "kind": "property", - "name": "fields_mapping", - "serializedName": "fields_mapping", - "description": "Field mappings to apply to data used by the MongoDB data source.\nNote that content and vector field mappings are required for MongoDB.", - "type": { - "$id": "631", - "kind": "model", - "name": "MongoDBChatDataSourceParametersFieldsMapping", - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous", - "usage": "Input", - "decorators": [], - "properties": [ - { - "$id": "632", - "kind": "property", - "name": "content_fields", - "serializedName": "content_fields", - "type": { - "$id": "633", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "634", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.content_fields" - }, - { - "$id": "635", - "kind": "property", - "name": "vector_fields", - "serializedName": "vector_fields", - "type": { - "$id": "636", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "637", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.vector_fields" - }, - { - "$id": "638", - "kind": "property", - "name": "title_field", - "serializedName": "title_field", - "type": { - "$id": "639", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.title_field" - }, - { - "$id": "640", - "kind": "property", - "name": "url_field", - "serializedName": "url_field", - "type": { - "$id": "641", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.url_field" - }, - { - "$id": "642", - "kind": "property", - "name": "filepath_field", - "serializedName": "filepath_field", - "type": { - "$id": "643", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.filepath_field" - }, - { - "$id": "644", - "kind": "property", - "name": "content_fields_separator", - "serializedName": "content_fields_separator", - "type": { - "$id": "645", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.fields_mapping" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters" - } - ] - } - } - }, - { - "$ref": "343" - }, - { - "$ref": "348" - }, - { - "$ref": "367" - }, - { - "$ref": "368" - }, - { - "$ref": "372" - }, - { - "$ref": "378" - }, - { - "$ref": "382" - }, - { - "$ref": "388" - }, - { - "$ref": "396" - }, - { - "$ref": "402" - }, - { - "$ref": "408" - }, - { - "$ref": "422" - }, - { - "$ref": "446" - }, - { - "$ref": "450" - }, - { - "$ref": "460" - }, - { - "$ref": "468" - }, - { - "$ref": "474" - }, - { - "$ref": "478" - }, - { - "$ref": "483" - }, - { - "$ref": "505" - }, - { - "$ref": "520" - }, - { - "$ref": "525" - }, - { - "$ref": "545" - }, - { - "$ref": "562" - }, - { - "$ref": "567" - }, - { - "$ref": "587" - }, - { - "$ref": "599" - }, - { - "$ref": "604" - }, - { - "$ref": "631" - }, - { - "$id": "646", - "kind": "model", - "name": "AzureContentFilterResultForChoice", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice", - "access": "public", - "usage": "Output", - "description": "A content filter result for a single response item produced by a generative AI system.", - "decorators": [], - "properties": [ - { - "$id": "647", - "kind": "property", - "name": "sexual", - "serializedName": "sexual", - "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse.", - "type": { - "$ref": "314" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.sexual" - }, - { - "$id": "648", - "kind": "property", - "name": "hate", - "serializedName": "hate", - "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size.", - "type": { - "$ref": "314" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.hate" - }, - { - "$id": "649", - "kind": "property", - "name": "violence", - "serializedName": "violence", - "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on.", - "type": { - "$ref": "314" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.violence" - }, - { - "$id": "650", - "kind": "property", - "name": "self_harm", - "serializedName": "self_harm", - "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself.", - "type": { - "$ref": "314" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.self_harm" - }, - { - "$id": "651", - "kind": "property", - "name": "profanity", - "serializedName": "profanity", - "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent.", - "type": { - "$ref": "322" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.profanity" - }, - { - "$id": "652", - "kind": "property", - "name": "custom_blocklists", - "serializedName": "custom_blocklists", - "description": "A collection of binary filtering outcomes for configured custom blocklists.", - "type": { - "$ref": "328" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.custom_blocklists" - }, - { - "$id": "653", - "kind": "property", - "name": "error", - "serializedName": "error", - "description": "If present, details about an error that prevented content filtering from completing its evaluation.", - "type": { - "$id": "654", - "kind": "model", - "name": "AzureContentFilterResultForChoiceError", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.error.anonymous", - "usage": "Output", - "decorators": [], - "properties": [ - { - "$id": "655", - "kind": "property", - "name": "code", - "serializedName": "code", - "description": "A distinct, machine-readable code associated with the error.", - "type": { - "$id": "656", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.error.anonymous.code" - }, - { - "$id": "657", - "kind": "property", - "name": "message", - "serializedName": "message", - "description": "A human-readable message associated with the error.", - "type": { - "$id": "658", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.error.anonymous.message" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.error" - }, - { - "$id": "659", - "kind": "property", - "name": "protected_material_text", - "serializedName": "protected_material_text", - "description": "A detection result that describes a match against text protected under copyright or other status.", - "type": { - "$ref": "322" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_text" - }, - { - "$id": "660", - "kind": "property", - "name": "protected_material_code", - "serializedName": "protected_material_code", - "description": "A detection result that describes a match against licensed code or other protected source material.", - "type": { - "$id": "661", - "kind": "model", - "name": "AzureContentFilterResultForChoiceProtectedMaterialCode", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.anonymous", - "usage": "Output", - "decorators": [], - "properties": [ - { - "$id": "662", - "kind": "property", - "name": "filtered", - "serializedName": "filtered", - "description": "Whether the content detection resulted in a content filtering action.", - "type": { - "$id": "663", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.anonymous.filtered" - }, - { - "$id": "664", - "kind": "property", - "name": "detected", - "serializedName": "detected", - "description": "Whether the labeled content category was detected in the content.", - "type": { - "$id": "665", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.anonymous.detected" - }, - { - "$id": "666", - "kind": "property", - "name": "citation", - "serializedName": "citation", - "description": "If available, the citation details describing the associated license and its location.", - "type": { - "$id": "667", - "kind": "model", - "name": "AzureContentFilterResultForChoiceProtectedMaterialCodeCitation", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.citation.anonymous", - "usage": "Output", - "decorators": [], - "properties": [ - { - "$id": "668", - "kind": "property", - "name": "license", - "serializedName": "license", - "description": "The name or identifier of the license associated with the detection.", - "type": { - "$id": "669", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.citation.anonymous.license" - }, - { - "$id": "670", - "kind": "property", - "name": "URL", - "serializedName": "URL", - "description": "The URL associated with the license.", - "type": { - "$id": "671", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.citation.anonymous.URL" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.anonymous.citation" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code" - }, - { - "$id": "672", - "kind": "property", - "name": "ungrounded_material", - "serializedName": "ungrounded_material", - "type": { - "$id": "673", - "kind": "model", - "name": "AzureContentFilterCompletionTextSpanDetectionResult", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpanDetectionResult", - "usage": "Output", - "decorators": [], - "properties": [ - { - "$id": "674", - "kind": "property", - "name": "filtered", - "serializedName": "filtered", - "description": "Whether the content detection resulted in a content filtering action.", - "type": { - "$id": "675", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpanDetectionResult.filtered" - }, - { - "$id": "676", - "kind": "property", - "name": "detected", - "serializedName": "detected", - "description": "Whether the labeled content category was detected in the content.", - "type": { - "$id": "677", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpanDetectionResult.detected" - }, - { - "$id": "678", - "kind": "property", - "name": "details", - "serializedName": "details", - "description": "Detailed information about the detected completion text spans.", - "type": { - "$id": "679", - "kind": "array", - "name": "ArrayAzureContentFilterCompletionTextSpan", - "valueType": { - "$id": "680", - "kind": "model", - "name": "AzureContentFilterCompletionTextSpan", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpan", - "usage": "Output", - "description": "A representation of a span of completion text as used by Azure OpenAI content filter results.", - "decorators": [], - "properties": [ - { - "$id": "681", - "kind": "property", - "name": "completion_start_offset", - "serializedName": "completion_start_offset", - "description": "Offset of the UTF32 code point which begins the span.", - "type": { - "$id": "682", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpan.completion_start_offset" - }, - { - "$id": "683", - "kind": "property", - "name": "completion_end_offset", - "serializedName": "completion_end_offset", - "description": "Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans.", - "type": { - "$id": "684", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpan.completion_end_offset" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpanDetectionResult.details" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.ungrounded_material" - } - ] - }, - { - "$ref": "654" - }, - { - "$ref": "661" - }, - { - "$ref": "667" - }, - { - "$ref": "673" - }, - { - "$ref": "680" - }, - { - "$id": "685", - "kind": "model", - "name": "AzureContentFilterResultForPrompt", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt", - "usage": "Output", - "description": "A content filter result associated with a single input prompt item into a generative AI system.", - "decorators": [], - "properties": [ - { - "$id": "686", - "kind": "property", - "name": "prompt_index", - "serializedName": "prompt_index", - "description": "The index of the input prompt associated with the accompanying content filter result categories.", - "type": { - "$id": "687", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.prompt_index" - }, - { - "$id": "688", - "kind": "property", - "name": "content_filter_results", - "serializedName": "content_filter_results", - "description": "The content filter category details for the result.", - "type": { - "$id": "689", - "kind": "model", - "name": "AzureContentFilterResultForPromptContentFilterResults", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous", - "usage": "Output", - "decorators": [], - "properties": [ - { - "$id": "690", - "kind": "property", - "name": "sexual", - "serializedName": "sexual", - "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse.", - "type": { - "$ref": "314" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.sexual" - }, - { - "$id": "691", - "kind": "property", - "name": "hate", - "serializedName": "hate", - "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size.", - "type": { - "$ref": "314" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.hate" - }, - { - "$id": "692", - "kind": "property", - "name": "violence", - "serializedName": "violence", - "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on.", - "type": { - "$ref": "314" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.violence" - }, - { - "$id": "693", - "kind": "property", - "name": "self_harm", - "serializedName": "self_harm", - "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself.", - "type": { - "$ref": "314" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.self_harm" - }, - { - "$id": "694", - "kind": "property", - "name": "profanity", - "serializedName": "profanity", - "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent.", - "type": { - "$ref": "322" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.profanity" - }, - { - "$id": "695", - "kind": "property", - "name": "custom_blocklists", - "serializedName": "custom_blocklists", - "description": "A collection of binary filtering outcomes for configured custom blocklists.", - "type": { - "$ref": "328" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.custom_blocklists" - }, - { - "$id": "696", - "kind": "property", - "name": "error", - "serializedName": "error", - "description": "If present, details about an error that prevented content filtering from completing its evaluation.", - "type": { - "$ref": "654" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.error" - }, - { - "$id": "697", - "kind": "property", - "name": "jailbreak", - "serializedName": "jailbreak", - "description": "A detection result that describes user prompt injection attacks, where malicious users deliberately exploit\nsystem vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content\ngeneration or violations of system-imposed restrictions.", - "type": { - "$ref": "322" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.jailbreak" - }, - { - "$id": "698", - "kind": "property", - "name": "indirect_attack", - "serializedName": "indirect_attack", - "description": "A detection result that describes attacks on systems powered by Generative AI models that can happen every time\nan application processes information that wasn’t directly authored by either the developer of the application or\nthe user.", - "type": { - "$ref": "322" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.indirect_attack" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results" - } - ] - }, - { - "$ref": "689" - }, - { - "$id": "699", - "kind": "model", - "name": "AzureChatMessageContext", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext", - "access": "public", - "usage": "Output", - "description": "An additional property, added to chat completion response messages, produced by the Azure OpenAI service when using\nextension behavior. This includes intent and citation information from the On Your Data feature.", - "decorators": [], - "properties": [ - { - "$id": "700", - "kind": "property", - "name": "intent", - "serializedName": "intent", - "description": "The detected intent from the chat history, which is used to carry conversation context between interactions", - "type": { - "$id": "701", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.intent" - }, - { - "$id": "702", - "kind": "property", - "name": "citations", - "serializedName": "citations", - "description": "The citations produced by the data retrieval.", - "type": { - "$id": "703", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "704", - "kind": "model", - "name": "AzureChatMessageContextCitation", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous", - "usage": "Output", - "decorators": [], - "properties": [ - { - "$id": "705", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The content of the citation.", - "type": { - "$id": "706", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.content" - }, - { - "$id": "707", - "kind": "property", - "name": "title", - "serializedName": "title", - "description": "The title for the citation.", - "type": { - "$id": "708", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.title" - }, - { - "$id": "709", - "kind": "property", - "name": "url", - "serializedName": "url", - "description": "The URL of the citation.", - "type": { - "$id": "710", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.url" - }, - { - "$id": "711", - "kind": "property", - "name": "filepath", - "serializedName": "filepath", - "description": "The file path for the citation.", - "type": { - "$id": "712", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.filepath" - }, - { - "$id": "713", - "kind": "property", - "name": "chunk_id", - "serializedName": "chunk_id", - "description": "The chunk ID for the citation.", - "type": { - "$id": "714", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.chunk_id" - }, - { - "$id": "715", - "kind": "property", - "name": "rerank_score", - "serializedName": "rerank_score", - "description": "The rerank score for the retrieval.", - "type": { - "$id": "716", - "kind": "float64", - "name": "float64", - "crossLanguageDefinitionId": "TypeSpec.float64", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.rerank_score" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citations" - }, - { - "$id": "717", - "kind": "property", - "name": "all_retrieved_documents", - "serializedName": "all_retrieved_documents", - "description": "Summary information about documents retrieved by the data retrieval operation.", - "type": { - "$id": "718", - "kind": "model", - "name": "AzureChatMessageContextAllRetrievedDocuments", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous", - "usage": "Output", - "decorators": [], - "properties": [ - { - "$id": "719", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The content of the citation.", - "type": { - "$id": "720", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.content" - }, - { - "$id": "721", - "kind": "property", - "name": "title", - "serializedName": "title", - "description": "The title for the citation.", - "type": { - "$id": "722", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.title" - }, - { - "$id": "723", - "kind": "property", - "name": "url", - "serializedName": "url", - "description": "The URL of the citation.", - "type": { - "$id": "724", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.url" - }, - { - "$id": "725", - "kind": "property", - "name": "filepath", - "serializedName": "filepath", - "description": "The file path for the citation.", - "type": { - "$id": "726", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.filepath" - }, - { - "$id": "727", - "kind": "property", - "name": "chunk_id", - "serializedName": "chunk_id", - "description": "The chunk ID for the citation.", - "type": { - "$id": "728", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.chunk_id" - }, - { - "$id": "729", - "kind": "property", - "name": "rerank_score", - "serializedName": "rerank_score", - "description": "The rerank score for the retrieval.", - "type": { - "$id": "730", - "kind": "float64", - "name": "float64", - "crossLanguageDefinitionId": "TypeSpec.float64", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.rerank_score" - }, - { - "$id": "731", - "kind": "property", - "name": "search_queries", - "serializedName": "search_queries", - "description": "The search queries executed to retrieve documents.", - "type": { - "$id": "732", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "733", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.search_queries" - }, - { - "$id": "734", - "kind": "property", - "name": "data_source_index", - "serializedName": "data_source_index", - "description": "The index of the data source used for retrieval.", - "type": { - "$id": "735", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.data_source_index" - }, - { - "$id": "736", - "kind": "property", - "name": "original_search_score", - "serializedName": "original_search_score", - "description": "The original search score for the retrieval.", - "type": { - "$id": "737", - "kind": "float64", - "name": "float64", - "crossLanguageDefinitionId": "TypeSpec.float64", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.original_search_score" - }, - { - "$id": "738", - "kind": "property", - "name": "filter_reason", - "serializedName": "filter_reason", - "description": "If applicable, an indication of why the document was filtered.", - "type": { - "$ref": "41" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.filter_reason" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents" - } - ] - }, - { - "$ref": "704" - }, - { - "$ref": "718" - }, - { - "$id": "739", - "kind": "model", - "name": "AzureOpenAIChatErrorResponse", - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatErrorResponse", - "access": "public", - "usage": "Output", - "description": "A structured representation of an error an Azure OpenAI request.", - "decorators": [], - "properties": [ - { - "$id": "740", - "kind": "property", - "name": "error", - "serializedName": "error", - "type": { - "$id": "741", - "kind": "model", - "name": "AzureOpenAIChatError", - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError", - "access": "public", - "usage": "Output", - "description": "The structured representation of an error from an Azure OpenAI chat completion request.", - "decorators": [], - "properties": [ - { - "$id": "742", - "kind": "property", - "name": "code", - "serializedName": "code", - "description": "The distinct, machine-generated identifier for the error.", - "type": { - "$id": "743", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.code" - }, - { - "$id": "744", - "kind": "property", - "name": "message", - "serializedName": "message", - "description": "A human-readable message associated with the error.", - "type": { - "$id": "745", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.message" - }, - { - "$id": "746", - "kind": "property", - "name": "param", - "serializedName": "param", - "description": "If applicable, the request input parameter associated with the error", - "type": { - "$id": "747", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.param" - }, - { - "$id": "748", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "If applicable, the input line number associated with the error.", - "type": { - "$id": "749", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.type" - }, - { - "$id": "750", - "kind": "property", - "name": "inner_error", - "serializedName": "inner_error", - "description": "If applicable, an upstream error that originated this error.", - "type": { - "$id": "751", - "kind": "model", - "name": "AzureOpenAIChatErrorInnerError", - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error.anonymous", - "usage": "Output", - "decorators": [], - "properties": [ - { - "$id": "752", - "kind": "property", - "name": "code", - "serializedName": "code", - "description": "The code associated with the inner error.", - "type": { - "$id": "753", - "kind": "constant", - "valueType": { - "$ref": "47" - }, - "value": "ResponsibleAIPolicyViolation", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error.anonymous.code" - }, - { - "$id": "754", - "kind": "property", - "name": "revised_prompt", - "serializedName": "revised_prompt", - "description": "If applicable, the modified prompt used for generation.", - "type": { - "$id": "755", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error.anonymous.revised_prompt" - }, - { - "$id": "756", - "kind": "property", - "name": "content_filter_results", - "serializedName": "content_filter_results", - "description": "The content filter result details associated with the inner error.", - "type": { - "$ref": "685" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error.anonymous.content_filter_results" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatErrorResponse.error" - } - ] - }, - { - "$ref": "741" - }, - { - "$ref": "751" - }, - { - "$id": "757", - "kind": "model", - "name": "AzureContentFilterBlocklistIdResult", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistIdResult", - "access": "public", - "usage": "Output", - "description": "A content filter result item that associates an existing custom blocklist ID with a value indicating whether or not\nthe corresponding blocklist resulted in content being filtered.", - "decorators": [], - "properties": [ - { - "$id": "758", - "kind": "property", - "name": "id", - "serializedName": "id", - "description": "The ID of the custom blocklist associated with the filtered status.", - "type": { - "$id": "759", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistIdResult.id" - }, - { - "$id": "760", - "kind": "property", - "name": "filtered", - "serializedName": "filtered", - "description": "Whether the associated blocklist resulted in the content being filtered.", - "type": { - "$id": "761", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistIdResult.filtered" - } - ] - }, - { - "$id": "762", - "kind": "model", - "name": "AzureOpenAIFile", - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile", - "access": "public", - "usage": "Output", - "decorators": [], - "properties": [ - { - "$id": "763", - "kind": "property", - "name": "id", - "serializedName": "id", - "description": "The file identifier, which can be referenced in the API endpoints.", - "type": { - "$id": "764", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.id" - }, - { - "$id": "765", - "kind": "property", - "name": "bytes", - "serializedName": "bytes", - "description": "The size of the file, in bytes.", - "type": { - "$id": "766", - "kind": "nullable", - "type": { - "$id": "767", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.bytes" - }, - { - "$id": "768", - "kind": "property", - "name": "created_at", - "serializedName": "created_at", - "description": "The Unix timestamp (in seconds) for when the file was created.", - "type": { - "$id": "769", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "unixTimestamp", - "wireType": { - "$id": "770", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.created_at" - }, - { - "$id": "771", - "kind": "property", - "name": "filename", - "serializedName": "filename", - "description": "The name of the file.", - "type": { - "$id": "772", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.filename" - }, - { - "$id": "773", - "kind": "property", - "name": "object", - "serializedName": "object", - "description": "The object type, which is always `file`.", - "type": { - "$id": "774", - "kind": "constant", - "valueType": { - "$ref": "82" - }, - "value": "file", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.object" - }, - { - "$id": "775", - "kind": "property", - "name": "purpose", - "serializedName": "purpose", - "description": "The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results` and `vision`.", - "type": { - "$ref": "66" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.purpose" - }, - { - "$id": "776", - "kind": "property", - "name": "status_details", - "serializedName": "status_details", - "description": "Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.", - "type": { - "$id": "777", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.status_details" - }, - { - "$id": "778", - "kind": "property", - "name": "status", - "serializedName": "status", - "type": { - "$ref": "85" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.status" - } - ] - }, - { - "$id": "779", - "kind": "model", - "name": "AzureImage", - "crossLanguageDefinitionId": "AzureOpenAI.AzureImage", - "access": "public", - "usage": "Output", - "decorators": [], - "baseModel": { - "$ref": "286" - }, - "properties": [ - { - "$id": "780", - "kind": "property", - "name": "prompt_filter_results", - "serializedName": "prompt_filter_results", - "type": { - "$ref": "311" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureImage.prompt_filter_results" - }, - { - "$id": "781", - "kind": "property", - "name": "content_filter_results", - "serializedName": "content_filter_results", - "type": { - "$ref": "312" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureImage.content_filter_results" - } - ] - }, - { - "$id": "782", - "kind": "model", - "name": "AzureCreateChatCompletionRequest", - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest", - "usage": "None", - "description": "The extended request model for chat completions against the Azure OpenAI service.\nThis adds the ability to provide data sources for the On Your Data feature.", - "decorators": [], - "properties": [ - { - "$id": "783", - "kind": "property", - "name": "messages", - "serializedName": "messages", - "description": "A list of messages comprising the conversation so far. Depending on the\n[model](/docs/models) you use, different message types (modalities) are\nsupported, like [text](/docs/guides/text-generation),\n[images](/docs/guides/vision), and [audio](/docs/guides/audio).", - "type": { - "$id": "784", - "kind": "array", - "name": "ArrayChatCompletionRequestMessage", - "valueType": { - "$id": "785", - "kind": "model", - "name": "ChatCompletionRequestMessage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessage", - "usage": "None", - "decorators": [], - "discriminatorProperty": { - "$id": "786", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the author of this message.", - "type": { - "$id": "787", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessage.role" - }, - "properties": [ - { - "$ref": "786" - } - ], - "discriminatedSubtypes": { - "$id": "788", - "system": { - "$id": "789", - "kind": "model", - "name": "ChatCompletionRequestSystemMessage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestSystemMessage", - "usage": "None", - "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, use `developer` messages\nfor this purpose instead.", - "discriminatorValue": "system", - "decorators": [], - "baseModel": { - "$ref": "785" - }, - "properties": [ - { - "$id": "790", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The contents of the system message.", - "type": { - "$id": "791", - "kind": "union", - "name": "ChatCompletionRequestSystemMessageContent", - "variantTypes": [ - { - "$id": "792", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - { - "$id": "793", - "kind": "array", - "name": "ArrayChatCompletionRequestSystemMessageContentPart", - "valueType": { - "$id": "794", - "kind": "union", - "name": "ChatCompletionRequestSystemMessageContentPart", - "variantTypes": [ - { - "$id": "795", - "kind": "model", - "name": "ChatCompletionRequestMessageContentPartText", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartText", - "usage": "None", - "description": "Learn about [text inputs](/docs/guides/text-generation).", - "decorators": [], - "properties": [ - { - "$id": "796", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the content part.", - "type": { - "$id": "797", - "kind": "constant", - "valueType": { - "$ref": "101" - }, - "value": "text", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartText.type" - }, - { - "$id": "798", - "kind": "property", - "name": "text", - "serializedName": "text", - "description": "The text content.", - "type": { - "$id": "799", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartText.text" - } - ] - } - ], - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestSystemMessage.content" - }, - { - "$id": "800", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the messages author, in this case `system`.", - "type": { - "$id": "801", - "kind": "constant", - "valueType": { - "$id": "802", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "system", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestSystemMessage.role" - }, - { - "$id": "803", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", - "type": { - "$id": "804", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestSystemMessage.name" - } - ] - }, - "developer": { - "$id": "805", - "kind": "model", - "name": "ChatCompletionRequestDeveloperMessage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestDeveloperMessage", - "usage": "None", - "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, `developer` messages\nreplace the previous `system` messages.", - "discriminatorValue": "developer", - "decorators": [], - "baseModel": { - "$ref": "785" - }, - "properties": [ - { - "$id": "806", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The contents of the developer message.", - "type": { - "$id": "807", - "kind": "union", - "name": "ChatCompletionRequestDeveloperMessageContent", - "variantTypes": [ - { - "$id": "808", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - { - "$id": "809", - "kind": "array", - "name": "ArrayChatCompletionRequestMessageContentPartText", - "valueType": { - "$ref": "795" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestDeveloperMessage.content" - }, - { - "$id": "810", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the messages author, in this case `developer`.", - "type": { - "$id": "811", - "kind": "constant", - "valueType": { - "$id": "812", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "developer", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestDeveloperMessage.role" - }, - { - "$id": "813", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", - "type": { - "$id": "814", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestDeveloperMessage.name" - } - ] - }, - "user": { - "$id": "815", - "kind": "model", - "name": "ChatCompletionRequestUserMessage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestUserMessage", - "usage": "None", - "description": "Messages sent by an end user, containing prompts or additional context\ninformation.", - "discriminatorValue": "user", - "decorators": [], - "baseModel": { - "$ref": "785" - }, - "properties": [ - { - "$id": "816", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The contents of the user message.", - "type": { - "$id": "817", - "kind": "union", - "name": "ChatCompletionRequestUserMessageContent", - "variantTypes": [ - { - "$id": "818", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - { - "$id": "819", - "kind": "array", - "name": "ArrayChatCompletionRequestUserMessageContentPart", - "valueType": { - "$id": "820", - "kind": "union", - "name": "ChatCompletionRequestUserMessageContentPart", - "variantTypes": [ - { - "$ref": "795" - }, - { - "$id": "821", - "kind": "model", - "name": "ChatCompletionRequestMessageContentPartImage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage", - "usage": "None", - "description": "Learn about [image inputs](/docs/guides/vision).", - "decorators": [], - "properties": [ - { - "$id": "822", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the content part.", - "type": { - "$id": "823", - "kind": "constant", - "valueType": { - "$ref": "104" - }, - "value": "image_url", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.type" - }, - { - "$id": "824", - "kind": "property", - "name": "image_url", - "serializedName": "image_url", - "type": { - "$id": "825", - "kind": "model", - "name": "ChatCompletionRequestMessageContentPartImageImageUrl", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.image_url.anonymous", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "826", - "kind": "property", - "name": "url", - "serializedName": "url", - "description": "Either a URL of the image or the base64 encoded image data.", - "type": { - "$id": "827", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.image_url.anonymous.url" - }, - { - "$id": "828", - "kind": "property", - "name": "detail", - "serializedName": "detail", - "description": "Specifies the detail level of the image. Learn more in the [Vision guide](/docs/guides/vision#low-or-high-fidelity-image-understanding).", - "type": { - "$ref": "107" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.image_url.anonymous.detail" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.image_url" - } - ] - }, - { - "$id": "829", - "kind": "model", - "name": "ChatCompletionRequestMessageContentPartAudio", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio", - "usage": "None", - "description": "Learn about [audio inputs](/docs/guides/audio).", - "decorators": [], - "properties": [ - { - "$id": "830", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the content part. Always `input_audio`.", - "type": { - "$id": "831", - "kind": "constant", - "valueType": { - "$ref": "115" - }, - "value": "input_audio", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.type" - }, - { - "$id": "832", - "kind": "property", - "name": "input_audio", - "serializedName": "input_audio", - "type": { - "$id": "833", - "kind": "model", - "name": "ChatCompletionRequestMessageContentPartAudioInputAudio", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.input_audio.anonymous", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "834", - "kind": "property", - "name": "data", - "serializedName": "data", - "description": "Base64 encoded audio data.", - "type": { - "$id": "835", - "kind": "bytes", - "name": "bytes", - "encode": "base64", - "crossLanguageDefinitionId": "TypeSpec.bytes", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.input_audio.anonymous.data" - }, - { - "$id": "836", - "kind": "property", - "name": "format", - "serializedName": "format", - "description": "The format of the encoded audio data. Currently supports \"wav\" and \"mp3\".", - "type": { - "$ref": "118" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.input_audio.anonymous.format" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.input_audio" - } - ] - } - ], - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestUserMessage.content" - }, - { - "$id": "837", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the messages author, in this case `user`.", - "type": { - "$id": "838", - "kind": "constant", - "valueType": { - "$id": "839", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "user", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestUserMessage.role" - }, - { - "$id": "840", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", - "type": { - "$id": "841", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestUserMessage.name" - } - ] - }, - "assistant": { - "$id": "842", - "kind": "model", - "name": "ChatCompletionRequestAssistantMessage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage", - "usage": "None", - "description": "Messages sent by the model in response to user messages.", - "discriminatorValue": "assistant", - "decorators": [], - "baseModel": { - "$ref": "785" - }, - "properties": [ - { - "$id": "843", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.", - "type": { - "$id": "844", - "kind": "nullable", - "type": { - "$id": "845", - "kind": "union", - "name": "ChatCompletionRequestAssistantMessageContent", - "variantTypes": [ - { - "$id": "846", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - { - "$id": "847", - "kind": "array", - "name": "ArrayChatCompletionRequestAssistantMessageContentPart", - "valueType": { - "$id": "848", - "kind": "union", - "name": "ChatCompletionRequestAssistantMessageContentPart", - "variantTypes": [ - { - "$ref": "795" - }, - { - "$id": "849", - "kind": "model", - "name": "ChatCompletionRequestMessageContentPartRefusal", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartRefusal", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "850", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the content part.", - "type": { - "$id": "851", - "kind": "constant", - "valueType": { - "$ref": "124" - }, - "value": "refusal", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartRefusal.type" - }, - { - "$id": "852", - "kind": "property", - "name": "refusal", - "serializedName": "refusal", - "description": "The refusal message generated by the model.", - "type": { - "$id": "853", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartRefusal.refusal" - } - ] - } - ], - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - ], - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.content" - }, - { - "$id": "854", - "kind": "property", - "name": "refusal", - "serializedName": "refusal", - "description": "The refusal message by the assistant.", - "type": { - "$id": "855", - "kind": "nullable", - "type": { - "$id": "856", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.refusal" - }, - { - "$id": "857", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the messages author, in this case `assistant`.", - "type": { - "$id": "858", - "kind": "constant", - "valueType": { - "$id": "859", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "assistant", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.role" - }, - { - "$id": "860", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", - "type": { - "$id": "861", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.name" - }, - { - "$id": "862", - "kind": "property", - "name": "audio", - "serializedName": "audio", - "description": "Data about a previous audio response from the model.\n[Learn more](/docs/guides/audio).", - "type": { - "$id": "863", - "kind": "nullable", - "type": { - "$id": "864", - "kind": "model", - "name": "ChatCompletionRequestAssistantMessageAudio", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.audio.anonymous", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "865", - "kind": "property", - "name": "id", - "serializedName": "id", - "description": "Unique identifier for a previous audio response from the model.", - "type": { - "$id": "866", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.audio.anonymous.id" - } - ] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.audio" - }, - { - "$id": "867", - "kind": "property", - "name": "tool_calls", - "serializedName": "tool_calls", - "type": { - "$id": "868", - "kind": "array", - "name": "ChatCompletionMessageToolCalls", - "valueType": { - "$id": "869", - "kind": "model", - "name": "ChatCompletionMessageToolCall", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "870", - "kind": "property", - "name": "id", - "serializedName": "id", - "description": "The ID of the tool call.", - "type": { - "$id": "871", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.id" - }, - { - "$id": "872", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the tool. Currently, only `function` is supported.", - "type": { - "$id": "873", - "kind": "constant", - "valueType": { - "$ref": "127" - }, - "value": "function", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.type" - }, - { - "$id": "874", - "kind": "property", - "name": "function", - "serializedName": "function", - "description": "The function that the model called.", - "type": { - "$id": "875", - "kind": "model", - "name": "ChatCompletionMessageToolCallFunction", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.function.anonymous", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "876", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "The name of the function to call.", - "type": { - "$id": "877", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.function.anonymous.name" - }, - { - "$id": "878", - "kind": "property", - "name": "arguments", - "serializedName": "arguments", - "description": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.", - "type": { - "$id": "879", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.function.anonymous.arguments" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.function" - } - ] - }, - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCalls", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.tool_calls" - }, - { - "$id": "880", - "kind": "property", - "name": "function_call", - "serializedName": "function_call", - "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.", - "type": { - "$id": "881", - "kind": "nullable", - "type": { - "$id": "882", - "kind": "model", - "name": "ChatCompletionRequestAssistantMessageFunctionCall", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.function_call.anonymous", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "883", - "kind": "property", - "name": "name", - "serializedName": "name", - "type": { - "$id": "884", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.function_call.anonymous.name" - }, - { - "$id": "885", - "kind": "property", - "name": "arguments", - "serializedName": "arguments", - "type": { - "$id": "886", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.function_call.anonymous.arguments" - } - ] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.function_call" - } - ] - }, - "tool": { - "$id": "887", - "kind": "model", - "name": "ChatCompletionRequestToolMessage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestToolMessage", - "usage": "None", - "discriminatorValue": "tool", - "decorators": [], - "baseModel": { - "$ref": "785" - }, - "properties": [ - { - "$id": "888", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the messages author, in this case `tool`.", - "type": { - "$id": "889", - "kind": "constant", - "valueType": { - "$id": "890", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "tool", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestToolMessage.role" - }, - { - "$id": "891", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The contents of the tool message.", - "type": { - "$id": "892", - "kind": "union", - "name": "ChatCompletionRequestToolMessageContent", - "variantTypes": [ - { - "$id": "893", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - { - "$id": "894", - "kind": "array", - "name": "ArrayChatCompletionRequestToolMessageContentPart", - "valueType": { - "$id": "895", - "kind": "union", - "name": "ChatCompletionRequestToolMessageContentPart", - "variantTypes": [ - { - "$ref": "795" - } - ], - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestToolMessage.content" - }, - { - "$id": "896", - "kind": "property", - "name": "tool_call_id", - "serializedName": "tool_call_id", - "description": "Tool call that this message is responding to.", - "type": { - "$id": "897", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestToolMessage.tool_call_id" - } - ] - }, - "function": { - "$id": "898", - "kind": "model", - "name": "ChatCompletionRequestFunctionMessage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestFunctionMessage", - "usage": "None", - "deprecation": "This field is marked as deprecated.", - "discriminatorValue": "function", - "decorators": [], - "baseModel": { - "$ref": "785" - }, - "properties": [ - { - "$id": "899", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the messages author, in this case `function`.", - "type": { - "$id": "900", - "kind": "constant", - "valueType": { - "$id": "901", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "function", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestFunctionMessage.role" - }, - { - "$id": "902", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The contents of the function message.", - "type": { - "$id": "903", - "kind": "nullable", - "type": { - "$id": "904", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestFunctionMessage.content" - }, - { - "$id": "905", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "The name of the function to call.", - "type": { - "$id": "906", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestFunctionMessage.name" - } - ] - } - } - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.messages" - }, - { - "$id": "907", - "kind": "property", - "name": "store", - "serializedName": "store", - "description": "Whether or not to store the output of this chat completion request for\nuse in our [model distillation](/docs/guides/distillation) or\n[evals](/docs/guides/evals) products.", - "type": { - "$id": "908", - "kind": "nullable", - "type": { - "$id": "909", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.store" - }, - { - "$id": "910", - "kind": "property", - "name": "reasoning_effort", - "serializedName": "reasoning_effort", - "description": "**o1 models only** \n\nConstrains effort on reasoning for \n[reasoning models](https://platform.openai.com/docs/guides/reasoning).\nCurrently supported values are `low`, `medium`, and `high`. Reducing\nreasoning effort can result in faster responses and fewer tokens used\non reasoning in a response.", - "type": { - "$ref": "130" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.reasoning_effort" - }, - { - "$id": "911", - "kind": "property", - "name": "metadata", - "serializedName": "metadata", - "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.", - "type": { - "$id": "912", - "kind": "dict", - "keyType": { - "$id": "913", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "914", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.metadata" - }, - { - "$id": "915", - "kind": "property", - "name": "frequency_penalty", - "serializedName": "frequency_penalty", - "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\ntheir existing frequency in the text so far, decreasing the model's\nlikelihood to repeat the same line verbatim.", - "type": { - "$id": "916", - "kind": "nullable", - "type": { - "$id": "917", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.frequency_penalty" - }, - { - "$id": "918", - "kind": "property", - "name": "logit_bias", - "serializedName": "logit_bias", - "description": "Modify the likelihood of specified tokens appearing in the completion.\n\nAccepts a JSON object that maps tokens (specified by their token ID in the\ntokenizer) to an associated bias value from -100 to 100. Mathematically,\nthe bias is added to the logits generated by the model prior to sampling.\nThe exact effect will vary per model, but values between -1 and 1 should\ndecrease or increase likelihood of selection; values like -100 or 100\nshould result in a ban or exclusive selection of the relevant token.", - "type": { - "$id": "919", - "kind": "nullable", - "type": { - "$id": "920", - "kind": "dict", - "keyType": { - "$id": "921", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "922", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.logit_bias" - }, - { - "$id": "923", - "kind": "property", - "name": "logprobs", - "serializedName": "logprobs", - "description": "Whether to return log probabilities of the output tokens or not. If true,\nreturns the log probabilities of each output token returned in the\n`content` of `message`.", - "type": { - "$id": "924", - "kind": "nullable", - "type": { - "$id": "925", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.logprobs" - }, - { - "$id": "926", - "kind": "property", - "name": "top_logprobs", - "serializedName": "top_logprobs", - "description": "An integer between 0 and 20 specifying the number of most likely tokens to\nreturn at each token position, each with an associated log probability.\n`logprobs` must be set to `true` if this parameter is used.", - "type": { - "$id": "927", - "kind": "nullable", - "type": { - "$id": "928", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.top_logprobs" - }, - { - "$id": "929", - "kind": "property", - "name": "max_tokens", - "serializedName": "max_tokens", - "description": "The maximum number of [tokens](/tokenizer) that can be generated in the\nchat completion. This value can be used to control\n[costs](https://openai.com/api/pricing/) for text generated via API.\n\nThis value is now deprecated in favor of `max_completion_tokens`, and is\nnot compatible with [o1 series models](/docs/guides/reasoning).", - "type": { - "$id": "930", - "kind": "nullable", - "type": { - "$id": "931", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.max_tokens" - }, - { - "$id": "932", - "kind": "property", - "name": "max_completion_tokens", - "serializedName": "max_completion_tokens", - "description": "An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](/docs/guides/reasoning).", - "type": { - "$id": "933", - "kind": "nullable", - "type": { - "$id": "934", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.max_completion_tokens" - }, - { - "$id": "935", - "kind": "property", - "name": "n", - "serializedName": "n", - "description": "How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.", - "type": { - "$id": "936", - "kind": "nullable", - "type": { - "$id": "937", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.n" - }, - { - "$id": "938", - "kind": "property", - "name": "modalities", - "serializedName": "modalities", - "type": { - "$id": "939", - "kind": "nullable", - "type": { - "$id": "940", - "kind": "array", - "name": "ChatCompletionModalities", - "valueType": { - "$ref": "138" - }, - "crossLanguageDefinitionId": "OpenAI.ChatCompletionModalities", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.modalities" - }, - { - "$id": "941", - "kind": "property", - "name": "prediction", - "serializedName": "prediction", - "description": "Configuration for a [Predicted Output](/docs/guides/predicted-outputs),\nwhich can greatly improve response times when large parts of the model\nresponse are known ahead of time. This is most common when you are\nregenerating a file with only minor changes to most of the content.", - "type": { - "$id": "942", - "kind": "nullable", - "type": { - "$id": "943", - "kind": "model", - "name": "ChatOutputPrediction", - "crossLanguageDefinitionId": "OpenAI.ChatOutputPrediction", - "usage": "None", - "description": "Base representation of predicted output from a model.", - "decorators": [], - "discriminatorProperty": { - "$id": "944", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$ref": "144" - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatOutputPrediction.type" - }, - "properties": [ - { - "$ref": "944" - } - ], - "discriminatedSubtypes": { - "$id": "945", - "content": { - "$id": "946", - "kind": "model", - "name": "ChatOutputPredictionContent", - "crossLanguageDefinitionId": "OpenAI.ChatOutputPredictionContent", - "usage": "None", - "description": "Static predicted output content, such as the content of a text file that is\nbeing regenerated.", - "discriminatorValue": "content", - "decorators": [], - "baseModel": { - "$ref": "943" - }, - "properties": [ - { - "$id": "947", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the predicted content you want to provide. This type is\ncurrently always `content`.", - "type": { - "$id": "948", - "kind": "constant", - "valueType": { - "$id": "949", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "content", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatOutputPredictionContent.type" - }, - { - "$id": "950", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The content that should be matched when generating a model response.\nIf generated tokens would match this content, the entire model response\ncan be returned much more quickly.", - "type": { - "$id": "951", - "kind": "union", - "name": "ChatOutputPredictionContentContent", - "variantTypes": [ - { - "$id": "952", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - { - "$id": "953", - "kind": "array", - "name": "ArrayChatCompletionRequestMessageContentPartText", - "valueType": { - "$ref": "795" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatOutputPredictionContent.content" - } - ] - } - } - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.prediction" - }, - { - "$id": "954", - "kind": "property", - "name": "audio", - "serializedName": "audio", - "description": "Parameters for audio output. Required when audio output is requested with\n`modalities: [\"audio\"]`. [Learn more](/docs/guides/audio).", - "type": { - "$id": "955", - "kind": "nullable", - "type": { - "$id": "956", - "kind": "model", - "name": "AzureCreateChatCompletionRequestAudio", - "crossLanguageDefinitionId": "OpenAI.AzureCreateChatCompletionRequest.audio.anonymous", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "957", - "kind": "property", - "name": "voice", - "serializedName": "voice", - "description": "The voice the model uses to respond. Supported voices are `ash`, `ballad`, `coral`, `sage`, and `verse` (also supported but not recommended are `alloy`, `echo`, and `shimmer`; these voices are less expressive).", - "type": { - "$ref": "148" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateChatCompletionRequestCommonBase.audio.anonymous.voice" - }, - { - "$id": "958", - "kind": "property", - "name": "format", - "serializedName": "format", - "description": "Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`,\n`opus`, or `pcm16`.", - "type": { - "$ref": "166" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateChatCompletionRequestCommonBase.audio.anonymous.format" - } - ] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.audio" - }, - { - "$id": "959", - "kind": "property", - "name": "presence_penalty", - "serializedName": "presence_penalty", - "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\nwhether they appear in the text so far, increasing the model's likelihood\nto talk about new topics.", - "type": { - "$id": "960", - "kind": "nullable", - "type": { - "$id": "961", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.presence_penalty" - }, - { - "$id": "962", - "kind": "property", - "name": "response_format", - "serializedName": "response_format", - "description": "An object specifying the format that the model must output.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\nStructured Outputs which ensures the model will match your supplied JSON\nschema. Learn more in the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures\nthe message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model\nto produce JSON yourself via a system or user message. Without this, the\nmodel may generate an unending stream of whitespace until the generation\nreaches the token limit, resulting in a long-running and seemingly \"stuck\"\nrequest. Also note that the message content may be partially cut off if\n`finish_reason=\"length\"`, which indicates the generation exceeded\n`max_tokens` or the conversation exceeded the max context length.", - "type": { - "$id": "963", - "kind": "model", - "name": "ChatResponseFormat", - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormat", - "usage": "None", - "decorators": [], - "discriminatorProperty": { - "$id": "964", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "965", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormat.type" - }, - "properties": [ - { - "$ref": "964" - } - ], - "discriminatedSubtypes": { - "$id": "966", - "text": { - "$id": "967", - "kind": "model", - "name": "ChatResponseFormatText", - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatText", - "usage": "None", - "discriminatorValue": "text", - "decorators": [], - "baseModel": { - "$ref": "963" - }, - "properties": [ - { - "$id": "968", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of response format being defined: `text`", - "type": { - "$id": "969", - "kind": "constant", - "valueType": { - "$id": "970", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "text", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatText.type" - } - ] - }, - "json_object": { - "$id": "971", - "kind": "model", - "name": "ChatResponseFormatJsonObject", - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonObject", - "usage": "None", - "discriminatorValue": "json_object", - "decorators": [], - "baseModel": { - "$ref": "963" - }, - "properties": [ - { - "$id": "972", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of response format being defined: `json_object`", - "type": { - "$id": "973", - "kind": "constant", - "valueType": { - "$id": "974", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "json_object", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonObject.type" - } - ] - }, - "json_schema": { - "$id": "975", - "kind": "model", - "name": "ChatResponseFormatJsonSchema", - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema", - "usage": "None", - "discriminatorValue": "json_schema", - "decorators": [], - "baseModel": { - "$ref": "963" - }, - "properties": [ - { - "$id": "976", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of response format being defined: `json_schema`", - "type": { - "$id": "977", - "kind": "constant", - "valueType": { - "$id": "978", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "json_schema", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.type" - }, - { - "$id": "979", - "kind": "property", - "name": "json_schema", - "serializedName": "json_schema", - "type": { - "$id": "980", - "kind": "model", - "name": "ChatResponseFormatJsonSchemaJsonSchema", - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "981", - "kind": "property", - "name": "description", - "serializedName": "description", - "description": "A description of what the response format is for, used by the model to determine how to respond in the format.", - "type": { - "$id": "982", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous.description" - }, - { - "$id": "983", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "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.", - "type": { - "$id": "984", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous.name" - }, - { - "$id": "985", - "kind": "property", - "name": "schema", - "serializedName": "schema", - "type": { - "$id": "986", - "kind": "model", - "name": "ResponseFormatJsonSchemaSchema", - "crossLanguageDefinitionId": "OpenAI.ResponseFormatJsonSchemaSchema", - "usage": "None", - "description": "The schema for the response format, described as a JSON Schema object.", - "decorators": [], - "additionalProperties": { - "$id": "987", - "kind": "unknown", - "name": "unknown", - "crossLanguageDefinitionId": "", - "decorators": [] - }, - "properties": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous.schema" - }, - { - "$id": "988", - "kind": "property", - "name": "strict", - "serializedName": "strict", - "description": "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](/docs/guides/structured-outputs).", - "type": { - "$id": "989", - "kind": "nullable", - "type": { - "$id": "990", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous.strict" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema" - } - ] - } - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.response_format" - }, - { - "$id": "991", - "kind": "property", - "name": "seed", - "serializedName": "seed", - "description": "This feature is in Beta.\nIf specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.", - "type": { - "$id": "992", - "kind": "nullable", - "type": { - "$id": "993", - "kind": "int64", - "name": "int64", - "crossLanguageDefinitionId": "TypeSpec.int64", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.seed" - }, - { - "$id": "994", - "kind": "property", - "name": "stop", - "serializedName": "stop", - "description": "Up to 4 sequences where the API will stop generating further tokens.", - "type": { - "$id": "995", - "kind": "nullable", - "type": { - "$id": "996", - "kind": "union", - "name": "AzureCreateChatCompletionRequestStop", - "variantTypes": [ - { - "$id": "997", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - { - "$id": "998", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "999", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - ], - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.stop" - }, - { - "$id": "1000", - "kind": "property", - "name": "stream", - "serializedName": "stream", - "description": "If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).", - "type": { - "$id": "1001", - "kind": "nullable", - "type": { - "$id": "1002", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.stream" - }, - { - "$id": "1003", - "kind": "property", - "name": "stream_options", - "serializedName": "stream_options", - "type": { - "$id": "1004", - "kind": "nullable", - "type": { - "$id": "1005", - "kind": "model", - "name": "ChatCompletionStreamOptions", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionStreamOptions", - "usage": "None", - "description": "Options for streaming response. Only set this when you set `stream: true`.", - "decorators": [], - "properties": [ - { - "$id": "1006", - "kind": "property", - "name": "include_usage", - "serializedName": "include_usage", - "description": "If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.", - "type": { - "$id": "1007", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionStreamOptions.include_usage" - } - ] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.stream_options" - }, - { - "$id": "1008", - "kind": "property", - "name": "temperature", - "serializedName": "temperature", - "description": "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.\nWe generally recommend altering this or `top_p` but not both.", - "type": { - "$id": "1009", - "kind": "nullable", - "type": { - "$id": "1010", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.temperature" - }, - { - "$id": "1011", - "kind": "property", - "name": "top_p", - "serializedName": "top_p", - "description": "An alternative to sampling with temperature, called nucleus sampling,\nwhere the model considers the results of the tokens with top_p probability\nmass. So 0.1 means only the tokens comprising the top 10% probability mass\nare considered.\n\nWe generally recommend altering this or `temperature` but not both.", - "type": { - "$id": "1012", - "kind": "nullable", - "type": { - "$id": "1013", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.top_p" - }, - { - "$id": "1014", - "kind": "property", - "name": "tools", - "serializedName": "tools", - "description": "A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.", - "type": { - "$id": "1015", - "kind": "array", - "name": "ArrayChatCompletionTool", - "valueType": { - "$id": "1016", - "kind": "model", - "name": "ChatCompletionTool", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionTool", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "1017", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the tool. Currently, only `function` is supported.", - "type": { - "$id": "1018", - "kind": "constant", - "valueType": { - "$ref": "178" - }, - "value": "function", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionTool.type" - }, - { - "$id": "1019", - "kind": "property", - "name": "function", - "serializedName": "function", - "type": { - "$id": "1020", - "kind": "model", - "name": "FunctionObject", - "crossLanguageDefinitionId": "OpenAI.FunctionObject", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "1021", - "kind": "property", - "name": "description", - "serializedName": "description", - "description": "A description of what the function does, used by the model to choose when and how to call the function.", - "type": { - "$id": "1022", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.FunctionObject.description" - }, - { - "$id": "1023", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", - "type": { - "$id": "1024", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.FunctionObject.name" - }, - { - "$id": "1025", - "kind": "property", - "name": "parameters", - "serializedName": "parameters", - "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\n\nOmitting `parameters` defines a function with an empty parameter list.", - "type": { - "$id": "1026", - "kind": "unknown", - "name": "unknown", - "crossLanguageDefinitionId": "", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.FunctionObject.parameters" - }, - { - "$id": "1027", - "kind": "property", - "name": "strict", - "serializedName": "strict", - "description": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).", - "type": { - "$id": "1028", - "kind": "nullable", - "type": { - "$id": "1029", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.FunctionObject.strict" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionTool.function" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.tools" - }, - { - "$id": "1030", - "kind": "property", - "name": "tool_choice", - "serializedName": "tool_choice", - "type": { - "$id": "1031", - "kind": "union", - "name": "ChatCompletionToolChoiceOption", - "variantTypes": [ - { - "$ref": "181" - }, - { - "$id": "1032", - "kind": "model", - "name": "ChatCompletionNamedToolChoice", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice", - "usage": "None", - "description": "Specifies a tool the model should use. Use to force the model to call a specific function.", - "decorators": [], - "properties": [ - { - "$id": "1033", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the tool. Currently, only `function` is supported.", - "type": { - "$id": "1034", - "kind": "constant", - "valueType": { - "$ref": "189" - }, - "value": "function", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice.type" - }, - { - "$id": "1035", - "kind": "property", - "name": "function", - "serializedName": "function", - "type": { - "$id": "1036", - "kind": "model", - "name": "ChatCompletionNamedToolChoiceFunction", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice.function.anonymous", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "1037", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "The name of the function to call.", - "type": { - "$id": "1038", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice.function.anonymous.name" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice.function" - } - ] - } - ], - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.tool_choice" - }, - { - "$id": "1039", - "kind": "property", - "name": "parallel_tool_calls", - "serializedName": "parallel_tool_calls", - "type": { - "$id": "1040", - "kind": "boolean", - "name": "ParallelToolCalls", - "crossLanguageDefinitionId": "OpenAI.ParallelToolCalls", - "baseType": { - "$id": "1041", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.parallel_tool_calls" - }, - { - "$id": "1042", - "kind": "property", - "name": "user", - "serializedName": "user", - "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).", - "type": { - "$id": "1043", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.user" - }, - { - "$id": "1044", - "kind": "property", - "name": "function_call", - "serializedName": "function_call", - "description": "Deprecated in favor of `tool_choice`.\n\nControls which (if any) function is called by the model.\n\n`none` means the model will not call a function and instead generates a\nmessage.\n\n`auto` means the model can pick between generating a message or calling a\nfunction.\n\nSpecifying a particular function via `{\"name\": \"my_function\"}` forces the\nmodel to call that function.\n\n`none` is the default when no functions are present. `auto` is the default\nif functions are present.", - "type": { - "$id": "1045", - "kind": "union", - "name": "AzureCreateChatCompletionRequestFunctionCall", - "variantTypes": [ - { - "$id": "1046", - "kind": "constant", - "valueType": { - "$id": "1047", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "none", - "decorators": [] - }, - { - "$id": "1048", - "kind": "constant", - "valueType": { - "$id": "1049", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "auto", - "decorators": [] - }, - { - "$id": "1050", - "kind": "model", - "name": "ChatCompletionFunctionCallOption", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctionCallOption", - "usage": "None", - "description": "Specifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function.", - "decorators": [], - "properties": [ - { - "$id": "1051", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "The name of the function to call.", - "type": { - "$id": "1052", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctionCallOption.name" - } - ] - } - ], - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.function_call" - }, - { - "$id": "1053", - "kind": "property", - "name": "functions", - "serializedName": "functions", - "description": "Deprecated in favor of `tools`.\n\nA list of functions the model may generate JSON inputs for.", - "type": { - "$id": "1054", - "kind": "array", - "name": "ArrayChatCompletionFunctions", - "valueType": { - "$id": "1055", - "kind": "model", - "name": "ChatCompletionFunctions", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctions", - "usage": "None", - "deprecation": "This field is marked as deprecated.", - "decorators": [], - "properties": [ - { - "$id": "1056", - "kind": "property", - "name": "description", - "serializedName": "description", - "description": "A description of what the function does, used by the model to choose when and how to call the function.", - "type": { - "$id": "1057", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctions.description" - }, - { - "$id": "1058", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", - "type": { - "$id": "1059", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctions.name" - }, - { - "$id": "1060", - "kind": "property", - "name": "parameters", - "serializedName": "parameters", - "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\n\nOmitting `parameters` defines a function with an empty parameter list.", - "type": { - "$id": "1061", - "kind": "unknown", - "name": "unknown", - "crossLanguageDefinitionId": "", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctions.parameters" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.functions" - }, - { - "$id": "1062", - "kind": "property", - "name": "data_sources", - "serializedName": "data_sources", - "description": "The data sources to use for the On Your Data feature, exclusive to Azure OpenAI.", - "type": { - "$id": "1063", - "kind": "array", - "name": "ArrayAzureChatDataSource", - "valueType": { - "$ref": "339" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.data_sources" - }, - { - "$id": "1064", - "kind": "property", - "name": "user_security_context", - "serializedName": "user_security_context", - "type": { - "$id": "1065", - "kind": "model", - "name": "AzureUserSecurityContext", - "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext", - "usage": "None", - "description": "User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud.", - "decorators": [], - "properties": [ - { - "$id": "1066", - "kind": "property", - "name": "application_name", - "serializedName": "application_name", - "description": "The name of the application. Sensitive personal information should not be included in this field.", - "type": { - "$id": "1067", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext.application_name" - }, - { - "$id": "1068", - "kind": "property", - "name": "end_user_id", - "serializedName": "end_user_id", - "description": "This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field.", - "type": { - "$id": "1069", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext.end_user_id" - }, - { - "$id": "1070", - "kind": "property", - "name": "end_user_tenant_id", - "serializedName": "end_user_tenant_id", - "description": "The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multitenant.", - "type": { - "$id": "1071", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext.end_user_tenant_id" - }, - { - "$id": "1072", - "kind": "property", - "name": "source_ip", - "serializedName": "source_ip", - "description": "Captures the original client's IP address.", - "type": { - "$id": "1073", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext.source_ip" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.user_security_context" - } - ] - }, - { - "$ref": "785" - }, - { - "$ref": "789" - }, - { - "$ref": "795" - }, - { - "$ref": "805" - }, - { - "$ref": "815" - }, - { - "$ref": "821" - }, - { - "$ref": "825" - }, - { - "$ref": "829" - }, - { - "$ref": "833" - }, - { - "$ref": "842" - }, - { - "$ref": "849" - }, - { - "$ref": "864" - }, - { - "$ref": "869" - }, - { - "$ref": "875" - }, - { - "$ref": "882" - }, - { - "$ref": "887" - }, - { - "$ref": "898" - }, - { - "$ref": "943" - }, - { - "$ref": "946" - }, - { - "$ref": "956" - }, - { - "$ref": "963" - }, - { - "$ref": "967" - }, - { - "$ref": "971" - }, - { - "$ref": "975" - }, - { - "$ref": "980" - }, - { - "$ref": "986" - }, - { - "$ref": "1005" - }, - { - "$ref": "1016" - }, - { - "$ref": "1020" - }, - { - "$ref": "1032" - }, - { - "$ref": "1036" - }, - { - "$ref": "1050" - }, - { - "$ref": "1055" - }, - { - "$ref": "1065" - }, - { - "$id": "1074", - "kind": "model", - "name": "CreateImageRequest", - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "1075", - "kind": "property", - "name": "prompt", - "serializedName": "prompt", - "description": "A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.", - "type": { - "$id": "1076", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.prompt" - }, - { - "$id": "1077", - "kind": "property", - "name": "model", - "serializedName": "model", - "description": "The model to use for image generation.", - "type": { - "$id": "1078", - "kind": "nullable", - "type": { - "$ref": "192" - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.model" - }, - { - "$id": "1079", - "kind": "property", - "name": "n", - "serializedName": "n", - "description": "The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.", - "type": { - "$id": "1080", - "kind": "nullable", - "type": { - "$id": "1081", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.n" - }, - { - "$id": "1082", - "kind": "property", - "name": "quality", - "serializedName": "quality", - "description": "The quality of the image that will be generated. `hd` creates images with finer details and greater consistency across the image. This param is only supported for `dall-e-3`.", - "type": { - "$ref": "198" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.quality" - }, - { - "$id": "1083", - "kind": "property", - "name": "response_format", - "serializedName": "response_format", - "description": "The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated.", - "type": { - "$id": "1084", - "kind": "nullable", - "type": { - "$ref": "204" - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.response_format" - }, - { - "$id": "1085", - "kind": "property", - "name": "size", - "serializedName": "size", - "description": "The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models.", - "type": { - "$id": "1086", - "kind": "nullable", - "type": { - "$ref": "210" - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.size" - }, - { - "$id": "1087", - "kind": "property", - "name": "style", - "serializedName": "style", - "description": "The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`.", - "type": { - "$id": "1088", - "kind": "nullable", - "type": { - "$ref": "222" - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.style" - }, - { - "$id": "1089", - "kind": "property", - "name": "user", - "serializedName": "user", - "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).", - "type": { - "$id": "1090", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.user" - } - ] - }, - { - "$id": "1091", - "kind": "model", - "name": "CreateMessageRequest", - "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "1092", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the entity that is creating the message. Allowed values include:\n- `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.\n- `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.", - "type": { - "$ref": "228" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.role" - }, - { - "$id": "1093", - "kind": "property", - "name": "content", - "serializedName": "content", - "type": { - "$id": "1094", - "kind": "array", - "name": "ArrayMessageContent", - "valueType": { - "$ref": "272" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.content" - }, - { - "$id": "1095", - "kind": "property", - "name": "attachments", - "serializedName": "attachments", - "description": "A list of files attached to the message, and the tools they should be added to.", - "type": { - "$id": "1096", - "kind": "nullable", - "type": { - "$id": "1097", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "1098", - "kind": "model", - "name": "CreateMessageRequestAttachment", - "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.attachment.anonymous", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "1099", - "kind": "property", - "name": "file_id", - "serializedName": "file_id", - "description": "The ID of the file to attach to the message.", - "type": { - "$id": "1100", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.attachment.anonymous.file_id" - }, - { - "$id": "1101", - "kind": "property", - "name": "tools", - "serializedName": "tools", - "description": "The tools to add this file to.", - "type": { - "$id": "1102", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "1103", - "kind": "union", - "name": "CreateMessageRequestAttachmentTool", - "variantTypes": [ - { - "$id": "1104", - "kind": "model", - "name": "AssistantToolsCode", - "crossLanguageDefinitionId": "OpenAI.AssistantToolsCode", - "usage": "None", - "discriminatorValue": "code_interpreter", - "decorators": [], - "baseModel": { - "$id": "1105", - "kind": "model", - "name": "AssistantToolDefinition", - "crossLanguageDefinitionId": "OpenAI.AssistantToolDefinition", - "usage": "None", - "decorators": [], - "discriminatorProperty": { - "$id": "1106", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "1107", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolDefinition.type" - }, - "properties": [ - { - "$ref": "1106" - } - ], - "discriminatedSubtypes": { - "$id": "1108", - "code_interpreter": { - "$ref": "1104" - }, - "file_search": { - "$id": "1109", - "kind": "model", - "name": "AssistantToolsFileSearch", - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch", - "usage": "None", - "discriminatorValue": "file_search", - "decorators": [], - "baseModel": { - "$ref": "1105" - }, - "properties": [ - { - "$id": "1110", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of tool being defined: `file_search`", - "type": { - "$id": "1111", - "kind": "constant", - "valueType": { - "$id": "1112", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "file_search", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.type" - }, - { - "$id": "1113", - "kind": "property", - "name": "file_search", - "serializedName": "file_search", - "description": "Overrides for the file search tool.", - "type": { - "$id": "1114", - "kind": "model", - "name": "AssistantToolsFileSearchFileSearch", - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.file_search.anonymous", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "1115", - "kind": "property", - "name": "max_num_results", - "serializedName": "max_num_results", - "description": "The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive.\n\nNote that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.", - "type": { - "$id": "1116", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.file_search.anonymous.max_num_results" - }, - { - "$id": "1117", - "kind": "property", - "name": "ranking_options", - "serializedName": "ranking_options", - "type": { - "$id": "1118", - "kind": "model", - "name": "FileSearchRankingOptions", - "crossLanguageDefinitionId": "OpenAI.FileSearchRankingOptions", - "usage": "None", - "description": "The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.\n\nSee the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.", - "decorators": [], - "properties": [ - { - "$id": "1119", - "kind": "property", - "name": "ranker", - "serializedName": "ranker", - "description": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "$ref": "234" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.FileSearchRankingOptions.ranker" - }, - { - "$id": "1120", - "kind": "property", - "name": "score_threshold", - "serializedName": "score_threshold", - "description": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "$id": "1121", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.FileSearchRankingOptions.score_threshold" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.file_search.anonymous.ranking_options" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.file_search" - } - ] - }, - "function": { - "$id": "1122", - "kind": "model", - "name": "AssistantToolsFunction", - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFunction", - "usage": "None", - "discriminatorValue": "function", - "decorators": [], - "baseModel": { - "$ref": "1105" - }, - "properties": [ - { - "$id": "1123", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of tool being defined: `function`", - "type": { - "$id": "1124", - "kind": "constant", - "valueType": { - "$id": "1125", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "function", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFunction.type" - }, - { - "$id": "1126", - "kind": "property", - "name": "function", - "serializedName": "function", - "type": { - "$ref": "1020" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFunction.function" - } - ] - } - } - }, - "properties": [ - { - "$id": "1127", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of tool being defined: `code_interpreter`", - "type": { - "$id": "1128", - "kind": "constant", - "valueType": { - "$id": "1129", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "code_interpreter", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolsCode.type" - } - ] - }, - { - "$id": "1130", - "kind": "model", - "name": "AssistantToolsFileSearchTypeOnly", - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearchTypeOnly", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "1131", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of tool being defined: `file_search`", - "type": { - "$id": "1132", - "kind": "constant", - "valueType": { - "$ref": "240" - }, - "value": "file_search", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearchTypeOnly.type" - } - ] - } - ], - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.attachment.anonymous.tools" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.attachments" - }, - { - "$id": "1133", - "kind": "property", - "name": "metadata", - "serializedName": "metadata", - "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.", - "type": { - "$id": "1134", - "kind": "dict", - "keyType": { - "$id": "1135", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "1136", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.metadata" - } - ] - }, - { - "$ref": "1098" - }, - { - "$ref": "1104" - }, - { - "$ref": "1105" - }, - { - "$ref": "1109" - }, - { - "$ref": "1114" - }, - { - "$ref": "1118" - }, - { - "$ref": "1122" - }, - { - "$ref": "1130" - }, - { - "$id": "1137", - "kind": "model", - "name": "MessageObject", - "crossLanguageDefinitionId": "OpenAI.MessageObject", - "usage": "None", - "description": "Represents a message within a [thread](/docs/api-reference/threads).", - "decorators": [], - "properties": [ - { - "$id": "1138", - "kind": "property", - "name": "id", - "serializedName": "id", - "description": "The identifier, which can be referenced in API endpoints.", - "type": { - "$id": "1139", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.id" - }, - { - "$id": "1140", - "kind": "property", - "name": "object", - "serializedName": "object", - "description": "The object type, which is always `thread.message`.", - "type": { - "$id": "1141", - "kind": "constant", - "valueType": { - "$ref": "243" - }, - "value": "thread.message", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.object" - }, - { - "$id": "1142", - "kind": "property", - "name": "created_at", - "serializedName": "created_at", - "description": "The Unix timestamp (in seconds) for when the message was created.", - "type": { - "$id": "1143", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "unixTimestamp", - "wireType": { - "$id": "1144", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.created_at" - }, - { - "$id": "1145", - "kind": "property", - "name": "thread_id", - "serializedName": "thread_id", - "description": "The [thread](/docs/api-reference/threads) ID that this message belongs to.", - "type": { - "$id": "1146", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.thread_id" - }, - { - "$id": "1147", - "kind": "property", - "name": "status", - "serializedName": "status", - "description": "The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.", - "type": { - "$ref": "246" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.status" - }, - { - "$id": "1148", - "kind": "property", - "name": "incomplete_details", - "serializedName": "incomplete_details", - "description": "On an incomplete message, details about why the message is incomplete.", - "type": { - "$id": "1149", - "kind": "nullable", - "type": { - "$id": "1150", - "kind": "model", - "name": "MessageObjectIncompleteDetails", - "crossLanguageDefinitionId": "OpenAI.MessageObject.incomplete_details.anonymous", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "1151", - "kind": "property", - "name": "reason", - "serializedName": "reason", - "description": "The reason the message is incomplete.", - "type": { - "$ref": "254" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.incomplete_details.anonymous.reason" - } - ] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.incomplete_details" - }, - { - "$id": "1152", - "kind": "property", - "name": "completed_at", - "serializedName": "completed_at", - "description": "The Unix timestamp (in seconds) for when the message was completed.", - "type": { - "$id": "1153", - "kind": "nullable", - "type": { - "$id": "1154", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "unixTimestamp", - "wireType": { - "$id": "1155", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.completed_at" - }, - { - "$id": "1156", - "kind": "property", - "name": "incomplete_at", - "serializedName": "incomplete_at", - "description": "The Unix timestamp (in seconds) for when the message was marked as incomplete.", - "type": { - "$id": "1157", - "kind": "nullable", - "type": { - "$id": "1158", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "unixTimestamp", - "wireType": { - "$id": "1159", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.incomplete_at" - }, - { - "$id": "1160", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The entity that produced the message. One of `user` or `assistant`.", - "type": { - "$ref": "266" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.role" - }, - { - "$id": "1161", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The content of the message in array of text and/or images.", - "type": { - "$id": "1162", - "kind": "array", - "name": "ArrayMessageContent", - "valueType": { - "$ref": "272" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": true, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.content" - }, - { - "$id": "1163", - "kind": "property", - "name": "assistant_id", - "serializedName": "assistant_id", - "description": "If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message.", - "type": { - "$id": "1164", - "kind": "nullable", - "type": { - "$id": "1165", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.assistant_id" - }, - { - "$id": "1166", - "kind": "property", - "name": "run_id", - "serializedName": "run_id", - "description": "The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints.", - "type": { - "$id": "1167", - "kind": "nullable", - "type": { - "$id": "1168", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.run_id" - }, - { - "$id": "1169", - "kind": "property", - "name": "attachments", - "serializedName": "attachments", - "description": "A list of files attached to the message, and the tools they were added to.", - "type": { - "$id": "1170", - "kind": "nullable", - "type": { - "$id": "1171", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "1172", - "kind": "model", - "name": "MessageObjectAttachment", - "crossLanguageDefinitionId": "OpenAI.MessageObject.attachment.anonymous", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "1173", - "kind": "property", - "name": "file_id", - "serializedName": "file_id", - "description": "The ID of the file to attach to the message.", - "type": { - "$id": "1174", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.attachment.anonymous.file_id" - }, - { - "$id": "1175", - "kind": "property", - "name": "tools", - "serializedName": "tools", - "description": "The tools to add this file to.", - "type": { - "$id": "1176", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "1177", - "kind": "union", - "name": "MessageObjectAttachmentTool", - "variantTypes": [ - { - "$ref": "1104" - }, - { - "$ref": "1130" - } - ], - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.attachment.anonymous.tools" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.attachments" - }, - { - "$id": "1178", - "kind": "property", - "name": "metadata", - "serializedName": "metadata", - "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.", - "type": { - "$id": "1179", - "kind": "nullable", - "type": { - "$id": "1180", - "kind": "dict", - "keyType": { - "$id": "1181", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "1182", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "decorators": [] - } - }, - "optional": false, - "readOnly": true, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.metadata" - } - ] - }, - { - "$ref": "1150" - }, - { - "$ref": "1172" - } - ], - "Clients": [ - { - "$id": "1183", - "Name": "AzureOpenAIClient", - "Operations": [], - "Protocol": { - "$id": "1184" - }, - "Parameters": [ - { - "$id": "1185", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", - "Type": { - "$id": "1186", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client" - } - ], - "Decorators": [] - }, - { - "$id": "1187", - "Name": "AzureChat", - "Operations": [ - { - "$id": "1188", - "Name": "createChatCompletion", - "ResourceName": "AzureChat", - "Accessibility": "public", - "Parameters": [ - { - "$id": "1189", - "Name": "deployment_id", - "NameInRequest": "deployment_id", - "Type": { - "$id": "1190", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "Location": "Path", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1191", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Description": "Body parameter's content type. Known values are application/json", - "Type": { - "$id": "1192", - "kind": "constant", - "valueType": { - "$id": "1193", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1194", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "1195", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1196", - "Name": "request", - "NameInRequest": "request", - "Type": { - "$ref": "782" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "1197", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "739" - }, - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false, - "ContentTypes": [ - "application/json", - "application/json", - "application/json" - ] - } - ], - "HttpMethod": "POST", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}/openai", - "Path": "/{deployment_id}/chat/completions", - "RequestMediaTypes": [ - "application/json" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": false, - "CrossLanguageDefinitionId": "AzureOpenAI.AzureChat.createChatCompletion", - "Decorators": [] - } - ], - "Protocol": { - "$id": "1198" - }, - "Parent": "AzureOpenAIClient", - "Parameters": [ - { - "$id": "1199", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", - "Type": { - "$id": "1200", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client" - } - ], - "Decorators": [] - }, - { - "$id": "1201", - "Name": "AzureImages", - "Operations": [ - { - "$id": "1202", - "Name": "createImage", - "ResourceName": "AzureImages", - "Accessibility": "public", - "Parameters": [ - { - "$id": "1203", - "Name": "deploymentId", - "NameInRequest": "deploymentId", - "Type": { - "$id": "1204", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "Location": "Path", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1205", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Description": "Body parameter's content type. Known values are application/json", - "Type": { - "$id": "1206", - "kind": "constant", - "valueType": { - "$id": "1207", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1208", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "1209", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1210", - "Name": "image", - "NameInRequest": "image", - "Type": { - "$ref": "1074" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "1211", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "293" - }, - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false, - "ContentTypes": [ - "application/json", - "application/json" - ] - } - ], - "HttpMethod": "POST", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}/openai", - "Path": "/deployments/{deploymentId}/images/generations", - "RequestMediaTypes": [ - "application/json" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": false, - "CrossLanguageDefinitionId": "AzureOpenAI.AzureImages.createImage", - "Decorators": [] - } - ], - "Protocol": { - "$id": "1212" - }, - "Parent": "AzureOpenAIClient", - "Parameters": [ - { - "$id": "1213", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", - "Type": { - "$id": "1214", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client" - } - ], - "Decorators": [] - }, - { - "$id": "1215", - "Name": "AzureMessages", - "Operations": [ - { - "$id": "1216", - "Name": "createMessage", - "ResourceName": "AzureMessages", - "Summary": "Create a message.", - "Accessibility": "public", - "Parameters": [ - { - "$id": "1217", - "Name": "thread_id", - "NameInRequest": "thread_id", - "Description": "The ID of the [thread](/docs/api-reference/threads) to create a message for.", - "Type": { - "$id": "1218", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "Location": "Path", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1219", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Description": "Body parameter's content type. Known values are application/json", - "Type": { - "$id": "1220", - "kind": "constant", - "valueType": { - "$id": "1221", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1222", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "1223", - "kind": "constant", - "valueType": { - "$id": "1224", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1225", - "Name": "requestBody", - "NameInRequest": "requestBody", - "Type": { - "$ref": "1091" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "1226", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "1137" - }, - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false, - "ContentTypes": [ - "application/json" - ] - } - ], - "HttpMethod": "POST", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}/openai", - "Path": "/threads/{thread_id}/messages", - "RequestMediaTypes": [ - "application/json" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": false, - "CrossLanguageDefinitionId": "AzureOpenAI.AzureMessages.createMessage", - "Decorators": [] - } - ], - "Protocol": { - "$id": "1227" - }, - "Parent": "AzureOpenAIClient", - "Parameters": [ - { - "$id": "1228", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", - "Type": { - "$id": "1229", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client" - } - ], - "Decorators": [] - } - ], - "Auth": { - "$id": "1230", - "ApiKey": { - "$id": "1231", - "Name": "api-key" - }, - "OAuth2": { - "$id": "1232", - "Scopes": [ - "https://cognitiveservices.azure.com/.default" - ] - } - } -} diff --git a/.plugin.azure/generator/src/AzureOpenAILibraryPlugin.cs b/.plugin.azure/generator/src/AzureOpenAILibraryPlugin.cs index 16b818c44..6c4f6cf9b 100644 --- a/.plugin.azure/generator/src/AzureOpenAILibraryPlugin.cs +++ b/.plugin.azure/generator/src/AzureOpenAILibraryPlugin.cs @@ -14,8 +14,13 @@ public AzureOpenAILibraryPlugin(GeneratorContext context) : base(context) { } public override void Configure() { base.Configure(); - AddVisitor(new AzureOpenAILibraryVisitor()); + // AddVisitor(new AzureOpenAILibraryVisitor()); AddVisitor(new DocEditVisitor()); + AddVisitor(new AdditionalPropertiesVisitor()); + AddVisitor(new ModelSerializationEmptySentinelVisitor()); + AddVisitor(new WriteableSardVisitor()); + AddVisitor(new TypeRemovalVisitor()); + AddVisitor(new InternalSettablePropertiesVisitor()); } } } \ No newline at end of file diff --git a/.plugin.azure/generator/src/AzureOpenAILibraryVisitor.cs b/.plugin.azure/generator/src/Visitors/AdditionalPropertiesVisitor.cs similarity index 68% rename from .plugin.azure/generator/src/AzureOpenAILibraryVisitor.cs rename to .plugin.azure/generator/src/Visitors/AdditionalPropertiesVisitor.cs index 32d6c42bc..6dcd9f9ca 100644 --- a/.plugin.azure/generator/src/AzureOpenAILibraryVisitor.cs +++ b/.plugin.azure/generator/src/Visitors/AdditionalPropertiesVisitor.cs @@ -12,16 +12,14 @@ namespace AzureOpenAILibraryPlugin { - public class AzureOpenAILibraryVisitor : ScmLibraryVisitor + public class AdditionalPropertiesVisitor : ScmLibraryVisitor { private const string RawDataPropertyName = "SerializedAdditionalRawData"; private const string AdditionalPropertiesFieldName = "_additionalBinaryDataProperties"; - private const string SentinelValueFieldName = "_sentinelValue"; private const string WritePropertyNameMethodCall = "WritePropertyName(\""; - private const string ModelSerializationExtensionsTypeName = "ModelSerializationExtensions"; private const string IsSentinelValueMethodName = "IsSentinelValue"; private const string JsonModelWriteCoreMethodName = "JsonModelWriteCore"; - + protected override TypeProvider Visit(TypeProvider type) { if (type is ModelProvider { BaseModelProvider: null }) @@ -37,60 +35,12 @@ protected override TypeProvider Visit(TypeProvider type) type.DeclarationModifiers.HasFlag(TypeSignatureModifiers.ReadOnly) ? null : additionalPropertiesField.Assign(Value)), type) }; - - type.Update(properties: properties); - } - else if (type.Name == ModelSerializationExtensionsTypeName) - { - // Add a static BinaryData field representing the sentinel value - var sentinelValueField = new FieldProvider( - FieldModifiers.Private | FieldModifiers.Static | FieldModifiers.ReadOnly, - typeof(BinaryData), - SentinelValueFieldName, - type, - $"", - BinaryDataSnippets.FromBytes(LiteralU8("\"__EMPTY__\"").Invoke("ToArray"))); - var fields = new List(type.Fields) - { - sentinelValueField - }; - // Add the IsSentinelValue method - var valueParameter = new ParameterProvider("value", $"", typeof(BinaryData)); - var methods = new List(type.Methods) - { - new MethodProvider( - new MethodSignature( - IsSentinelValueMethodName, - $"", - MethodSignatureModifiers.Internal | MethodSignatureModifiers.Static, - typeof(bool), - $"", - [valueParameter]), - new[] - { - Declare("sentinelSpan", typeof(ReadOnlySpan), sentinelValueField.As().ToMemory().Property("Span"), out var sentinelVariable), - Declare("valueSpan", typeof(ReadOnlySpan), valueParameter.As().ToMemory().Property("Span"), out var valueVariable), - Return(sentinelVariable.Invoke("SequenceEqual", valueVariable)) - }, - type) - }; - - type.Update(fields: fields, methods: methods); + type.Update(properties: properties); } return type; } - protected override FieldProvider Visit(FieldProvider field) - { - // Make the backing additional properties field not be read only as long as the type is not readonly. - if (field.Name == AdditionalPropertiesFieldName && !field.EnclosingType.DeclarationModifiers.HasFlag(TypeSignatureModifiers.ReadOnly)) - { - field.Modifiers &= ~FieldModifiers.ReadOnly; - } - return field; - } - protected override MethodProvider Visit(MethodProvider method) { if (method.Signature.Name != JsonModelWriteCoreMethodName) @@ -171,7 +121,7 @@ protected override MethodProvider Visit(MethodProvider method) updatedStatements.Add(statement); } } - + method.Update(bodyStatements: updatedStatements); return method; } diff --git a/.plugin.azure/generator/src/DocEditVisitor.cs b/.plugin.azure/generator/src/Visitors/DocEditVisitor.cs similarity index 100% rename from .plugin.azure/generator/src/DocEditVisitor.cs rename to .plugin.azure/generator/src/Visitors/DocEditVisitor.cs diff --git a/.plugin.azure/generator/src/Visitors/InternalSettablePropertiesVisitor.cs b/.plugin.azure/generator/src/Visitors/InternalSettablePropertiesVisitor.cs new file mode 100644 index 000000000..daa4357f3 --- /dev/null +++ b/.plugin.azure/generator/src/Visitors/InternalSettablePropertiesVisitor.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection.Metadata.Ecma335; +using System.Runtime.CompilerServices; +using System.Text.RegularExpressions; +using Microsoft.Generator.CSharp.ClientModel; +using Microsoft.Generator.CSharp.ClientModel.Providers; +using Microsoft.Generator.CSharp.Primitives; +using Microsoft.Generator.CSharp.Providers; +using Microsoft.Generator.CSharp.Snippets; +using Microsoft.Generator.CSharp.Statements; +using static Microsoft.Generator.CSharp.Snippets.Snippet; + +namespace AzureOpenAILibraryPlugin +{ + public class InternalSettablePropertiesVisitor : ScmLibraryVisitor + { + protected override TypeProvider? Visit(TypeProvider type) + { + if (type.Name.Contains("Internal") && type.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)) + { + foreach (PropertyProvider property in type.Properties) + { + if (property.Body is AutoPropertyBody autoPropertyBody && !property.Body.HasSetter) + { + PropertyBody updatedBody = new AutoPropertyBody( + HasSetter: true, + autoPropertyBody.SetterModifiers, + autoPropertyBody.InitializationExpression); + property.Update(body: updatedBody); + } + } + } + return type; + } + } +} diff --git a/.plugin.azure/generator/src/Visitors/ModelSerializationEmptySentinelVisitor.cs b/.plugin.azure/generator/src/Visitors/ModelSerializationEmptySentinelVisitor.cs new file mode 100644 index 000000000..3bcd525f9 --- /dev/null +++ b/.plugin.azure/generator/src/Visitors/ModelSerializationEmptySentinelVisitor.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using Microsoft.Generator.CSharp.ClientModel; +using Microsoft.Generator.CSharp.ClientModel.Providers; +using Microsoft.Generator.CSharp.Primitives; +using Microsoft.Generator.CSharp.Providers; +using Microsoft.Generator.CSharp.Snippets; +using Microsoft.Generator.CSharp.Statements; +using static Microsoft.Generator.CSharp.Snippets.Snippet; + +namespace AzureOpenAILibraryPlugin +{ + public class ModelSerializationEmptySentinelVisitor : ScmLibraryVisitor + { + private const string ModelSerializationExtensionsTypeName = "ModelSerializationExtensions"; + private const string SentinelValueFieldName = "_sentinelValue"; + private const string IsSentinelValueMethodName = "IsSentinelValue"; + + protected override TypeProvider Visit(TypeProvider type) + { + if (type.Name == ModelSerializationExtensionsTypeName) + { + // Add a static BinaryData field representing the sentinel value + var sentinelValueField = new FieldProvider( + FieldModifiers.Private | FieldModifiers.Static | FieldModifiers.ReadOnly, + typeof(BinaryData), + SentinelValueFieldName, + type, + $"", + BinaryDataSnippets.FromBytes(LiteralU8("\"__EMPTY__\"").Invoke("ToArray"))); + var fields = new List(type.Fields) + { + sentinelValueField + }; + + // Add the IsSentinelValue method + var valueParameter = new ParameterProvider("value", $"", typeof(BinaryData)); + var methods = new List(type.Methods) + { + new MethodProvider( + new MethodSignature( + IsSentinelValueMethodName, + $"", + MethodSignatureModifiers.Internal | MethodSignatureModifiers.Static, + typeof(bool), + $"", + [valueParameter]), + new[] + { + Declare("sentinelSpan", typeof(ReadOnlySpan), sentinelValueField.As().ToMemory().Property("Span"), out var sentinelVariable), + Declare("valueSpan", typeof(ReadOnlySpan), valueParameter.As().ToMemory().Property("Span"), out var valueVariable), + Return(sentinelVariable.Invoke("SequenceEqual", valueVariable)) + }, + type) + }; + + type.Update(fields: fields, methods: methods); + } + return type; + } + } +} diff --git a/.plugin.azure/generator/src/Visitors/TypeRemovalVisitor.cs b/.plugin.azure/generator/src/Visitors/TypeRemovalVisitor.cs new file mode 100644 index 000000000..02bb68382 --- /dev/null +++ b/.plugin.azure/generator/src/Visitors/TypeRemovalVisitor.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Runtime.CompilerServices; +using System.Text.RegularExpressions; +using Microsoft.Generator.CSharp.ClientModel; +using Microsoft.Generator.CSharp.ClientModel.Providers; +using Microsoft.Generator.CSharp.Primitives; +using Microsoft.Generator.CSharp.Providers; +using Microsoft.Generator.CSharp.Snippets; +using Microsoft.Generator.CSharp.Statements; +using static Microsoft.Generator.CSharp.Snippets.Snippet; + +namespace AzureOpenAILibraryPlugin +{ + public class TypeRemovalVisitor : ScmLibraryVisitor + { + private static readonly string[] PatternsToKeep = + [ + ".*BingSearchTool.*", + ".*DataSource.*", + ".*ContentFilter.*", + ".*OpenAI.*Error.*", + ".*Context.*", + ".*RetrievedDoc.*", + ".*ChatDocument.*", + ".*Citation.*", + "Argument", + "BinaryContentHelper", + "ChangeTracking.*", + "ClientPipelineExtensions", + "ClientUriBuilder", + "ErrorResult", + "ModelSerializationExtensions", + "Optional", + "PipelineRequestHeadersExtensions", + "TypeFormatters", + "Utf8JsonBinaryContent", + ]; + private static readonly string[] PatternsToStillDeleteAfterPatternsToKeep = + [ + "AzureOpenAIFile.*", + "BingSearchToolDefinition.cs", + ".*Elasticsearch*QueryType.*", + ".*FieldsMapping.*", + ".*ContentTextAnnotationsFileCitation.*" + ]; + + protected override TypeProvider? Visit(TypeProvider type) + { + if (PatternsToKeep.Any(patternToKeep => Regex.IsMatch(type.Name, patternToKeep) + && !PatternsToStillDeleteAfterPatternsToKeep.Any(patternToStillDelete => Regex.IsMatch(type.Name, patternToStillDelete)))) + { + return type; + } + return null; + } + } +} diff --git a/.plugin.azure/generator/src/Visitors/WriteableSardVisitor.cs b/.plugin.azure/generator/src/Visitors/WriteableSardVisitor.cs new file mode 100644 index 000000000..08efae949 --- /dev/null +++ b/.plugin.azure/generator/src/Visitors/WriteableSardVisitor.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using Microsoft.Generator.CSharp.ClientModel; +using Microsoft.Generator.CSharp.ClientModel.Providers; +using Microsoft.Generator.CSharp.Primitives; +using Microsoft.Generator.CSharp.Providers; +using Microsoft.Generator.CSharp.Snippets; +using Microsoft.Generator.CSharp.Statements; +using static Microsoft.Generator.CSharp.Snippets.Snippet; + +namespace AzureOpenAILibraryPlugin +{ + public class WriteableSardVisitor : ScmLibraryVisitor + { + private const string AdditionalPropertiesFieldName = "_additionalBinaryDataProperties"; + + protected override FieldProvider Visit(FieldProvider field) + { + // Make the backing additional properties field not be read only as long as the type is not readonly. + if (field.Name == AdditionalPropertiesFieldName && !field.EnclosingType.DeclarationModifiers.HasFlag(TypeSignatureModifiers.ReadOnly)) + { + field.Modifiers &= ~FieldModifiers.ReadOnly; + } + return field; + } + } +} diff --git a/.scripts.azure/Invoke-CodeGen.ps1 b/.scripts.azure/Invoke-CodeGen.ps1 index 1d0ace522..2f2aa2bc0 100644 --- a/.scripts.azure/Invoke-CodeGen.ps1 +++ b/.scripts.azure/Invoke-CodeGen.ps1 @@ -1,6 +1,4 @@ $repoRoot = Join-Path $PSScriptRoot .. -Resolve -$dotnetAzureFolder = Join-Path $repoRoot .dotnet.azure -$generatedFolder = Join-Path $dotnetAzureFolder sdk/openai/Azure.AI.OpenAI/src/Generated function Invoke([scriptblock]$script) { $scriptString = $script | Out-String @@ -8,84 +6,14 @@ function Invoke([scriptblock]$script) { & $script } -function Make-Internals-Settable { - Get-ChildItem "$generatedFolder" -File -Filter "Internal*.cs" | ForEach-Object { - $content = Get-Content $_.FullName -Raw - $newContent = $content -replace 'public(.*?)\{ get; \}', 'internal$1{ get; set; }' - Set-Content -Path $_.FullName -Value $newContent -NoNewline - } -} - -function Partialize-ClientPipelineExtensions { - $file = Get-ChildItem -Path "$generatedFolder\Internal\ClientPipelineExtensions.cs" - $content = Get-Content -Path $file -Raw - Write-Output "Editing $($file.FullName)" - $content = $content -creplace "internal static class ClientPipelineExtensions", "internal static partial class ClientPipelineExtensions" - $content | Set-Content -Path $file.FullName -NoNewline -} - -function Partialize-ClientUriBuilder { - $file = Get-ChildItem -Path "$generatedFolder\Internal\ClientUriBuilder.cs" - $content = Get-Content -Path $file -Raw - Write-Output "Editing $($file.FullName)" - $content = $content -creplace "internal class ClientUriBuilder", "internal partial class ClientUriBuilder" - $content | Set-Content -Path $file.FullName -NoNewline -} - -function Prune-Generated-Files { - $patternsToKeep = @( - "*BingSearchTool*", - "*DataSource*", - "*ContentFilter*", - "*OpenAI*Error*", - "*Context*", - "*RetrievedDoc*", - "*ChatDocument*", - "*Citation*" - ) - $patternsToDelete = @( - "AzureOpenAIFile*", - "BingSearchToolDefinition.cs", - "*Elasticsearch*QueryType*", - "*FieldsMapping*", - "*ContentTextAnnotationsFileCitation*" - ) - - Get-ChildItem "$generatedFolder" -File | ForEach-Object { - $generatedFile = $_; - $generatedFilename = $_.Name; - $keepFile = $false - foreach ($pattern in $patternsToKeep) { - if ($generatedFilename -like "$pattern") { - $keepFile = $true - foreach ($deletePattern in $patternsToDelete) { - if ($generatedFilename -like $deletePattern) { - $keepFile = $false - break - } - } - break - } - } - if (-not $keepFile) { - Write-Output "Removing: $generatedFilename" - Remove-Item $generatedFile - } - } -} - Push-Location $repoRoot try { - Invoke { npm ci } - Invoke { npm run build -w .plugin.azure } Set-Location $repoRoot/.typespec.azure + Invoke { npm ci } Invoke { npm exec --no -- tsp format **/*tsp } Invoke { npm exec --no -- tsp compile . } - Invoke { Move-Item $generatedFolder/Models/* $generatedFolder } - Prune-Generated-Files - Make-Internals-Settable - Partialize-ClientPipelineExtensions - Partialize-ClientUriBuilder + Set-Location $repoRoot + Invoke { npm run build -w .plugin.azure } } finally { Pop-Location diff --git a/.typespec.azure/tspconfig.yaml b/.typespec.azure/tspconfig.yaml index 7c1d801be..d8aee255f 100644 --- a/.typespec.azure/tspconfig.yaml +++ b/.typespec.azure/tspconfig.yaml @@ -8,14 +8,5 @@ options: "@azure-openai/plugin": namespace: "Azure.AI.OpenAI" emitter-output-dir: "{project-root}/../.dotnet.azure/sdk/openai/Azure.AI.OpenAI" - generate-convenience-methods: false unreferenced-types-handling: keepAll - model-namespace: false - generate-test-project: false - single-top-level-client: true - new-project: false - flavor: "unbranded" - enable-internal-raw-data: true - # disable-xml-docs: true - save-inputs: true - generate-model-factory: false + new-project: false \ No newline at end of file From f260e61b783c31b675405eb86623f89aad585d17 Mon Sep 17 00:00:00 2001 From: Travis Wilson Date: Fri, 14 Feb 2025 11:07:41 -0800 Subject: [PATCH 5/8] minor -- correct fresh setup ordering and add parity timing info to script --- .scripts.azure/Invoke-CodeGen.ps1 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.scripts.azure/Invoke-CodeGen.ps1 b/.scripts.azure/Invoke-CodeGen.ps1 index 2f2aa2bc0..7262050e9 100644 --- a/.scripts.azure/Invoke-CodeGen.ps1 +++ b/.scripts.azure/Invoke-CodeGen.ps1 @@ -6,15 +6,23 @@ function Invoke([scriptblock]$script) { & $script } +$scriptStartTime = Get-Date + Push-Location $repoRoot + try { - Set-Location $repoRoot/.typespec.azure Invoke { npm ci } + Invoke { npm run build -w .plugin.azure } + Set-Location $repoRoot/.typespec.azure Invoke { npm exec --no -- tsp format **/*tsp } Invoke { npm exec --no -- tsp compile . } - Set-Location $repoRoot - Invoke { npm run build -w .plugin.azure } } finally { Pop-Location } + +$scriptElapsed = $(Get-Date) - $scriptStartTime +$scriptElapsedSeconds = [math]::Round($scriptElapsed.TotalSeconds, 1) +$scriptName = $MyInvocation.MyCommand.Name + +Write-Host "${scriptName} complete. Time: ${scriptElapsedSeconds}s" \ No newline at end of file From 284c7e401d35324d7c260880321a6b1bb03954fc Mon Sep 17 00:00:00 2001 From: Travis Wilson Date: Fri, 14 Feb 2025 11:35:22 -0800 Subject: [PATCH 6/8] require/use save-inputs for now --- .../openai/Azure.AI.OpenAI/Configuration.json | 7 + .../openai/Azure.AI.OpenAI/tspCodeModel.json | 14442 ++++++++++++++++ .../generator/src/AzureOpenAILibraryPlugin.cs | 2 +- .plugin.azure/tspconfig.yaml | 4 - .typespec.azure/tspconfig.yaml | 3 +- 5 files changed, 14452 insertions(+), 6 deletions(-) create mode 100644 .dotnet.azure/sdk/openai/Azure.AI.OpenAI/Configuration.json create mode 100644 .dotnet.azure/sdk/openai/Azure.AI.OpenAI/tspCodeModel.json delete mode 100644 .plugin.azure/tspconfig.yaml diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/Configuration.json b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/Configuration.json new file mode 100644 index 000000000..2a48b3996 --- /dev/null +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/Configuration.json @@ -0,0 +1,7 @@ +{ + "output-folder": ".", + "namespace": "Azure.AI.OpenAI", + "library-name": "Azure.AI.OpenAI", + "unreferenced-types-handling": "keepAll", + "use-model-reader-writer": true +} diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/tspCodeModel.json b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/tspCodeModel.json new file mode 100644 index 000000000..648048ede --- /dev/null +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/tspCodeModel.json @@ -0,0 +1,14442 @@ +{ + "$id": "1", + "Name": "AzureOpenAI", + "ApiVersions": [ + "2024-06-01", + "2024-08-01-preview", + "2024-09-01-preview", + "2024-10-01-preview", + "2024-10-21", + "2024-12-01-preview", + "2025-01-01-preview" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "CreateMessageRequestRole", + "crossLanguageDefinitionId": "CreateMessageRequest.role.anonymous", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "assistant", + "value": "assistant", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "8", + "kind": "enum", + "name": "FileSearchRankingOptionsRanker", + "crossLanguageDefinitionId": "FileSearchRankingOptions.ranker.anonymous", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "10", + "kind": "enumvalue", + "name": "auto", + "value": "auto", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "decorators": [] + }, + { + "$id": "12", + "kind": "enumvalue", + "name": "default_2024_08_21", + "value": "default_2024_08_21", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + { + "$id": "14", + "kind": "enum", + "name": "AssistantToolsFileSearchTypeOnly_type", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "16", + "kind": "enumvalue", + "name": "file_search", + "value": "file_search", + "description": "file_search", + "valueType": { + "$ref": "15" + }, + "enumType": { + "$ref": "14" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The AssistantToolsFileSearchTypeOnly_type", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "17", + "kind": "enum", + "name": "MessageObject_object", + "valueType": { + "$id": "18", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "19", + "kind": "enumvalue", + "name": "thread.message", + "value": "thread.message", + "description": "thread.message", + "valueType": { + "$ref": "18" + }, + "enumType": { + "$ref": "17" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The MessageObject_object", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "20", + "kind": "enum", + "name": "MessageObjectStatus", + "crossLanguageDefinitionId": "MessageObject.status.anonymous", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "22", + "kind": "enumvalue", + "name": "in_progress", + "value": "in_progress", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "20" + }, + "decorators": [] + }, + { + "$id": "24", + "kind": "enumvalue", + "name": "incomplete", + "value": "incomplete", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "20" + }, + "decorators": [] + }, + { + "$id": "26", + "kind": "enumvalue", + "name": "completed", + "value": "completed", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "20" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "28", + "kind": "enum", + "name": "MessageObjectIncompleteDetailsReason", + "crossLanguageDefinitionId": "MessageObject.incomplete_details.reason.anonymous", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "30", + "kind": "enumvalue", + "name": "content_filter", + "value": "content_filter", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "28" + }, + "decorators": [] + }, + { + "$id": "32", + "kind": "enumvalue", + "name": "max_tokens", + "value": "max_tokens", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "28" + }, + "decorators": [] + }, + { + "$id": "34", + "kind": "enumvalue", + "name": "run_cancelled", + "value": "run_cancelled", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "28" + }, + "decorators": [] + }, + { + "$id": "36", + "kind": "enumvalue", + "name": "run_expired", + "value": "run_expired", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "28" + }, + "decorators": [] + }, + { + "$id": "38", + "kind": "enumvalue", + "name": "run_failed", + "value": "run_failed", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "28" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "40", + "kind": "enum", + "name": "MessageObjectRole", + "crossLanguageDefinitionId": "MessageObject.role.anonymous", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "42", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "40" + }, + "decorators": [] + }, + { + "$id": "44", + "kind": "enumvalue", + "name": "assistant", + "value": "assistant", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "40" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "46", + "kind": "enum", + "name": "CreateImageRequestModel", + "crossLanguageDefinitionId": "CreateImageRequest.model.anonymous", + "valueType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "48", + "kind": "enumvalue", + "name": "dall-e-2", + "value": "dall-e-2", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "46" + }, + "decorators": [] + }, + { + "$id": "50", + "kind": "enumvalue", + "name": "dall-e-3", + "value": "dall-e-3", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "46" + }, + "decorators": [] + } + ], + "isFixed": false, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "52", + "kind": "enum", + "name": "CreateImageRequestQuality", + "crossLanguageDefinitionId": "CreateImageRequest.quality.anonymous", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "54", + "kind": "enumvalue", + "name": "standard", + "value": "standard", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "decorators": [] + }, + { + "$id": "56", + "kind": "enumvalue", + "name": "hd", + "value": "hd", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "58", + "kind": "enum", + "name": "CreateImageRequestResponseFormat", + "crossLanguageDefinitionId": "CreateImageRequest.response_format.anonymous", + "valueType": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "60", + "kind": "enumvalue", + "name": "url", + "value": "url", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "58" + }, + "decorators": [] + }, + { + "$id": "62", + "kind": "enumvalue", + "name": "b64_json", + "value": "b64_json", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "58" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "64", + "kind": "enum", + "name": "CreateImageRequestSize", + "crossLanguageDefinitionId": "CreateImageRequest.size.anonymous", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "66", + "kind": "enumvalue", + "name": "256x256", + "value": "256x256", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "64" + }, + "decorators": [] + }, + { + "$id": "68", + "kind": "enumvalue", + "name": "512x512", + "value": "512x512", + "valueType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "64" + }, + "decorators": [] + }, + { + "$id": "70", + "kind": "enumvalue", + "name": "1024x1024", + "value": "1024x1024", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "64" + }, + "decorators": [] + }, + { + "$id": "72", + "kind": "enumvalue", + "name": "1792x1024", + "value": "1792x1024", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "64" + }, + "decorators": [] + }, + { + "$id": "74", + "kind": "enumvalue", + "name": "1024x1792", + "value": "1024x1792", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "64" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "76", + "kind": "enum", + "name": "CreateImageRequestStyle", + "crossLanguageDefinitionId": "CreateImageRequest.style.anonymous", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "78", + "kind": "enumvalue", + "name": "vivid", + "value": "vivid", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "76" + }, + "decorators": [] + }, + { + "$id": "80", + "kind": "enumvalue", + "name": "natural", + "value": "natural", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "76" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "82", + "kind": "enum", + "name": "AzureOpenAIDalleErrorInnerError_code", + "valueType": { + "$id": "83", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "84", + "kind": "enumvalue", + "name": "ResponsibleAIPolicyViolation", + "value": "ResponsibleAIPolicyViolation", + "description": "ResponsibleAIPolicyViolation", + "valueType": { + "$ref": "83" + }, + "enumType": { + "$ref": "82" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The AzureOpenAIDalleErrorInnerError_code", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "85", + "kind": "enum", + "name": "AzureContentFilterSeverityResultSeverity", + "crossLanguageDefinitionId": "AzureContentFilterSeverityResult.severity.anonymous", + "valueType": { + "$id": "86", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "87", + "kind": "enumvalue", + "name": "safe", + "value": "safe", + "valueType": { + "$id": "88", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "85" + }, + "decorators": [] + }, + { + "$id": "89", + "kind": "enumvalue", + "name": "low", + "value": "low", + "valueType": { + "$id": "90", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "85" + }, + "decorators": [] + }, + { + "$id": "91", + "kind": "enumvalue", + "name": "medium", + "value": "medium", + "valueType": { + "$id": "92", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "85" + }, + "decorators": [] + }, + { + "$id": "93", + "kind": "enumvalue", + "name": "high", + "value": "high", + "valueType": { + "$id": "94", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "85" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "95", + "kind": "enum", + "name": "ChatCompletionRequestMessageContentPartText_type", + "valueType": { + "$id": "96", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "97", + "kind": "enumvalue", + "name": "text", + "value": "text", + "description": "text", + "valueType": { + "$ref": "96" + }, + "enumType": { + "$ref": "95" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The ChatCompletionRequestMessageContentPartText_type", + "isFixed": false, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "98", + "kind": "enum", + "name": "ChatCompletionRequestMessageContentPartImage_type", + "valueType": { + "$id": "99", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "100", + "kind": "enumvalue", + "name": "image_url", + "value": "image_url", + "description": "image_url", + "valueType": { + "$ref": "99" + }, + "enumType": { + "$ref": "98" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The ChatCompletionRequestMessageContentPartImage_type", + "isFixed": false, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "101", + "kind": "enum", + "name": "ChatCompletionRequestMessageContentPartImageImageUrlDetail", + "crossLanguageDefinitionId": "ChatCompletionRequestMessageContentPartImage.image_url.detail.anonymous", + "valueType": { + "$id": "102", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "103", + "kind": "enumvalue", + "name": "auto", + "value": "auto", + "valueType": { + "$id": "104", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "101" + }, + "decorators": [] + }, + { + "$id": "105", + "kind": "enumvalue", + "name": "low", + "value": "low", + "valueType": { + "$id": "106", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "101" + }, + "decorators": [] + }, + { + "$id": "107", + "kind": "enumvalue", + "name": "high", + "value": "high", + "valueType": { + "$id": "108", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "101" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "109", + "kind": "enum", + "name": "ChatCompletionRequestMessageContentPartAudio_type", + "valueType": { + "$id": "110", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "111", + "kind": "enumvalue", + "name": "input_audio", + "value": "input_audio", + "description": "input_audio", + "valueType": { + "$ref": "110" + }, + "enumType": { + "$ref": "109" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The ChatCompletionRequestMessageContentPartAudio_type", + "isFixed": false, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "112", + "kind": "enum", + "name": "ChatCompletionRequestMessageContentPartAudioInputAudioFormat", + "crossLanguageDefinitionId": "ChatCompletionRequestMessageContentPartAudio.input_audio.format.anonymous", + "valueType": { + "$id": "113", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "114", + "kind": "enumvalue", + "name": "wav", + "value": "wav", + "valueType": { + "$id": "115", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "decorators": [] + }, + { + "$id": "116", + "kind": "enumvalue", + "name": "mp3", + "value": "mp3", + "valueType": { + "$id": "117", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "112" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "118", + "kind": "enum", + "name": "ChatCompletionRequestMessageContentPartRefusal_type", + "valueType": { + "$id": "119", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "120", + "kind": "enumvalue", + "name": "refusal", + "value": "refusal", + "description": "refusal", + "valueType": { + "$ref": "119" + }, + "enumType": { + "$ref": "118" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The ChatCompletionRequestMessageContentPartRefusal_type", + "isFixed": false, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "121", + "kind": "enum", + "name": "ChatCompletionMessageToolCall_type", + "valueType": { + "$id": "122", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "123", + "kind": "enumvalue", + "name": "function", + "value": "function", + "description": "function", + "valueType": { + "$ref": "122" + }, + "enumType": { + "$ref": "121" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The ChatCompletionMessageToolCall_type", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "124", + "kind": "enum", + "name": "AzureCreateChatCompletionRequestReasoningEffort", + "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.reasoning_effort.anonymous", + "valueType": { + "$id": "125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "126", + "kind": "enumvalue", + "name": "low", + "value": "low", + "valueType": { + "$id": "127", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "124" + }, + "decorators": [] + }, + { + "$id": "128", + "kind": "enumvalue", + "name": "medium", + "value": "medium", + "valueType": { + "$id": "129", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "124" + }, + "decorators": [] + }, + { + "$id": "130", + "kind": "enumvalue", + "name": "high", + "value": "high", + "valueType": { + "$id": "131", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "124" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "132", + "kind": "enum", + "name": "AzureCreateChatCompletionRequestModality", + "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.modality.anonymous", + "valueType": { + "$id": "133", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "134", + "kind": "enumvalue", + "name": "text", + "value": "text", + "valueType": { + "$id": "135", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "132" + }, + "decorators": [] + }, + { + "$id": "136", + "kind": "enumvalue", + "name": "audio", + "value": "audio", + "valueType": { + "$id": "137", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "132" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "138", + "kind": "enum", + "name": "ChatOutputPredictionType", + "crossLanguageDefinitionId": "ChatOutputPrediction.type.anonymous", + "valueType": { + "$id": "139", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "140", + "kind": "enumvalue", + "name": "content", + "value": "content", + "valueType": { + "$id": "141", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "138" + }, + "decorators": [] + } + ], + "isFixed": false, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "142", + "kind": "enum", + "name": "AzureCreateChatCompletionRequestAudioVoice", + "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.audio.voice.anonymous", + "valueType": { + "$id": "143", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "144", + "kind": "enumvalue", + "name": "alloy", + "value": "alloy", + "valueType": { + "$id": "145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "142" + }, + "decorators": [] + }, + { + "$id": "146", + "kind": "enumvalue", + "name": "ash", + "value": "ash", + "valueType": { + "$id": "147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "142" + }, + "decorators": [] + }, + { + "$id": "148", + "kind": "enumvalue", + "name": "ballad", + "value": "ballad", + "valueType": { + "$id": "149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "142" + }, + "decorators": [] + }, + { + "$id": "150", + "kind": "enumvalue", + "name": "coral", + "value": "coral", + "valueType": { + "$id": "151", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "142" + }, + "decorators": [] + }, + { + "$id": "152", + "kind": "enumvalue", + "name": "echo", + "value": "echo", + "valueType": { + "$id": "153", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "142" + }, + "decorators": [] + }, + { + "$id": "154", + "kind": "enumvalue", + "name": "sage", + "value": "sage", + "valueType": { + "$id": "155", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "142" + }, + "decorators": [] + }, + { + "$id": "156", + "kind": "enumvalue", + "name": "shimmer", + "value": "shimmer", + "valueType": { + "$id": "157", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "142" + }, + "decorators": [] + }, + { + "$id": "158", + "kind": "enumvalue", + "name": "verse", + "value": "verse", + "valueType": { + "$id": "159", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "142" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "160", + "kind": "enum", + "name": "AzureCreateChatCompletionRequestAudioFormat", + "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.audio.format.anonymous", + "valueType": { + "$id": "161", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "162", + "kind": "enumvalue", + "name": "wav", + "value": "wav", + "valueType": { + "$id": "163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "160" + }, + "decorators": [] + }, + { + "$id": "164", + "kind": "enumvalue", + "name": "mp3", + "value": "mp3", + "valueType": { + "$id": "165", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "160" + }, + "decorators": [] + }, + { + "$id": "166", + "kind": "enumvalue", + "name": "flac", + "value": "flac", + "valueType": { + "$id": "167", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "160" + }, + "decorators": [] + }, + { + "$id": "168", + "kind": "enumvalue", + "name": "opus", + "value": "opus", + "valueType": { + "$id": "169", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "160" + }, + "decorators": [] + }, + { + "$id": "170", + "kind": "enumvalue", + "name": "pcm16", + "value": "pcm16", + "valueType": { + "$id": "171", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "160" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "172", + "kind": "enum", + "name": "ChatCompletionTool_type", + "valueType": { + "$id": "173", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "174", + "kind": "enumvalue", + "name": "function", + "value": "function", + "description": "function", + "valueType": { + "$ref": "173" + }, + "enumType": { + "$ref": "172" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The ChatCompletionTool_type", + "isFixed": false, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "175", + "kind": "enum", + "name": "AzureCreateChatCompletionRequestToolChoice", + "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.tool_choice.anonymous", + "valueType": { + "$id": "176", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "177", + "kind": "enumvalue", + "name": "none", + "value": "none", + "valueType": { + "$id": "178", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "175" + }, + "decorators": [] + }, + { + "$id": "179", + "kind": "enumvalue", + "name": "auto", + "value": "auto", + "valueType": { + "$id": "180", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "175" + }, + "decorators": [] + }, + { + "$id": "181", + "kind": "enumvalue", + "name": "required", + "value": "required", + "valueType": { + "$id": "182", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "175" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "183", + "kind": "enum", + "name": "ChatCompletionNamedToolChoice_type", + "valueType": { + "$id": "184", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "185", + "kind": "enumvalue", + "name": "function", + "value": "function", + "description": "function", + "valueType": { + "$ref": "184" + }, + "enumType": { + "$ref": "183" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The ChatCompletionNamedToolChoice_type", + "isFixed": false, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "186", + "kind": "enum", + "name": "AzureSearchChatDataSourceParametersIncludeContext", + "crossLanguageDefinitionId": "AzureSearchChatDataSource.parameters.include_context.anonymous", + "valueType": { + "$id": "187", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "188", + "kind": "enumvalue", + "name": "citations", + "value": "citations", + "valueType": { + "$id": "189", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "186" + }, + "decorators": [] + }, + { + "$id": "190", + "kind": "enumvalue", + "name": "intent", + "value": "intent", + "valueType": { + "$id": "191", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "186" + }, + "decorators": [] + }, + { + "$id": "192", + "kind": "enumvalue", + "name": "all_retrieved_documents", + "value": "all_retrieved_documents", + "valueType": { + "$id": "193", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "186" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "194", + "kind": "enum", + "name": "AzureSearchChatDataSourceParametersQueryType", + "crossLanguageDefinitionId": "AzureSearchChatDataSource.parameters.query_type.anonymous", + "valueType": { + "$id": "195", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "196", + "kind": "enumvalue", + "name": "simple", + "value": "simple", + "valueType": { + "$id": "197", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "194" + }, + "decorators": [] + }, + { + "$id": "198", + "kind": "enumvalue", + "name": "semantic", + "value": "semantic", + "valueType": { + "$id": "199", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "194" + }, + "decorators": [] + }, + { + "$id": "200", + "kind": "enumvalue", + "name": "vector", + "value": "vector", + "valueType": { + "$id": "201", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "194" + }, + "decorators": [] + }, + { + "$id": "202", + "kind": "enumvalue", + "name": "vector_simple_hybrid", + "value": "vector_simple_hybrid", + "valueType": { + "$id": "203", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "194" + }, + "decorators": [] + }, + { + "$id": "204", + "kind": "enumvalue", + "name": "vector_semantic_hybrid", + "value": "vector_semantic_hybrid", + "valueType": { + "$id": "205", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "194" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "206", + "kind": "enum", + "name": "ElasticsearchChatDataSourceParametersQueryType", + "crossLanguageDefinitionId": "ElasticsearchChatDataSource.parameters.query_type.anonymous", + "valueType": { + "$id": "207", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "208", + "kind": "enumvalue", + "name": "simple", + "value": "simple", + "valueType": { + "$id": "209", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "206" + }, + "decorators": [] + }, + { + "$id": "210", + "kind": "enumvalue", + "name": "vector", + "value": "vector", + "valueType": { + "$id": "211", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "206" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Json", + "decorators": [] + }, + { + "$id": "212", + "kind": "enum", + "name": "AzureCreateChatCompletionResponseServiceTier", + "crossLanguageDefinitionId": "AzureCreateChatCompletionResponse.service_tier.anonymous", + "valueType": { + "$id": "213", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "214", + "kind": "enumvalue", + "name": "scale", + "value": "scale", + "valueType": { + "$id": "215", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "212" + }, + "decorators": [] + }, + { + "$id": "216", + "kind": "enumvalue", + "name": "default", + "value": "default", + "valueType": { + "$id": "217", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "212" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "218", + "kind": "enum", + "name": "AzureCreateChatCompletionResponse_object", + "valueType": { + "$id": "219", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "220", + "kind": "enumvalue", + "name": "chat.completion", + "value": "chat.completion", + "description": "chat.completion", + "valueType": { + "$ref": "219" + }, + "enumType": { + "$ref": "218" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The AzureCreateChatCompletionResponse_object", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "221", + "kind": "enum", + "name": "AzureCreateChatCompletionResponseChoiceFinishReason", + "crossLanguageDefinitionId": "AzureCreateChatCompletionResponseChoice.finish_reason.anonymous", + "valueType": { + "$id": "222", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "223", + "kind": "enumvalue", + "name": "stop", + "value": "stop", + "valueType": { + "$id": "224", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "221" + }, + "decorators": [] + }, + { + "$id": "225", + "kind": "enumvalue", + "name": "length", + "value": "length", + "valueType": { + "$id": "226", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "221" + }, + "decorators": [] + }, + { + "$id": "227", + "kind": "enumvalue", + "name": "tool_calls", + "value": "tool_calls", + "valueType": { + "$id": "228", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "221" + }, + "decorators": [] + }, + { + "$id": "229", + "kind": "enumvalue", + "name": "content_filter", + "value": "content_filter", + "valueType": { + "$id": "230", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "221" + }, + "decorators": [] + }, + { + "$id": "231", + "kind": "enumvalue", + "name": "function_call", + "value": "function_call", + "valueType": { + "$id": "232", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "221" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "233", + "kind": "enum", + "name": "ChatCompletionResponseMessage_role", + "valueType": { + "$id": "234", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "235", + "kind": "enumvalue", + "name": "assistant", + "value": "assistant", + "description": "assistant", + "valueType": { + "$ref": "234" + }, + "enumType": { + "$ref": "233" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The ChatCompletionResponseMessage_role", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "236", + "kind": "enum", + "name": "ChatCompletionMessageToolCallChunk_type", + "valueType": { + "$id": "237", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "238", + "kind": "enumvalue", + "name": "function", + "value": "function", + "description": "function", + "valueType": { + "$ref": "237" + }, + "enumType": { + "$ref": "236" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The ChatCompletionMessageToolCallChunk_type", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "239", + "kind": "enum", + "name": "AzureChatCompletionStreamResponseDeltaRole", + "crossLanguageDefinitionId": "AzureChatCompletionStreamResponseDelta.role.anonymous", + "valueType": { + "$id": "240", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "241", + "kind": "enumvalue", + "name": "system", + "value": "system", + "valueType": { + "$id": "242", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "239" + }, + "decorators": [] + }, + { + "$id": "243", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$id": "244", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "239" + }, + "decorators": [] + }, + { + "$id": "245", + "kind": "enumvalue", + "name": "assistant", + "value": "assistant", + "valueType": { + "$id": "246", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "239" + }, + "decorators": [] + }, + { + "$id": "247", + "kind": "enumvalue", + "name": "tool", + "value": "tool", + "valueType": { + "$id": "248", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "239" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "249", + "kind": "enum", + "name": "AzureChatMessageContextAllRetrievedDocumentsFilterReason", + "crossLanguageDefinitionId": "AzureChatMessageContext.all_retrieved_documents.filter_reason.anonymous", + "valueType": { + "$id": "250", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "251", + "kind": "enumvalue", + "name": "score", + "value": "score", + "valueType": { + "$id": "252", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "249" + }, + "decorators": [] + }, + { + "$id": "253", + "kind": "enumvalue", + "name": "rerank", + "value": "rerank", + "valueType": { + "$id": "254", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "249" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "255", + "kind": "enum", + "name": "AzureOpenAIChatErrorInnerError_code", + "valueType": { + "$id": "256", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "257", + "kind": "enumvalue", + "name": "ResponsibleAIPolicyViolation", + "value": "ResponsibleAIPolicyViolation", + "description": "ResponsibleAIPolicyViolation", + "valueType": { + "$ref": "256" + }, + "enumType": { + "$ref": "255" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The AzureOpenAIChatErrorInnerError_code", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "258", + "kind": "enum", + "name": "AzureOpenAIServiceApiVersion", + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIServiceApiVersion", + "valueType": { + "$id": "259", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "260", + "kind": "enumvalue", + "name": "v2024_06_01", + "value": "2024-06-01", + "valueType": { + "$id": "261", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "258" + }, + "description": "The 2024-06-01 (stable) service API version label.", + "decorators": [] + }, + { + "$id": "262", + "kind": "enumvalue", + "name": "v2024_08_01_preview", + "value": "2024-08-01-preview", + "valueType": { + "$id": "263", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "258" + }, + "description": "The 2024-08-01-preview service API version label.", + "decorators": [] + }, + { + "$id": "264", + "kind": "enumvalue", + "name": "v2024_09_01_preview", + "value": "2024-09-01-preview", + "valueType": { + "$id": "265", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "258" + }, + "description": "The 2024-09-01-preview service API version label.", + "decorators": [] + }, + { + "$id": "266", + "kind": "enumvalue", + "name": "v2024_10_01_preview", + "value": "2024-10-01-preview", + "valueType": { + "$id": "267", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "258" + }, + "description": "The 2024-10-01-preview service API version label.", + "decorators": [] + }, + { + "$id": "268", + "kind": "enumvalue", + "name": "v2024_10_21", + "value": "2024-10-21", + "valueType": { + "$id": "269", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "258" + }, + "description": "The 2024-10-21 (stable) service API version label.", + "decorators": [] + }, + { + "$id": "270", + "kind": "enumvalue", + "name": "v2024_12_01_preview", + "value": "2024-12-01-preview", + "valueType": { + "$id": "271", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "258" + }, + "description": "The 2024-12-01-preview service API version label.", + "decorators": [] + }, + { + "$id": "272", + "kind": "enumvalue", + "name": "v2025_01_01_preview", + "value": "2025-01-01-preview", + "valueType": { + "$id": "273", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "258" + }, + "description": "The 2025-01-01-preview service API version label.", + "decorators": [] + } + ], + "description": "Known service API versions for Azure OpenAI.", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + }, + { + "$id": "274", + "kind": "enum", + "name": "OpenAIFileWithOmittedPropertiesPurpose", + "crossLanguageDefinitionId": "OpenAIFileWithOmittedProperties.purpose.anonymous", + "valueType": { + "$id": "275", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "276", + "kind": "enumvalue", + "name": "assistants", + "value": "assistants", + "valueType": { + "$id": "277", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "274" + }, + "decorators": [] + }, + { + "$id": "278", + "kind": "enumvalue", + "name": "assistants_output", + "value": "assistants_output", + "valueType": { + "$id": "279", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "274" + }, + "decorators": [] + }, + { + "$id": "280", + "kind": "enumvalue", + "name": "batch", + "value": "batch", + "valueType": { + "$id": "281", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "274" + }, + "decorators": [] + }, + { + "$id": "282", + "kind": "enumvalue", + "name": "batch_output", + "value": "batch_output", + "valueType": { + "$id": "283", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "274" + }, + "decorators": [] + }, + { + "$id": "284", + "kind": "enumvalue", + "name": "fine-tune", + "value": "fine-tune", + "valueType": { + "$id": "285", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "274" + }, + "decorators": [] + }, + { + "$id": "286", + "kind": "enumvalue", + "name": "fine-tune-results", + "value": "fine-tune-results", + "valueType": { + "$id": "287", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "274" + }, + "decorators": [] + }, + { + "$id": "288", + "kind": "enumvalue", + "name": "vision", + "value": "vision", + "valueType": { + "$id": "289", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "274" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Output", + "decorators": [] + }, + { + "$id": "290", + "kind": "enum", + "name": "AzureOpenAIFile_object", + "valueType": { + "$id": "291", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "292", + "kind": "enumvalue", + "name": "file", + "value": "file", + "description": "file", + "valueType": { + "$ref": "291" + }, + "enumType": { + "$ref": "290" + } + } + ], + "crossLanguageDefinitionId": "", + "description": "The AzureOpenAIFile_object", + "isFixed": false, + "isFlags": false, + "usage": "Output", + "decorators": [] + }, + { + "$id": "293", + "kind": "enum", + "name": "AzureOpenAIFileStatus", + "crossLanguageDefinitionId": "AzureOpenAIFile.status.anonymous", + "valueType": { + "$id": "294", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "295", + "kind": "enumvalue", + "name": "uploaded", + "value": "uploaded", + "valueType": { + "$id": "296", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "293" + }, + "decorators": [] + }, + { + "$id": "297", + "kind": "enumvalue", + "name": "pending", + "value": "pending", + "valueType": { + "$id": "298", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "293" + }, + "decorators": [] + }, + { + "$id": "299", + "kind": "enumvalue", + "name": "running", + "value": "running", + "valueType": { + "$id": "300", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "293" + }, + "decorators": [] + }, + { + "$id": "301", + "kind": "enumvalue", + "name": "processed", + "value": "processed", + "valueType": { + "$id": "302", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "293" + }, + "decorators": [] + }, + { + "$id": "303", + "kind": "enumvalue", + "name": "error", + "value": "error", + "valueType": { + "$id": "304", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "293" + }, + "decorators": [] + }, + { + "$id": "305", + "kind": "enumvalue", + "name": "deleting", + "value": "deleting", + "valueType": { + "$id": "306", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "293" + }, + "decorators": [] + }, + { + "$id": "307", + "kind": "enumvalue", + "name": "deleted", + "value": "deleted", + "valueType": { + "$id": "308", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "293" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Output", + "decorators": [] + } + ], + "Models": [ + { + "$id": "309", + "kind": "model", + "name": "CreateMessageRequest", + "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "310", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the entity that is creating the message. Allowed values include:\n- `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.\n- `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.role" + }, + { + "$id": "311", + "kind": "property", + "name": "content", + "serializedName": "content", + "type": { + "$id": "312", + "kind": "array", + "name": "ArrayMessageContent", + "valueType": { + "$id": "313", + "kind": "model", + "name": "MessageContent", + "crossLanguageDefinitionId": "OpenAI.MessageContent", + "access": "public", + "usage": "Input,Output,Json", + "description": "Represents a single piece of content in an Assistants API message.", + "decorators": [], + "properties": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.content" + }, + { + "$id": "314", + "kind": "property", + "name": "attachments", + "serializedName": "attachments", + "description": "A list of files attached to the message, and the tools they should be added to.", + "type": { + "$id": "315", + "kind": "nullable", + "type": { + "$id": "316", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "317", + "kind": "model", + "name": "CreateMessageRequestAttachment", + "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.attachment.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "318", + "kind": "property", + "name": "file_id", + "serializedName": "file_id", + "description": "The ID of the file to attach to the message.", + "type": { + "$id": "319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.attachment.anonymous.file_id" + }, + { + "$id": "320", + "kind": "property", + "name": "tools", + "serializedName": "tools", + "description": "The tools to add this file to.", + "type": { + "$id": "321", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "322", + "kind": "union", + "name": "CreateMessageRequestAttachmentTool", + "variantTypes": [ + { + "$id": "323", + "kind": "model", + "name": "AssistantToolsCode", + "crossLanguageDefinitionId": "OpenAI.AssistantToolsCode", + "usage": "Input,Output,Json", + "discriminatorValue": "code_interpreter", + "decorators": [], + "baseModel": { + "$id": "324", + "kind": "model", + "name": "AssistantToolDefinition", + "crossLanguageDefinitionId": "OpenAI.AssistantToolDefinition", + "usage": "Input,Output,Json", + "decorators": [], + "discriminatorProperty": { + "$id": "325", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "326", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolDefinition.type" + }, + "properties": [ + { + "$ref": "325" + } + ], + "discriminatedSubtypes": { + "$id": "327", + "code_interpreter": { + "$ref": "323" + }, + "file_search": { + "$id": "328", + "kind": "model", + "name": "AssistantToolsFileSearch", + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch", + "usage": "None", + "discriminatorValue": "file_search", + "decorators": [], + "baseModel": { + "$ref": "324" + }, + "properties": [ + { + "$id": "329", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of tool being defined: `file_search`", + "type": { + "$id": "330", + "kind": "constant", + "valueType": { + "$id": "331", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "file_search", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.type" + }, + { + "$id": "332", + "kind": "property", + "name": "file_search", + "serializedName": "file_search", + "description": "Overrides for the file search tool.", + "type": { + "$id": "333", + "kind": "model", + "name": "AssistantToolsFileSearchFileSearch", + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.file_search.anonymous", + "usage": "None", + "decorators": [], + "properties": [ + { + "$id": "334", + "kind": "property", + "name": "max_num_results", + "serializedName": "max_num_results", + "description": "The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive.\n\nNote that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.", + "type": { + "$id": "335", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.file_search.anonymous.max_num_results" + }, + { + "$id": "336", + "kind": "property", + "name": "ranking_options", + "serializedName": "ranking_options", + "type": { + "$id": "337", + "kind": "model", + "name": "FileSearchRankingOptions", + "crossLanguageDefinitionId": "OpenAI.FileSearchRankingOptions", + "usage": "None", + "description": "The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.\n\nSee the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.", + "decorators": [], + "properties": [ + { + "$id": "338", + "kind": "property", + "name": "ranker", + "serializedName": "ranker", + "description": "The ranker to use for the file search. If not specified will use the `auto` ranker.", + "type": { + "$ref": "8" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.FileSearchRankingOptions.ranker" + }, + { + "$id": "339", + "kind": "property", + "name": "score_threshold", + "serializedName": "score_threshold", + "description": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", + "type": { + "$id": "340", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.FileSearchRankingOptions.score_threshold" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.file_search.anonymous.ranking_options" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.file_search" + } + ] + }, + "function": { + "$id": "341", + "kind": "model", + "name": "AssistantToolsFunction", + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFunction", + "usage": "None", + "discriminatorValue": "function", + "decorators": [], + "baseModel": { + "$ref": "324" + }, + "properties": [ + { + "$id": "342", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of tool being defined: `function`", + "type": { + "$id": "343", + "kind": "constant", + "valueType": { + "$id": "344", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "function", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFunction.type" + }, + { + "$id": "345", + "kind": "property", + "name": "function", + "serializedName": "function", + "type": { + "$id": "346", + "kind": "model", + "name": "FunctionObject", + "crossLanguageDefinitionId": "OpenAI.FunctionObject", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "347", + "kind": "property", + "name": "description", + "serializedName": "description", + "description": "A description of what the function does, used by the model to choose when and how to call the function.", + "type": { + "$id": "348", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.FunctionObject.description" + }, + { + "$id": "349", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", + "type": { + "$id": "350", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.FunctionObject.name" + }, + { + "$id": "351", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\n\nOmitting `parameters` defines a function with an empty parameter list.", + "type": { + "$id": "352", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.FunctionObject.parameters" + }, + { + "$id": "353", + "kind": "property", + "name": "strict", + "serializedName": "strict", + "description": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).", + "type": { + "$id": "354", + "kind": "nullable", + "type": { + "$id": "355", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.FunctionObject.strict" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFunction.function" + } + ] + } + } + }, + "properties": [ + { + "$id": "356", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of tool being defined: `code_interpreter`", + "type": { + "$id": "357", + "kind": "constant", + "valueType": { + "$id": "358", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "code_interpreter", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolsCode.type" + } + ] + }, + { + "$id": "359", + "kind": "model", + "name": "AssistantToolsFileSearchTypeOnly", + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearchTypeOnly", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "360", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of tool being defined: `file_search`", + "type": { + "$id": "361", + "kind": "constant", + "valueType": { + "$ref": "14" + }, + "value": "file_search", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearchTypeOnly.type" + } + ] + } + ], + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.attachment.anonymous.tools" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.attachments" + }, + { + "$id": "362", + "kind": "property", + "name": "metadata", + "serializedName": "metadata", + "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.", + "type": { + "$id": "363", + "kind": "dict", + "keyType": { + "$id": "364", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "365", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.metadata" + } + ] + }, + { + "$ref": "313" + }, + { + "$ref": "317" + }, + { + "$ref": "323" + }, + { + "$ref": "324" + }, + { + "$ref": "328" + }, + { + "$ref": "333" + }, + { + "$ref": "337" + }, + { + "$ref": "341" + }, + { + "$ref": "346" + }, + { + "$ref": "359" + }, + { + "$id": "366", + "kind": "model", + "name": "MessageObject", + "crossLanguageDefinitionId": "OpenAI.MessageObject", + "usage": "Output,Json", + "description": "Represents a message within a [thread](/docs/api-reference/threads).", + "decorators": [], + "properties": [ + { + "$id": "367", + "kind": "property", + "name": "id", + "serializedName": "id", + "description": "The identifier, which can be referenced in API endpoints.", + "type": { + "$id": "368", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.id" + }, + { + "$id": "369", + "kind": "property", + "name": "object", + "serializedName": "object", + "description": "The object type, which is always `thread.message`.", + "type": { + "$id": "370", + "kind": "constant", + "valueType": { + "$ref": "17" + }, + "value": "thread.message", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.object" + }, + { + "$id": "371", + "kind": "property", + "name": "created_at", + "serializedName": "created_at", + "description": "The Unix timestamp (in seconds) for when the message was created.", + "type": { + "$id": "372", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "unixTimestamp", + "wireType": { + "$id": "373", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.created_at" + }, + { + "$id": "374", + "kind": "property", + "name": "thread_id", + "serializedName": "thread_id", + "description": "The [thread](/docs/api-reference/threads) ID that this message belongs to.", + "type": { + "$id": "375", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.thread_id" + }, + { + "$id": "376", + "kind": "property", + "name": "status", + "serializedName": "status", + "description": "The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.", + "type": { + "$ref": "20" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.status" + }, + { + "$id": "377", + "kind": "property", + "name": "incomplete_details", + "serializedName": "incomplete_details", + "description": "On an incomplete message, details about why the message is incomplete.", + "type": { + "$id": "378", + "kind": "nullable", + "type": { + "$id": "379", + "kind": "model", + "name": "MessageObjectIncompleteDetails", + "crossLanguageDefinitionId": "OpenAI.MessageObject.incomplete_details.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "380", + "kind": "property", + "name": "reason", + "serializedName": "reason", + "description": "The reason the message is incomplete.", + "type": { + "$ref": "28" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.incomplete_details.anonymous.reason" + } + ] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.incomplete_details" + }, + { + "$id": "381", + "kind": "property", + "name": "completed_at", + "serializedName": "completed_at", + "description": "The Unix timestamp (in seconds) for when the message was completed.", + "type": { + "$id": "382", + "kind": "nullable", + "type": { + "$id": "383", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "unixTimestamp", + "wireType": { + "$id": "384", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.completed_at" + }, + { + "$id": "385", + "kind": "property", + "name": "incomplete_at", + "serializedName": "incomplete_at", + "description": "The Unix timestamp (in seconds) for when the message was marked as incomplete.", + "type": { + "$id": "386", + "kind": "nullable", + "type": { + "$id": "387", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "unixTimestamp", + "wireType": { + "$id": "388", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.incomplete_at" + }, + { + "$id": "389", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The entity that produced the message. One of `user` or `assistant`.", + "type": { + "$ref": "40" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.role" + }, + { + "$id": "390", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The content of the message in array of text and/or images.", + "type": { + "$id": "391", + "kind": "array", + "name": "ArrayMessageContent", + "valueType": { + "$ref": "313" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.content" + }, + { + "$id": "392", + "kind": "property", + "name": "assistant_id", + "serializedName": "assistant_id", + "description": "If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message.", + "type": { + "$id": "393", + "kind": "nullable", + "type": { + "$id": "394", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.assistant_id" + }, + { + "$id": "395", + "kind": "property", + "name": "run_id", + "serializedName": "run_id", + "description": "The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints.", + "type": { + "$id": "396", + "kind": "nullable", + "type": { + "$id": "397", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.run_id" + }, + { + "$id": "398", + "kind": "property", + "name": "attachments", + "serializedName": "attachments", + "description": "A list of files attached to the message, and the tools they were added to.", + "type": { + "$id": "399", + "kind": "nullable", + "type": { + "$id": "400", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "401", + "kind": "model", + "name": "MessageObjectAttachment", + "crossLanguageDefinitionId": "OpenAI.MessageObject.attachment.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "402", + "kind": "property", + "name": "file_id", + "serializedName": "file_id", + "description": "The ID of the file to attach to the message.", + "type": { + "$id": "403", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.attachment.anonymous.file_id" + }, + { + "$id": "404", + "kind": "property", + "name": "tools", + "serializedName": "tools", + "description": "The tools to add this file to.", + "type": { + "$id": "405", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "406", + "kind": "union", + "name": "MessageObjectAttachmentTool", + "variantTypes": [ + { + "$ref": "323" + }, + { + "$ref": "359" + } + ], + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.attachment.anonymous.tools" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.attachments" + }, + { + "$id": "407", + "kind": "property", + "name": "metadata", + "serializedName": "metadata", + "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.", + "type": { + "$id": "408", + "kind": "nullable", + "type": { + "$id": "409", + "kind": "dict", + "keyType": { + "$id": "410", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "411", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.MessageObject.metadata" + } + ] + }, + { + "$ref": "379" + }, + { + "$ref": "401" + }, + { + "$id": "412", + "kind": "model", + "name": "ErrorResponse", + "crossLanguageDefinitionId": "OpenAI.ErrorResponse", + "usage": "Error,Json,Exception", + "decorators": [], + "properties": [ + { + "$id": "413", + "kind": "property", + "name": "error", + "serializedName": "error", + "type": { + "$id": "414", + "kind": "model", + "name": "Error", + "crossLanguageDefinitionId": "OpenAI.Error", + "usage": "Json,Exception", + "decorators": [], + "properties": [ + { + "$id": "415", + "kind": "property", + "name": "code", + "serializedName": "code", + "type": { + "$id": "416", + "kind": "nullable", + "type": { + "$id": "417", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.Error.code" + }, + { + "$id": "418", + "kind": "property", + "name": "message", + "serializedName": "message", + "type": { + "$id": "419", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.Error.message" + }, + { + "$id": "420", + "kind": "property", + "name": "param", + "serializedName": "param", + "type": { + "$id": "421", + "kind": "nullable", + "type": { + "$id": "422", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.Error.param" + }, + { + "$id": "423", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "424", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.Error.type" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ErrorResponse.error" + } + ] + }, + { + "$ref": "414" + }, + { + "$id": "425", + "kind": "model", + "name": "CreateImageRequest", + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "426", + "kind": "property", + "name": "prompt", + "serializedName": "prompt", + "description": "A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.", + "type": { + "$id": "427", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.prompt" + }, + { + "$id": "428", + "kind": "property", + "name": "model", + "serializedName": "model", + "description": "The model to use for image generation.", + "type": { + "$id": "429", + "kind": "nullable", + "type": { + "$ref": "46" + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.model" + }, + { + "$id": "430", + "kind": "property", + "name": "n", + "serializedName": "n", + "description": "The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.", + "type": { + "$id": "431", + "kind": "nullable", + "type": { + "$id": "432", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.n" + }, + { + "$id": "433", + "kind": "property", + "name": "quality", + "serializedName": "quality", + "description": "The quality of the image that will be generated. `hd` creates images with finer details and greater consistency across the image. This param is only supported for `dall-e-3`.", + "type": { + "$ref": "52" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.quality" + }, + { + "$id": "434", + "kind": "property", + "name": "response_format", + "serializedName": "response_format", + "description": "The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated.", + "type": { + "$id": "435", + "kind": "nullable", + "type": { + "$ref": "58" + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.response_format" + }, + { + "$id": "436", + "kind": "property", + "name": "size", + "serializedName": "size", + "description": "The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models.", + "type": { + "$id": "437", + "kind": "nullable", + "type": { + "$ref": "64" + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.size" + }, + { + "$id": "438", + "kind": "property", + "name": "style", + "serializedName": "style", + "description": "The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`.", + "type": { + "$id": "439", + "kind": "nullable", + "type": { + "$ref": "76" + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.style" + }, + { + "$id": "440", + "kind": "property", + "name": "user", + "serializedName": "user", + "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).", + "type": { + "$id": "441", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.user" + } + ] + }, + { + "$id": "442", + "kind": "model", + "name": "ImagesResponse", + "crossLanguageDefinitionId": "OpenAI.ImagesResponse", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "443", + "kind": "property", + "name": "created", + "serializedName": "created", + "type": { + "$id": "444", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "unixTimestamp", + "wireType": { + "$id": "445", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ImagesResponse.created" + }, + { + "$id": "446", + "kind": "property", + "name": "data", + "serializedName": "data", + "type": { + "$id": "447", + "kind": "array", + "name": "ArrayImage", + "valueType": { + "$id": "448", + "kind": "model", + "name": "Image", + "crossLanguageDefinitionId": "OpenAI.Image", + "usage": "Output,Json", + "description": "Represents the url or the content of an image generated by the OpenAI API.", + "decorators": [], + "properties": [ + { + "$id": "449", + "kind": "property", + "name": "b64_json", + "serializedName": "b64_json", + "description": "The base64-encoded JSON of the generated image, if `response_format` is `b64_json`.", + "type": { + "$id": "450", + "kind": "bytes", + "name": "bytes", + "encode": "base64", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.Image.b64_json" + }, + { + "$id": "451", + "kind": "property", + "name": "url", + "serializedName": "url", + "description": "The URL of the generated image, if `response_format` is `url` (default).", + "type": { + "$id": "452", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.Image.url" + }, + { + "$id": "453", + "kind": "property", + "name": "revised_prompt", + "serializedName": "revised_prompt", + "description": "The prompt that was used to generate the image, if there was any revision to the prompt.", + "type": { + "$id": "454", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.Image.revised_prompt" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ImagesResponse.data" + } + ] + }, + { + "$ref": "448" + }, + { + "$id": "455", + "kind": "model", + "name": "AzureOpenAIDalleErrorResponse", + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleErrorResponse", + "access": "public", + "usage": "Output,Json", + "description": "A structured representation of an error an Azure OpenAI request.", + "decorators": [], + "properties": [ + { + "$id": "456", + "kind": "property", + "name": "error", + "serializedName": "error", + "type": { + "$id": "457", + "kind": "model", + "name": "AzureOpenAIDalleError", + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError", + "access": "public", + "usage": "Output,Json", + "description": "The structured representation of an error from an Azure OpenAI image generation request.", + "decorators": [], + "properties": [ + { + "$id": "458", + "kind": "property", + "name": "code", + "serializedName": "code", + "description": "The distinct, machine-generated identifier for the error.", + "type": { + "$id": "459", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.code" + }, + { + "$id": "460", + "kind": "property", + "name": "message", + "serializedName": "message", + "description": "A human-readable message associated with the error.", + "type": { + "$id": "461", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.message" + }, + { + "$id": "462", + "kind": "property", + "name": "param", + "serializedName": "param", + "description": "If applicable, the request input parameter associated with the error", + "type": { + "$id": "463", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.param" + }, + { + "$id": "464", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "If applicable, the input line number associated with the error.", + "type": { + "$id": "465", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.type" + }, + { + "$id": "466", + "kind": "property", + "name": "inner_error", + "serializedName": "inner_error", + "description": "If applicable, an upstream error that originated this error.", + "type": { + "$id": "467", + "kind": "model", + "name": "AzureOpenAIDalleErrorInnerError", + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "468", + "kind": "property", + "name": "code", + "serializedName": "code", + "description": "The code associated with the inner error.", + "type": { + "$id": "469", + "kind": "constant", + "valueType": { + "$ref": "82" + }, + "value": "ResponsibleAIPolicyViolation", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error.anonymous.code" + }, + { + "$id": "470", + "kind": "property", + "name": "revised_prompt", + "serializedName": "revised_prompt", + "description": "If applicable, the modified prompt used for generation.", + "type": { + "$id": "471", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error.anonymous.revised_prompt" + }, + { + "$id": "472", + "kind": "property", + "name": "content_filter_results", + "serializedName": "content_filter_results", + "description": "The content filter result details associated with the inner error.", + "type": { + "$id": "473", + "kind": "model", + "name": "AzureContentFilterImagePromptResults", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImagePromptResults", + "usage": "Output,Json", + "description": "A content filter result for an image generation operation's input request content.", + "decorators": [], + "baseModel": { + "$id": "474", + "kind": "model", + "name": "AzureContentFilterImageResponseResults", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults", + "usage": "Output,Json", + "description": "A content filter result for an image generation operation's output response content.", + "decorators": [], + "properties": [ + { + "$id": "475", + "kind": "property", + "name": "sexual", + "serializedName": "sexual", + "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse.", + "type": { + "$id": "476", + "kind": "model", + "name": "AzureContentFilterSeverityResult", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterSeverityResult", + "usage": "Output,Json", + "description": "A labeled content filter result item that indicates whether the content was filtered and what the qualitative\nseverity level of the content was, as evaluated against content filter configuration for the category.", + "decorators": [], + "properties": [ + { + "$id": "477", + "kind": "property", + "name": "filtered", + "serializedName": "filtered", + "description": "Whether the content severity resulted in a content filtering action.", + "type": { + "$id": "478", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterSeverityResult.filtered" + }, + { + "$id": "479", + "kind": "property", + "name": "severity", + "serializedName": "severity", + "description": "The labeled severity of the content.", + "type": { + "$ref": "85" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterSeverityResult.severity" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults.sexual" + }, + { + "$id": "480", + "kind": "property", + "name": "violence", + "serializedName": "violence", + "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on.", + "type": { + "$ref": "476" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults.violence" + }, + { + "$id": "481", + "kind": "property", + "name": "hate", + "serializedName": "hate", + "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size.", + "type": { + "$ref": "476" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults.hate" + }, + { + "$id": "482", + "kind": "property", + "name": "self_harm", + "serializedName": "self_harm", + "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself.", + "type": { + "$ref": "476" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults.self_harm" + } + ] + }, + "properties": [ + { + "$id": "483", + "kind": "property", + "name": "profanity", + "serializedName": "profanity", + "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent.", + "type": { + "$id": "484", + "kind": "model", + "name": "AzureContentFilterDetectionResult", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterDetectionResult", + "usage": "Output,Json", + "description": "A labeled content filter result item that indicates whether the content was detected and whether the content was\nfiltered.", + "decorators": [], + "properties": [ + { + "$id": "485", + "kind": "property", + "name": "filtered", + "serializedName": "filtered", + "description": "Whether the content detection resulted in a content filtering action.", + "type": { + "$id": "486", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterDetectionResult.filtered" + }, + { + "$id": "487", + "kind": "property", + "name": "detected", + "serializedName": "detected", + "description": "Whether the labeled content category was detected in the content.", + "type": { + "$id": "488", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterDetectionResult.detected" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImagePromptResults.profanity" + }, + { + "$id": "489", + "kind": "property", + "name": "custom_blocklists", + "serializedName": "custom_blocklists", + "description": "A collection of binary filtering outcomes for configured custom blocklists.", + "type": { + "$id": "490", + "kind": "model", + "name": "AzureContentFilterBlocklistResult", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult", + "access": "public", + "usage": "Output,Json", + "description": "A collection of true/false filtering results for configured custom blocklists.", + "decorators": [], + "properties": [ + { + "$id": "491", + "kind": "property", + "name": "filtered", + "serializedName": "filtered", + "description": "A value indicating whether any of the detailed blocklists resulted in a filtering action.", + "type": { + "$id": "492", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.filtered" + }, + { + "$id": "493", + "kind": "property", + "name": "details", + "serializedName": "details", + "description": "The pairs of individual blocklist IDs and whether they resulted in a filtering action.", + "type": { + "$id": "494", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "495", + "kind": "model", + "name": "AzureContentFilterBlocklistResultDetail", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.detail.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "496", + "kind": "property", + "name": "filtered", + "serializedName": "filtered", + "description": "A value indicating whether the blocklist produced a filtering action.", + "type": { + "$id": "497", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.detail.anonymous.filtered" + }, + { + "$id": "498", + "kind": "property", + "name": "id", + "serializedName": "id", + "description": "The ID of the custom blocklist evaluated.", + "type": { + "$id": "499", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.detail.anonymous.id" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.details" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImagePromptResults.custom_blocklists" + }, + { + "$id": "500", + "kind": "property", + "name": "jailbreak", + "serializedName": "jailbreak", + "description": "A detection result that describes user prompt injection attacks, where malicious users deliberately exploit\nsystem vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content\ngeneration or violations of system-imposed restrictions.", + "type": { + "$ref": "484" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImagePromptResults.jailbreak" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error.anonymous.content_filter_results" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleErrorResponse.error" + } + ] + }, + { + "$ref": "457" + }, + { + "$ref": "467" + }, + { + "$ref": "473" + }, + { + "$ref": "484" + }, + { + "$ref": "490" + }, + { + "$ref": "495" + }, + { + "$ref": "474" + }, + { + "$ref": "476" + }, + { + "$id": "501", + "kind": "model", + "name": "AzureCreateChatCompletionRequest", + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest", + "usage": "Input,Json", + "description": "The extended request model for chat completions against the Azure OpenAI service.\nThis adds the ability to provide data sources for the On Your Data feature.", + "decorators": [], + "properties": [ + { + "$id": "502", + "kind": "property", + "name": "messages", + "serializedName": "messages", + "description": "A list of messages comprising the conversation so far. Depending on the\n[model](/docs/models) you use, different message types (modalities) are\nsupported, like [text](/docs/guides/text-generation),\n[images](/docs/guides/vision), and [audio](/docs/guides/audio).", + "type": { + "$id": "503", + "kind": "array", + "name": "ArrayChatCompletionRequestMessage", + "valueType": { + "$id": "504", + "kind": "model", + "name": "ChatCompletionRequestMessage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessage", + "usage": "Input,Json", + "decorators": [], + "discriminatorProperty": { + "$id": "505", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the author of this message.", + "type": { + "$id": "506", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessage.role" + }, + "properties": [ + { + "$ref": "505" + } + ], + "discriminatedSubtypes": { + "$id": "507", + "system": { + "$id": "508", + "kind": "model", + "name": "ChatCompletionRequestSystemMessage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestSystemMessage", + "usage": "Input,Json", + "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, use `developer` messages\nfor this purpose instead.", + "discriminatorValue": "system", + "decorators": [], + "baseModel": { + "$ref": "504" + }, + "properties": [ + { + "$id": "509", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The contents of the system message.", + "type": { + "$id": "510", + "kind": "union", + "name": "ChatCompletionRequestSystemMessageContent", + "variantTypes": [ + { + "$id": "511", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "512", + "kind": "array", + "name": "ArrayChatCompletionRequestSystemMessageContentPart", + "valueType": { + "$id": "513", + "kind": "union", + "name": "ChatCompletionRequestSystemMessageContentPart", + "variantTypes": [ + { + "$id": "514", + "kind": "model", + "name": "ChatCompletionRequestMessageContentPartText", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartText", + "usage": "Input,Json", + "description": "Learn about [text inputs](/docs/guides/text-generation).", + "decorators": [], + "properties": [ + { + "$id": "515", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the content part.", + "type": { + "$id": "516", + "kind": "constant", + "valueType": { + "$ref": "95" + }, + "value": "text", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartText.type" + }, + { + "$id": "517", + "kind": "property", + "name": "text", + "serializedName": "text", + "description": "The text content.", + "type": { + "$id": "518", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartText.text" + } + ] + } + ], + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestSystemMessage.content" + }, + { + "$id": "519", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the messages author, in this case `system`.", + "type": { + "$id": "520", + "kind": "constant", + "valueType": { + "$id": "521", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "system", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestSystemMessage.role" + }, + { + "$id": "522", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", + "type": { + "$id": "523", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestSystemMessage.name" + } + ] + }, + "developer": { + "$id": "524", + "kind": "model", + "name": "ChatCompletionRequestDeveloperMessage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestDeveloperMessage", + "usage": "Input,Json", + "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, `developer` messages\nreplace the previous `system` messages.", + "discriminatorValue": "developer", + "decorators": [], + "baseModel": { + "$ref": "504" + }, + "properties": [ + { + "$id": "525", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The contents of the developer message.", + "type": { + "$id": "526", + "kind": "union", + "name": "ChatCompletionRequestDeveloperMessageContent", + "variantTypes": [ + { + "$id": "527", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "528", + "kind": "array", + "name": "ArrayChatCompletionRequestMessageContentPartText", + "valueType": { + "$ref": "514" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestDeveloperMessage.content" + }, + { + "$id": "529", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the messages author, in this case `developer`.", + "type": { + "$id": "530", + "kind": "constant", + "valueType": { + "$id": "531", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "developer", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestDeveloperMessage.role" + }, + { + "$id": "532", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", + "type": { + "$id": "533", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestDeveloperMessage.name" + } + ] + }, + "user": { + "$id": "534", + "kind": "model", + "name": "ChatCompletionRequestUserMessage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestUserMessage", + "usage": "Input,Json", + "description": "Messages sent by an end user, containing prompts or additional context\ninformation.", + "discriminatorValue": "user", + "decorators": [], + "baseModel": { + "$ref": "504" + }, + "properties": [ + { + "$id": "535", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The contents of the user message.", + "type": { + "$id": "536", + "kind": "union", + "name": "ChatCompletionRequestUserMessageContent", + "variantTypes": [ + { + "$id": "537", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "538", + "kind": "array", + "name": "ArrayChatCompletionRequestUserMessageContentPart", + "valueType": { + "$id": "539", + "kind": "union", + "name": "ChatCompletionRequestUserMessageContentPart", + "variantTypes": [ + { + "$ref": "514" + }, + { + "$id": "540", + "kind": "model", + "name": "ChatCompletionRequestMessageContentPartImage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage", + "usage": "Input,Json", + "description": "Learn about [image inputs](/docs/guides/vision).", + "decorators": [], + "properties": [ + { + "$id": "541", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the content part.", + "type": { + "$id": "542", + "kind": "constant", + "valueType": { + "$ref": "98" + }, + "value": "image_url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.type" + }, + { + "$id": "543", + "kind": "property", + "name": "image_url", + "serializedName": "image_url", + "type": { + "$id": "544", + "kind": "model", + "name": "ChatCompletionRequestMessageContentPartImageImageUrl", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.image_url.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "545", + "kind": "property", + "name": "url", + "serializedName": "url", + "description": "Either a URL of the image or the base64 encoded image data.", + "type": { + "$id": "546", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.image_url.anonymous.url" + }, + { + "$id": "547", + "kind": "property", + "name": "detail", + "serializedName": "detail", + "description": "Specifies the detail level of the image. Learn more in the [Vision guide](/docs/guides/vision#low-or-high-fidelity-image-understanding).", + "type": { + "$ref": "101" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.image_url.anonymous.detail" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.image_url" + } + ] + }, + { + "$id": "548", + "kind": "model", + "name": "ChatCompletionRequestMessageContentPartAudio", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio", + "usage": "Input,Json", + "description": "Learn about [audio inputs](/docs/guides/audio).", + "decorators": [], + "properties": [ + { + "$id": "549", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the content part. Always `input_audio`.", + "type": { + "$id": "550", + "kind": "constant", + "valueType": { + "$ref": "109" + }, + "value": "input_audio", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.type" + }, + { + "$id": "551", + "kind": "property", + "name": "input_audio", + "serializedName": "input_audio", + "type": { + "$id": "552", + "kind": "model", + "name": "ChatCompletionRequestMessageContentPartAudioInputAudio", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.input_audio.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "553", + "kind": "property", + "name": "data", + "serializedName": "data", + "description": "Base64 encoded audio data.", + "type": { + "$id": "554", + "kind": "bytes", + "name": "bytes", + "encode": "base64", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.input_audio.anonymous.data" + }, + { + "$id": "555", + "kind": "property", + "name": "format", + "serializedName": "format", + "description": "The format of the encoded audio data. Currently supports \"wav\" and \"mp3\".", + "type": { + "$ref": "112" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.input_audio.anonymous.format" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.input_audio" + } + ] + } + ], + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestUserMessage.content" + }, + { + "$id": "556", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the messages author, in this case `user`.", + "type": { + "$id": "557", + "kind": "constant", + "valueType": { + "$id": "558", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "user", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestUserMessage.role" + }, + { + "$id": "559", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", + "type": { + "$id": "560", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestUserMessage.name" + } + ] + }, + "assistant": { + "$id": "561", + "kind": "model", + "name": "ChatCompletionRequestAssistantMessage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage", + "usage": "Input,Json", + "description": "Messages sent by the model in response to user messages.", + "discriminatorValue": "assistant", + "decorators": [], + "baseModel": { + "$ref": "504" + }, + "properties": [ + { + "$id": "562", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.", + "type": { + "$id": "563", + "kind": "nullable", + "type": { + "$id": "564", + "kind": "union", + "name": "ChatCompletionRequestAssistantMessageContent", + "variantTypes": [ + { + "$id": "565", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "566", + "kind": "array", + "name": "ArrayChatCompletionRequestAssistantMessageContentPart", + "valueType": { + "$id": "567", + "kind": "union", + "name": "ChatCompletionRequestAssistantMessageContentPart", + "variantTypes": [ + { + "$ref": "514" + }, + { + "$id": "568", + "kind": "model", + "name": "ChatCompletionRequestMessageContentPartRefusal", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartRefusal", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "569", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the content part.", + "type": { + "$id": "570", + "kind": "constant", + "valueType": { + "$ref": "118" + }, + "value": "refusal", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartRefusal.type" + }, + { + "$id": "571", + "kind": "property", + "name": "refusal", + "serializedName": "refusal", + "description": "The refusal message generated by the model.", + "type": { + "$id": "572", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartRefusal.refusal" + } + ] + } + ], + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + ], + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.content" + }, + { + "$id": "573", + "kind": "property", + "name": "refusal", + "serializedName": "refusal", + "description": "The refusal message by the assistant.", + "type": { + "$id": "574", + "kind": "nullable", + "type": { + "$id": "575", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.refusal" + }, + { + "$id": "576", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the messages author, in this case `assistant`.", + "type": { + "$id": "577", + "kind": "constant", + "valueType": { + "$id": "578", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "assistant", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.role" + }, + { + "$id": "579", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", + "type": { + "$id": "580", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.name" + }, + { + "$id": "581", + "kind": "property", + "name": "audio", + "serializedName": "audio", + "description": "Data about a previous audio response from the model.\n[Learn more](/docs/guides/audio).", + "type": { + "$id": "582", + "kind": "nullable", + "type": { + "$id": "583", + "kind": "model", + "name": "ChatCompletionRequestAssistantMessageAudio", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.audio.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "584", + "kind": "property", + "name": "id", + "serializedName": "id", + "description": "Unique identifier for a previous audio response from the model.", + "type": { + "$id": "585", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.audio.anonymous.id" + } + ] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.audio" + }, + { + "$id": "586", + "kind": "property", + "name": "tool_calls", + "serializedName": "tool_calls", + "type": { + "$id": "587", + "kind": "array", + "name": "ChatCompletionMessageToolCalls", + "valueType": { + "$id": "588", + "kind": "model", + "name": "ChatCompletionMessageToolCall", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "589", + "kind": "property", + "name": "id", + "serializedName": "id", + "description": "The ID of the tool call.", + "type": { + "$id": "590", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.id" + }, + { + "$id": "591", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the tool. Currently, only `function` is supported.", + "type": { + "$id": "592", + "kind": "constant", + "valueType": { + "$ref": "121" + }, + "value": "function", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.type" + }, + { + "$id": "593", + "kind": "property", + "name": "function", + "serializedName": "function", + "description": "The function that the model called.", + "type": { + "$id": "594", + "kind": "model", + "name": "ChatCompletionMessageToolCallFunction", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.function.anonymous", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "595", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "The name of the function to call.", + "type": { + "$id": "596", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.function.anonymous.name" + }, + { + "$id": "597", + "kind": "property", + "name": "arguments", + "serializedName": "arguments", + "description": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.", + "type": { + "$id": "598", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.function.anonymous.arguments" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.function" + } + ] + }, + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCalls", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.tool_calls" + }, + { + "$id": "599", + "kind": "property", + "name": "function_call", + "serializedName": "function_call", + "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.", + "type": { + "$id": "600", + "kind": "nullable", + "type": { + "$id": "601", + "kind": "model", + "name": "ChatCompletionRequestAssistantMessageFunctionCall", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.function_call.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "602", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "603", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.function_call.anonymous.name" + }, + { + "$id": "604", + "kind": "property", + "name": "arguments", + "serializedName": "arguments", + "type": { + "$id": "605", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.function_call.anonymous.arguments" + } + ] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.function_call" + } + ] + }, + "tool": { + "$id": "606", + "kind": "model", + "name": "ChatCompletionRequestToolMessage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestToolMessage", + "usage": "Input,Json", + "discriminatorValue": "tool", + "decorators": [], + "baseModel": { + "$ref": "504" + }, + "properties": [ + { + "$id": "607", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the messages author, in this case `tool`.", + "type": { + "$id": "608", + "kind": "constant", + "valueType": { + "$id": "609", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "tool", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestToolMessage.role" + }, + { + "$id": "610", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The contents of the tool message.", + "type": { + "$id": "611", + "kind": "union", + "name": "ChatCompletionRequestToolMessageContent", + "variantTypes": [ + { + "$id": "612", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "613", + "kind": "array", + "name": "ArrayChatCompletionRequestToolMessageContentPart", + "valueType": { + "$id": "614", + "kind": "union", + "name": "ChatCompletionRequestToolMessageContentPart", + "variantTypes": [ + { + "$ref": "514" + } + ], + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestToolMessage.content" + }, + { + "$id": "615", + "kind": "property", + "name": "tool_call_id", + "serializedName": "tool_call_id", + "description": "Tool call that this message is responding to.", + "type": { + "$id": "616", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestToolMessage.tool_call_id" + } + ] + }, + "function": { + "$id": "617", + "kind": "model", + "name": "ChatCompletionRequestFunctionMessage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestFunctionMessage", + "usage": "Input,Json", + "deprecation": "This field is marked as deprecated.", + "discriminatorValue": "function", + "decorators": [], + "baseModel": { + "$ref": "504" + }, + "properties": [ + { + "$id": "618", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the messages author, in this case `function`.", + "type": { + "$id": "619", + "kind": "constant", + "valueType": { + "$id": "620", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "function", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestFunctionMessage.role" + }, + { + "$id": "621", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The contents of the function message.", + "type": { + "$id": "622", + "kind": "nullable", + "type": { + "$id": "623", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestFunctionMessage.content" + }, + { + "$id": "624", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "The name of the function to call.", + "type": { + "$id": "625", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestFunctionMessage.name" + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.messages" + }, + { + "$id": "626", + "kind": "property", + "name": "store", + "serializedName": "store", + "description": "Whether or not to store the output of this chat completion request for\nuse in our [model distillation](/docs/guides/distillation) or\n[evals](/docs/guides/evals) products.", + "type": { + "$id": "627", + "kind": "nullable", + "type": { + "$id": "628", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.store" + }, + { + "$id": "629", + "kind": "property", + "name": "reasoning_effort", + "serializedName": "reasoning_effort", + "description": "**o1 models only** \n\nConstrains effort on reasoning for \n[reasoning models](https://platform.openai.com/docs/guides/reasoning).\nCurrently supported values are `low`, `medium`, and `high`. Reducing\nreasoning effort can result in faster responses and fewer tokens used\non reasoning in a response.", + "type": { + "$ref": "124" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.reasoning_effort" + }, + { + "$id": "630", + "kind": "property", + "name": "metadata", + "serializedName": "metadata", + "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.", + "type": { + "$id": "631", + "kind": "dict", + "keyType": { + "$id": "632", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "633", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.metadata" + }, + { + "$id": "634", + "kind": "property", + "name": "frequency_penalty", + "serializedName": "frequency_penalty", + "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\ntheir existing frequency in the text so far, decreasing the model's\nlikelihood to repeat the same line verbatim.", + "type": { + "$id": "635", + "kind": "nullable", + "type": { + "$id": "636", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.frequency_penalty" + }, + { + "$id": "637", + "kind": "property", + "name": "logit_bias", + "serializedName": "logit_bias", + "description": "Modify the likelihood of specified tokens appearing in the completion.\n\nAccepts a JSON object that maps tokens (specified by their token ID in the\ntokenizer) to an associated bias value from -100 to 100. Mathematically,\nthe bias is added to the logits generated by the model prior to sampling.\nThe exact effect will vary per model, but values between -1 and 1 should\ndecrease or increase likelihood of selection; values like -100 or 100\nshould result in a ban or exclusive selection of the relevant token.", + "type": { + "$id": "638", + "kind": "nullable", + "type": { + "$id": "639", + "kind": "dict", + "keyType": { + "$id": "640", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "641", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.logit_bias" + }, + { + "$id": "642", + "kind": "property", + "name": "logprobs", + "serializedName": "logprobs", + "description": "Whether to return log probabilities of the output tokens or not. If true,\nreturns the log probabilities of each output token returned in the\n`content` of `message`.", + "type": { + "$id": "643", + "kind": "nullable", + "type": { + "$id": "644", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.logprobs" + }, + { + "$id": "645", + "kind": "property", + "name": "top_logprobs", + "serializedName": "top_logprobs", + "description": "An integer between 0 and 20 specifying the number of most likely tokens to\nreturn at each token position, each with an associated log probability.\n`logprobs` must be set to `true` if this parameter is used.", + "type": { + "$id": "646", + "kind": "nullable", + "type": { + "$id": "647", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.top_logprobs" + }, + { + "$id": "648", + "kind": "property", + "name": "max_tokens", + "serializedName": "max_tokens", + "description": "The maximum number of [tokens](/tokenizer) that can be generated in the\nchat completion. This value can be used to control\n[costs](https://openai.com/api/pricing/) for text generated via API.\n\nThis value is now deprecated in favor of `max_completion_tokens`, and is\nnot compatible with [o1 series models](/docs/guides/reasoning).", + "type": { + "$id": "649", + "kind": "nullable", + "type": { + "$id": "650", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.max_tokens" + }, + { + "$id": "651", + "kind": "property", + "name": "max_completion_tokens", + "serializedName": "max_completion_tokens", + "description": "An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](/docs/guides/reasoning).", + "type": { + "$id": "652", + "kind": "nullable", + "type": { + "$id": "653", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.max_completion_tokens" + }, + { + "$id": "654", + "kind": "property", + "name": "n", + "serializedName": "n", + "description": "How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.", + "type": { + "$id": "655", + "kind": "nullable", + "type": { + "$id": "656", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.n" + }, + { + "$id": "657", + "kind": "property", + "name": "modalities", + "serializedName": "modalities", + "type": { + "$id": "658", + "kind": "nullable", + "type": { + "$id": "659", + "kind": "array", + "name": "ChatCompletionModalities", + "valueType": { + "$ref": "132" + }, + "crossLanguageDefinitionId": "OpenAI.ChatCompletionModalities", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.modalities" + }, + { + "$id": "660", + "kind": "property", + "name": "prediction", + "serializedName": "prediction", + "description": "Configuration for a [Predicted Output](/docs/guides/predicted-outputs),\nwhich can greatly improve response times when large parts of the model\nresponse are known ahead of time. This is most common when you are\nregenerating a file with only minor changes to most of the content.", + "type": { + "$id": "661", + "kind": "nullable", + "type": { + "$id": "662", + "kind": "model", + "name": "ChatOutputPrediction", + "crossLanguageDefinitionId": "OpenAI.ChatOutputPrediction", + "usage": "Input,Json", + "description": "Base representation of predicted output from a model.", + "decorators": [], + "discriminatorProperty": { + "$id": "663", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$ref": "138" + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatOutputPrediction.type" + }, + "properties": [ + { + "$ref": "663" + } + ], + "discriminatedSubtypes": { + "$id": "664", + "content": { + "$id": "665", + "kind": "model", + "name": "ChatOutputPredictionContent", + "crossLanguageDefinitionId": "OpenAI.ChatOutputPredictionContent", + "usage": "Input,Json", + "description": "Static predicted output content, such as the content of a text file that is\nbeing regenerated.", + "discriminatorValue": "content", + "decorators": [], + "baseModel": { + "$ref": "662" + }, + "properties": [ + { + "$id": "666", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the predicted content you want to provide. This type is\ncurrently always `content`.", + "type": { + "$id": "667", + "kind": "constant", + "valueType": { + "$id": "668", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "content", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatOutputPredictionContent.type" + }, + { + "$id": "669", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The content that should be matched when generating a model response.\nIf generated tokens would match this content, the entire model response\ncan be returned much more quickly.", + "type": { + "$id": "670", + "kind": "union", + "name": "ChatOutputPredictionContentContent", + "variantTypes": [ + { + "$id": "671", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "672", + "kind": "array", + "name": "ArrayChatCompletionRequestMessageContentPartText", + "valueType": { + "$ref": "514" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatOutputPredictionContent.content" + } + ] + } + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.prediction" + }, + { + "$id": "673", + "kind": "property", + "name": "audio", + "serializedName": "audio", + "description": "Parameters for audio output. Required when audio output is requested with\n`modalities: [\"audio\"]`. [Learn more](/docs/guides/audio).", + "type": { + "$id": "674", + "kind": "nullable", + "type": { + "$id": "675", + "kind": "model", + "name": "AzureCreateChatCompletionRequestAudio", + "crossLanguageDefinitionId": "OpenAI.AzureCreateChatCompletionRequest.audio.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "676", + "kind": "property", + "name": "voice", + "serializedName": "voice", + "description": "The voice the model uses to respond. Supported voices are `ash`, `ballad`, `coral`, `sage`, and `verse` (also supported but not recommended are `alloy`, `echo`, and `shimmer`; these voices are less expressive).", + "type": { + "$ref": "142" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateChatCompletionRequestCommonBase.audio.anonymous.voice" + }, + { + "$id": "677", + "kind": "property", + "name": "format", + "serializedName": "format", + "description": "Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`,\n`opus`, or `pcm16`.", + "type": { + "$ref": "160" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CreateChatCompletionRequestCommonBase.audio.anonymous.format" + } + ] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.audio" + }, + { + "$id": "678", + "kind": "property", + "name": "presence_penalty", + "serializedName": "presence_penalty", + "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\nwhether they appear in the text so far, increasing the model's likelihood\nto talk about new topics.", + "type": { + "$id": "679", + "kind": "nullable", + "type": { + "$id": "680", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.presence_penalty" + }, + { + "$id": "681", + "kind": "property", + "name": "response_format", + "serializedName": "response_format", + "description": "An object specifying the format that the model must output.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\nStructured Outputs which ensures the model will match your supplied JSON\nschema. Learn more in the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures\nthe message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model\nto produce JSON yourself via a system or user message. Without this, the\nmodel may generate an unending stream of whitespace until the generation\nreaches the token limit, resulting in a long-running and seemingly \"stuck\"\nrequest. Also note that the message content may be partially cut off if\n`finish_reason=\"length\"`, which indicates the generation exceeded\n`max_tokens` or the conversation exceeded the max context length.", + "type": { + "$id": "682", + "kind": "model", + "name": "ChatResponseFormat", + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormat", + "usage": "Input,Json", + "decorators": [], + "discriminatorProperty": { + "$id": "683", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "684", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormat.type" + }, + "properties": [ + { + "$ref": "683" + } + ], + "discriminatedSubtypes": { + "$id": "685", + "text": { + "$id": "686", + "kind": "model", + "name": "ChatResponseFormatText", + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatText", + "usage": "Input,Json", + "discriminatorValue": "text", + "decorators": [], + "baseModel": { + "$ref": "682" + }, + "properties": [ + { + "$id": "687", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of response format being defined: `text`", + "type": { + "$id": "688", + "kind": "constant", + "valueType": { + "$id": "689", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "text", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatText.type" + } + ] + }, + "json_object": { + "$id": "690", + "kind": "model", + "name": "ChatResponseFormatJsonObject", + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonObject", + "usage": "Input,Json", + "discriminatorValue": "json_object", + "decorators": [], + "baseModel": { + "$ref": "682" + }, + "properties": [ + { + "$id": "691", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of response format being defined: `json_object`", + "type": { + "$id": "692", + "kind": "constant", + "valueType": { + "$id": "693", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "json_object", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonObject.type" + } + ] + }, + "json_schema": { + "$id": "694", + "kind": "model", + "name": "ChatResponseFormatJsonSchema", + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema", + "usage": "Input,Json", + "discriminatorValue": "json_schema", + "decorators": [], + "baseModel": { + "$ref": "682" + }, + "properties": [ + { + "$id": "695", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of response format being defined: `json_schema`", + "type": { + "$id": "696", + "kind": "constant", + "valueType": { + "$id": "697", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "json_schema", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.type" + }, + { + "$id": "698", + "kind": "property", + "name": "json_schema", + "serializedName": "json_schema", + "type": { + "$id": "699", + "kind": "model", + "name": "ChatResponseFormatJsonSchemaJsonSchema", + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "700", + "kind": "property", + "name": "description", + "serializedName": "description", + "description": "A description of what the response format is for, used by the model to determine how to respond in the format.", + "type": { + "$id": "701", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous.description" + }, + { + "$id": "702", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "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.", + "type": { + "$id": "703", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous.name" + }, + { + "$id": "704", + "kind": "property", + "name": "schema", + "serializedName": "schema", + "type": { + "$id": "705", + "kind": "model", + "name": "ResponseFormatJsonSchemaSchema", + "crossLanguageDefinitionId": "OpenAI.ResponseFormatJsonSchemaSchema", + "usage": "Input,Json", + "description": "The schema for the response format, described as a JSON Schema object.", + "decorators": [], + "additionalProperties": { + "$id": "706", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "properties": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous.schema" + }, + { + "$id": "707", + "kind": "property", + "name": "strict", + "serializedName": "strict", + "description": "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](/docs/guides/structured-outputs).", + "type": { + "$id": "708", + "kind": "nullable", + "type": { + "$id": "709", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous.strict" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema" + } + ] + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.response_format" + }, + { + "$id": "710", + "kind": "property", + "name": "seed", + "serializedName": "seed", + "description": "This feature is in Beta.\nIf specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.", + "type": { + "$id": "711", + "kind": "nullable", + "type": { + "$id": "712", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.seed" + }, + { + "$id": "713", + "kind": "property", + "name": "stop", + "serializedName": "stop", + "description": "Up to 4 sequences where the API will stop generating further tokens.", + "type": { + "$id": "714", + "kind": "nullable", + "type": { + "$id": "715", + "kind": "union", + "name": "AzureCreateChatCompletionRequestStop", + "variantTypes": [ + { + "$id": "716", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "717", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "718", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + ], + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.stop" + }, + { + "$id": "719", + "kind": "property", + "name": "stream", + "serializedName": "stream", + "description": "If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).", + "type": { + "$id": "720", + "kind": "nullable", + "type": { + "$id": "721", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.stream" + }, + { + "$id": "722", + "kind": "property", + "name": "stream_options", + "serializedName": "stream_options", + "type": { + "$id": "723", + "kind": "nullable", + "type": { + "$id": "724", + "kind": "model", + "name": "ChatCompletionStreamOptions", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionStreamOptions", + "usage": "Input,Json", + "description": "Options for streaming response. Only set this when you set `stream: true`.", + "decorators": [], + "properties": [ + { + "$id": "725", + "kind": "property", + "name": "include_usage", + "serializedName": "include_usage", + "description": "If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.", + "type": { + "$id": "726", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionStreamOptions.include_usage" + } + ] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.stream_options" + }, + { + "$id": "727", + "kind": "property", + "name": "temperature", + "serializedName": "temperature", + "description": "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.\nWe generally recommend altering this or `top_p` but not both.", + "type": { + "$id": "728", + "kind": "nullable", + "type": { + "$id": "729", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.temperature" + }, + { + "$id": "730", + "kind": "property", + "name": "top_p", + "serializedName": "top_p", + "description": "An alternative to sampling with temperature, called nucleus sampling,\nwhere the model considers the results of the tokens with top_p probability\nmass. So 0.1 means only the tokens comprising the top 10% probability mass\nare considered.\n\nWe generally recommend altering this or `temperature` but not both.", + "type": { + "$id": "731", + "kind": "nullable", + "type": { + "$id": "732", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.top_p" + }, + { + "$id": "733", + "kind": "property", + "name": "tools", + "serializedName": "tools", + "description": "A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.", + "type": { + "$id": "734", + "kind": "array", + "name": "ArrayChatCompletionTool", + "valueType": { + "$id": "735", + "kind": "model", + "name": "ChatCompletionTool", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionTool", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "736", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the tool. Currently, only `function` is supported.", + "type": { + "$id": "737", + "kind": "constant", + "valueType": { + "$ref": "172" + }, + "value": "function", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionTool.type" + }, + { + "$id": "738", + "kind": "property", + "name": "function", + "serializedName": "function", + "type": { + "$ref": "346" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionTool.function" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.tools" + }, + { + "$id": "739", + "kind": "property", + "name": "tool_choice", + "serializedName": "tool_choice", + "type": { + "$id": "740", + "kind": "union", + "name": "ChatCompletionToolChoiceOption", + "variantTypes": [ + { + "$ref": "175" + }, + { + "$id": "741", + "kind": "model", + "name": "ChatCompletionNamedToolChoice", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice", + "usage": "Input,Json", + "description": "Specifies a tool the model should use. Use to force the model to call a specific function.", + "decorators": [], + "properties": [ + { + "$id": "742", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the tool. Currently, only `function` is supported.", + "type": { + "$id": "743", + "kind": "constant", + "valueType": { + "$ref": "183" + }, + "value": "function", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice.type" + }, + { + "$id": "744", + "kind": "property", + "name": "function", + "serializedName": "function", + "type": { + "$id": "745", + "kind": "model", + "name": "ChatCompletionNamedToolChoiceFunction", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice.function.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "746", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "The name of the function to call.", + "type": { + "$id": "747", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice.function.anonymous.name" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice.function" + } + ] + } + ], + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.tool_choice" + }, + { + "$id": "748", + "kind": "property", + "name": "parallel_tool_calls", + "serializedName": "parallel_tool_calls", + "type": { + "$id": "749", + "kind": "boolean", + "name": "ParallelToolCalls", + "crossLanguageDefinitionId": "OpenAI.ParallelToolCalls", + "baseType": { + "$id": "750", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.parallel_tool_calls" + }, + { + "$id": "751", + "kind": "property", + "name": "user", + "serializedName": "user", + "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).", + "type": { + "$id": "752", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.user" + }, + { + "$id": "753", + "kind": "property", + "name": "function_call", + "serializedName": "function_call", + "description": "Deprecated in favor of `tool_choice`.\n\nControls which (if any) function is called by the model.\n\n`none` means the model will not call a function and instead generates a\nmessage.\n\n`auto` means the model can pick between generating a message or calling a\nfunction.\n\nSpecifying a particular function via `{\"name\": \"my_function\"}` forces the\nmodel to call that function.\n\n`none` is the default when no functions are present. `auto` is the default\nif functions are present.", + "type": { + "$id": "754", + "kind": "union", + "name": "AzureCreateChatCompletionRequestFunctionCall", + "variantTypes": [ + { + "$id": "755", + "kind": "constant", + "valueType": { + "$id": "756", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "none", + "decorators": [] + }, + { + "$id": "757", + "kind": "constant", + "valueType": { + "$id": "758", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "auto", + "decorators": [] + }, + { + "$id": "759", + "kind": "model", + "name": "ChatCompletionFunctionCallOption", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctionCallOption", + "usage": "Input,Json", + "description": "Specifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function.", + "decorators": [], + "properties": [ + { + "$id": "760", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "The name of the function to call.", + "type": { + "$id": "761", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctionCallOption.name" + } + ] + } + ], + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.function_call" + }, + { + "$id": "762", + "kind": "property", + "name": "functions", + "serializedName": "functions", + "description": "Deprecated in favor of `tools`.\n\nA list of functions the model may generate JSON inputs for.", + "type": { + "$id": "763", + "kind": "array", + "name": "ArrayChatCompletionFunctions", + "valueType": { + "$id": "764", + "kind": "model", + "name": "ChatCompletionFunctions", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctions", + "usage": "Input,Json", + "deprecation": "This field is marked as deprecated.", + "decorators": [], + "properties": [ + { + "$id": "765", + "kind": "property", + "name": "description", + "serializedName": "description", + "description": "A description of what the function does, used by the model to choose when and how to call the function.", + "type": { + "$id": "766", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctions.description" + }, + { + "$id": "767", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", + "type": { + "$id": "768", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctions.name" + }, + { + "$id": "769", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\n\nOmitting `parameters` defines a function with an empty parameter list.", + "type": { + "$id": "770", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctions.parameters" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.functions" + }, + { + "$id": "771", + "kind": "property", + "name": "data_sources", + "serializedName": "data_sources", + "description": "The data sources to use for the On Your Data feature, exclusive to Azure OpenAI.", + "type": { + "$id": "772", + "kind": "array", + "name": "ArrayAzureChatDataSource", + "valueType": { + "$id": "773", + "kind": "model", + "name": "AzureChatDataSource", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSource", + "access": "public", + "usage": "Input,Json", + "description": "A representation of configuration data for a single Azure OpenAI chat data source.\nThis will be used by a chat completions request that should use Azure OpenAI chat extensions to augment the\nresponse behavior.\nThe use of this configuration is compatible only with Azure OpenAI.", + "decorators": [], + "discriminatorProperty": { + "$id": "774", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The differentiating type identifier for the data source.", + "type": { + "$id": "775", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSource.type" + }, + "properties": [ + { + "$ref": "774" + } + ], + "discriminatedSubtypes": { + "$id": "776", + "azure_search": { + "$id": "777", + "kind": "model", + "name": "AzureSearchChatDataSource", + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource", + "access": "public", + "usage": "Input,Json", + "description": "Represents a data source configuration that will use an Azure Search resource.", + "discriminatorValue": "azure_search", + "decorators": [], + "baseModel": { + "$ref": "773" + }, + "properties": [ + { + "$id": "778", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The discriminated type identifier, which is always 'azure_search'.", + "type": { + "$id": "779", + "kind": "constant", + "valueType": { + "$id": "780", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "azure_search", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.type" + }, + { + "$id": "781", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "description": "The parameter information to control the use of the Azure Search data source.", + "type": { + "$id": "782", + "kind": "model", + "name": "AzureSearchChatDataSourceParameters", + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "783", + "kind": "property", + "name": "top_n_documents", + "serializedName": "top_n_documents", + "description": "The configured number of documents to feature in the query.", + "type": { + "$id": "784", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.top_n_documents" + }, + { + "$id": "785", + "kind": "property", + "name": "in_scope", + "serializedName": "in_scope", + "description": "Whether queries should be restricted to use of the indexed data.", + "type": { + "$id": "786", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.in_scope" + }, + { + "$id": "787", + "kind": "property", + "name": "strictness", + "serializedName": "strictness", + "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", + "type": { + "$id": "788", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.strictness" + }, + { + "$id": "789", + "kind": "property", + "name": "max_search_queries", + "serializedName": "max_search_queries", + "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", + "type": { + "$id": "790", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.max_search_queries" + }, + { + "$id": "791", + "kind": "property", + "name": "allow_partial_result", + "serializedName": "allow_partial_result", + "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", + "type": { + "$id": "792", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.allow_partial_result" + }, + { + "$id": "793", + "kind": "property", + "name": "include_contexts", + "serializedName": "include_contexts", + "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", + "type": { + "$id": "794", + "kind": "array", + "name": "Array", + "valueType": { + "$ref": "186" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.include_contexts" + }, + { + "$id": "795", + "kind": "property", + "name": "endpoint", + "serializedName": "endpoint", + "description": "The absolute endpoint path for the Azure Search resource to use.", + "type": { + "$id": "796", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.endpoint" + }, + { + "$id": "797", + "kind": "property", + "name": "index_name", + "serializedName": "index_name", + "description": "The name of the index to use, as specified in the Azure Search resource.", + "type": { + "$id": "798", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.index_name" + }, + { + "$id": "799", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "description": "The authentication mechanism to use with Azure Search.", + "type": { + "$id": "800", + "kind": "union", + "name": "AzureSearchChatDataSourceParametersAuthentication", + "variantTypes": [ + { + "$id": "801", + "kind": "model", + "name": "AzureChatDataSourceApiKeyAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceApiKeyAuthenticationOptions", + "usage": "Input,Json", + "discriminatorValue": "api_key", + "decorators": [], + "baseModel": { + "$id": "802", + "kind": "model", + "name": "AzureChatDataSourceAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAuthenticationOptions", + "usage": "Input,Json", + "decorators": [], + "discriminatorProperty": { + "$id": "803", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "804", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAuthenticationOptions.type" + }, + "properties": [ + { + "$ref": "803" + } + ], + "discriminatedSubtypes": { + "$id": "805", + "api_key": { + "$ref": "801" + }, + "connection_string": { + "$id": "806", + "kind": "model", + "name": "AzureChatDataSourceConnectionStringAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceConnectionStringAuthenticationOptions", + "usage": "Input,Json", + "discriminatorValue": "connection_string", + "decorators": [], + "baseModel": { + "$ref": "802" + }, + "properties": [ + { + "$id": "807", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "808", + "kind": "constant", + "valueType": { + "$id": "809", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "connection_string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceConnectionStringAuthenticationOptions.type" + }, + { + "$id": "810", + "kind": "property", + "name": "connection_string", + "serializedName": "connection_string", + "type": { + "$id": "811", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceConnectionStringAuthenticationOptions.connection_string" + } + ] + }, + "system_assigned_managed_identity": { + "$id": "812", + "kind": "model", + "name": "AzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions", + "usage": "Input,Json", + "discriminatorValue": "system_assigned_managed_identity", + "decorators": [], + "baseModel": { + "$ref": "802" + }, + "properties": [ + { + "$id": "813", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "814", + "kind": "constant", + "valueType": { + "$id": "815", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "system_assigned_managed_identity", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.type" + } + ] + }, + "user_assigned_managed_identity": { + "$id": "816", + "kind": "model", + "name": "AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions", + "usage": "Input,Json", + "discriminatorValue": "user_assigned_managed_identity", + "decorators": [], + "baseModel": { + "$ref": "802" + }, + "properties": [ + { + "$id": "817", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "818", + "kind": "constant", + "valueType": { + "$id": "819", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "user_assigned_managed_identity", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.type" + }, + { + "$id": "820", + "kind": "property", + "name": "managed_identity_resource_id", + "serializedName": "managed_identity_resource_id", + "type": { + "$id": "821", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.managed_identity_resource_id" + } + ] + }, + "key_and_key_id": { + "$id": "822", + "kind": "model", + "name": "AzureChatDataSourceKeyAndKeyIdAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceKeyAndKeyIdAuthenticationOptions", + "usage": "Input,Json", + "discriminatorValue": "key_and_key_id", + "decorators": [], + "baseModel": { + "$ref": "802" + }, + "properties": [ + { + "$id": "823", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "824", + "kind": "constant", + "valueType": { + "$id": "825", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "key_and_key_id", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceKeyAndKeyIdAuthenticationOptions.type" + }, + { + "$id": "826", + "kind": "property", + "name": "key", + "serializedName": "key", + "type": { + "$id": "827", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceKeyAndKeyIdAuthenticationOptions.key" + }, + { + "$id": "828", + "kind": "property", + "name": "key_id", + "serializedName": "key_id", + "type": { + "$id": "829", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceKeyAndKeyIdAuthenticationOptions.key_id" + } + ] + }, + "encoded_api_key": { + "$id": "830", + "kind": "model", + "name": "AzureChatDataSourceEncodedApiKeyAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEncodedApiKeyAuthenticationOptions", + "usage": "Input,Json", + "discriminatorValue": "encoded_api_key", + "decorators": [], + "baseModel": { + "$ref": "802" + }, + "properties": [ + { + "$id": "831", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "832", + "kind": "constant", + "valueType": { + "$id": "833", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "encoded_api_key", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEncodedApiKeyAuthenticationOptions.type" + }, + { + "$id": "834", + "kind": "property", + "name": "encoded_api_key", + "serializedName": "encoded_api_key", + "type": { + "$id": "835", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEncodedApiKeyAuthenticationOptions.encoded_api_key" + } + ] + }, + "access_token": { + "$id": "836", + "kind": "model", + "name": "AzureChatDataSourceAccessTokenAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAccessTokenAuthenticationOptions", + "usage": "Input,Json", + "discriminatorValue": "access_token", + "decorators": [], + "baseModel": { + "$ref": "802" + }, + "properties": [ + { + "$id": "837", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "838", + "kind": "constant", + "valueType": { + "$id": "839", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "access_token", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAccessTokenAuthenticationOptions.type" + }, + { + "$id": "840", + "kind": "property", + "name": "access_token", + "serializedName": "access_token", + "type": { + "$id": "841", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAccessTokenAuthenticationOptions.access_token" + } + ] + }, + "username_and_password": { + "$id": "842", + "kind": "model", + "name": "AzureChatDataSourceUsernameAndPasswordAuthenticationOptions", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUsernameAndPasswordAuthenticationOptions", + "usage": "Input,Json", + "discriminatorValue": "username_and_password", + "decorators": [], + "baseModel": { + "$ref": "802" + }, + "properties": [ + { + "$id": "843", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "844", + "kind": "constant", + "valueType": { + "$id": "845", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "username_and_password", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUsernameAndPasswordAuthenticationOptions.type" + }, + { + "$id": "846", + "kind": "property", + "name": "username", + "serializedName": "username", + "type": { + "$id": "847", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUsernameAndPasswordAuthenticationOptions.username" + }, + { + "$id": "848", + "kind": "property", + "name": "password", + "serializedName": "password", + "type": { + "$id": "849", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUsernameAndPasswordAuthenticationOptions.password" + } + ] + } + } + }, + "properties": [ + { + "$id": "850", + "kind": "property", + "name": "type", + "serializedName": "type", + "type": { + "$id": "851", + "kind": "constant", + "valueType": { + "$id": "852", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "api_key", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceApiKeyAuthenticationOptions.type" + }, + { + "$id": "853", + "kind": "property", + "name": "key", + "serializedName": "key", + "type": { + "$id": "854", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceApiKeyAuthenticationOptions.key" + } + ] + }, + { + "$ref": "812" + }, + { + "$ref": "816" + }, + { + "$ref": "836" + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.authentication" + }, + { + "$id": "855", + "kind": "property", + "name": "fields_mapping", + "serializedName": "fields_mapping", + "description": "The field mappings to use with the Azure Search resource.", + "type": { + "$id": "856", + "kind": "model", + "name": "AzureSearchChatDataSourceParametersFieldsMapping", + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "857", + "kind": "property", + "name": "title_field", + "serializedName": "title_field", + "description": "The name of the index field to use as a title.", + "type": { + "$id": "858", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.title_field" + }, + { + "$id": "859", + "kind": "property", + "name": "url_field", + "serializedName": "url_field", + "description": "The name of the index field to use as a URL.", + "type": { + "$id": "860", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.url_field" + }, + { + "$id": "861", + "kind": "property", + "name": "filepath_field", + "serializedName": "filepath_field", + "description": "The name of the index field to use as a filepath.", + "type": { + "$id": "862", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.filepath_field" + }, + { + "$id": "863", + "kind": "property", + "name": "content_fields", + "serializedName": "content_fields", + "description": "The names of index fields that should be treated as content.", + "type": { + "$id": "864", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "865", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.content_fields" + }, + { + "$id": "866", + "kind": "property", + "name": "content_fields_separator", + "serializedName": "content_fields_separator", + "description": "The separator pattern that content fields should use.", + "type": { + "$id": "867", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" + }, + { + "$id": "868", + "kind": "property", + "name": "vector_fields", + "serializedName": "vector_fields", + "description": "The names of fields that represent vector data.", + "type": { + "$id": "869", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "870", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.vector_fields" + }, + { + "$id": "871", + "kind": "property", + "name": "image_vector_fields", + "serializedName": "image_vector_fields", + "description": "The names of fields that represent image vector data.", + "type": { + "$id": "872", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "873", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.image_vector_fields" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.fields_mapping" + }, + { + "$id": "874", + "kind": "property", + "name": "query_type", + "serializedName": "query_type", + "description": "The query type for the Azure Search resource to use.", + "type": { + "$ref": "194" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.query_type" + }, + { + "$id": "875", + "kind": "property", + "name": "semantic_configuration", + "serializedName": "semantic_configuration", + "description": "Additional semantic configuration for the query.", + "type": { + "$id": "876", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.semantic_configuration" + }, + { + "$id": "877", + "kind": "property", + "name": "filter", + "serializedName": "filter", + "description": "A filter to apply to the search.", + "type": { + "$id": "878", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.filter" + }, + { + "$id": "879", + "kind": "property", + "name": "embedding_dependency", + "serializedName": "embedding_dependency", + "description": "The vectorization source to use with Azure Search.\nSupported sources for Azure Search include endpoint, deployment name, and integrated.", + "type": { + "$id": "880", + "kind": "model", + "name": "AzureChatDataSourceVectorizationSource", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceVectorizationSource", + "access": "public", + "usage": "Input,Json", + "description": "A representation of a data vectorization source usable as an embedding resource with a data source.", + "decorators": [], + "discriminatorProperty": { + "$id": "881", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The differentiating identifier for the concrete vectorization source.", + "type": { + "$id": "882", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceVectorizationSource.type" + }, + "properties": [ + { + "$ref": "881" + } + ], + "discriminatedSubtypes": { + "$id": "883", + "endpoint": { + "$id": "884", + "kind": "model", + "name": "AzureChatDataSourceEndpointVectorizationSource", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource", + "access": "public", + "usage": "Input,Json", + "description": "Represents a vectorization source that makes public service calls against an Azure OpenAI embedding model deployment.", + "discriminatorValue": "endpoint", + "decorators": [], + "baseModel": { + "$ref": "880" + }, + "properties": [ + { + "$id": "885", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type identifier, always 'endpoint' for this vectorization source type.", + "type": { + "$id": "886", + "kind": "constant", + "valueType": { + "$id": "887", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "endpoint", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource.type" + }, + { + "$id": "888", + "kind": "property", + "name": "endpoint", + "serializedName": "endpoint", + "description": "Specifies the resource endpoint URL from which embeddings should be retrieved.\nIt should be in the format of:\nhttps://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings.\nThe api-version query parameter is not allowed.", + "type": { + "$id": "889", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource.endpoint" + }, + { + "$id": "890", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "description": "The authentication mechanism to use with the endpoint-based vectorization source.\nEndpoint authentication supports API key and access token mechanisms.", + "type": { + "$id": "891", + "kind": "union", + "name": "AzureChatDataSourceEndpointVectorizationSourceAuthentication", + "variantTypes": [ + { + "$ref": "801" + }, + { + "$ref": "836" + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource.authentication" + }, + { + "$id": "892", + "kind": "property", + "name": "dimensions", + "serializedName": "dimensions", + "description": "The number of dimensions to request on embeddings.\nOnly supported in 'text-embedding-3' and later models.", + "type": { + "$id": "893", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource.dimensions" + } + ] + }, + "deployment_name": { + "$id": "894", + "kind": "model", + "name": "AzureChatDataSourceDeploymentNameVectorizationSource", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceDeploymentNameVectorizationSource", + "access": "public", + "usage": "Input,Json", + "description": "Represents a vectorization source that makes internal service calls against an Azure OpenAI embedding model\ndeployment. In contrast with the endpoint-based vectorization source, a deployment-name-based vectorization source\nmust be part of the same Azure OpenAI resource but can be used even in private networks.", + "discriminatorValue": "deployment_name", + "decorators": [], + "baseModel": { + "$ref": "880" + }, + "properties": [ + { + "$id": "895", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type identifier, always 'deployment_name' for this vectorization source type.", + "type": { + "$id": "896", + "kind": "constant", + "valueType": { + "$id": "897", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "deployment_name", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceDeploymentNameVectorizationSource.type" + }, + { + "$id": "898", + "kind": "property", + "name": "deployment_name", + "serializedName": "deployment_name", + "description": "The embedding model deployment to use for vectorization. This deployment must exist within the same Azure OpenAI\nresource as the model deployment being used for chat completions.", + "type": { + "$id": "899", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceDeploymentNameVectorizationSource.deployment_name" + }, + { + "$id": "900", + "kind": "property", + "name": "dimensions", + "serializedName": "dimensions", + "description": "The number of dimensions to request on embeddings.\nOnly supported in 'text-embedding-3' and later models.", + "type": { + "$id": "901", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceDeploymentNameVectorizationSource.dimensions" + } + ] + }, + "model_id": { + "$id": "902", + "kind": "model", + "name": "AzureChatDataSourceModelIdVectorizationSource", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceModelIdVectorizationSource", + "access": "public", + "usage": "Input,Json", + "description": "Represents a vectorization source that makes service calls based on a search service model ID.\nThis source type is currently only supported by Elasticsearch.", + "discriminatorValue": "model_id", + "decorators": [], + "baseModel": { + "$ref": "880" + }, + "properties": [ + { + "$id": "903", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type identifier, always 'model_id' for this vectorization source type.", + "type": { + "$id": "904", + "kind": "constant", + "valueType": { + "$id": "905", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "model_id", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceModelIdVectorizationSource.type" + }, + { + "$id": "906", + "kind": "property", + "name": "model_id", + "serializedName": "model_id", + "description": "The embedding model build ID to use for vectorization.", + "type": { + "$id": "907", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceModelIdVectorizationSource.model_id" + } + ] + }, + "integrated": { + "$id": "908", + "kind": "model", + "name": "AzureChatDataSourceIntegratedVectorizationSource", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceIntegratedVectorizationSource", + "usage": "Input,Json", + "description": "Represents an integrated vectorization source as defined within the supporting search resource.", + "discriminatorValue": "integrated", + "decorators": [], + "baseModel": { + "$ref": "880" + }, + "properties": [ + { + "$id": "909", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type identifier, always 'integrated' for this vectorization source type.", + "type": { + "$id": "910", + "kind": "constant", + "valueType": { + "$id": "911", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "integrated", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceIntegratedVectorizationSource.type" + } + ] + } + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.embedding_dependency" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters" + } + ] + }, + "azure_cosmos_db": { + "$id": "912", + "kind": "model", + "name": "AzureCosmosDBChatDataSource", + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource", + "access": "public", + "usage": "Input,Json", + "description": "Represents a data source configuration that will use an Azure CosmosDB resource.", + "discriminatorValue": "azure_cosmos_db", + "decorators": [], + "baseModel": { + "$ref": "773" + }, + "properties": [ + { + "$id": "913", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The discriminated type identifier, which is always 'azure_cosmos_db'.", + "type": { + "$id": "914", + "kind": "constant", + "valueType": { + "$id": "915", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "azure_cosmos_db", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.type" + }, + { + "$id": "916", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "description": "The parameter information to control the use of the Azure CosmosDB data source.", + "type": { + "$id": "917", + "kind": "model", + "name": "AzureCosmosDBChatDataSourceParameters", + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "918", + "kind": "property", + "name": "top_n_documents", + "serializedName": "top_n_documents", + "description": "The configured number of documents to feature in the query.", + "type": { + "$id": "919", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.top_n_documents" + }, + { + "$id": "920", + "kind": "property", + "name": "in_scope", + "serializedName": "in_scope", + "description": "Whether queries should be restricted to use of the indexed data.", + "type": { + "$id": "921", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.in_scope" + }, + { + "$id": "922", + "kind": "property", + "name": "strictness", + "serializedName": "strictness", + "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", + "type": { + "$id": "923", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.strictness" + }, + { + "$id": "924", + "kind": "property", + "name": "max_search_queries", + "serializedName": "max_search_queries", + "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", + "type": { + "$id": "925", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.max_search_queries" + }, + { + "$id": "926", + "kind": "property", + "name": "allow_partial_result", + "serializedName": "allow_partial_result", + "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", + "type": { + "$id": "927", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.allow_partial_result" + }, + { + "$id": "928", + "kind": "property", + "name": "include_contexts", + "serializedName": "include_contexts", + "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", + "type": { + "$id": "929", + "kind": "array", + "name": "Array", + "valueType": { + "$ref": "186" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.include_contexts" + }, + { + "$id": "930", + "kind": "property", + "name": "container_name", + "serializedName": "container_name", + "type": { + "$id": "931", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.container_name" + }, + { + "$id": "932", + "kind": "property", + "name": "database_name", + "serializedName": "database_name", + "type": { + "$id": "933", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.database_name" + }, + { + "$id": "934", + "kind": "property", + "name": "embedding_dependency", + "serializedName": "embedding_dependency", + "type": { + "$ref": "880" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.embedding_dependency" + }, + { + "$id": "935", + "kind": "property", + "name": "index_name", + "serializedName": "index_name", + "type": { + "$id": "936", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.index_name" + }, + { + "$id": "937", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "type": { + "$ref": "806" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.authentication" + }, + { + "$id": "938", + "kind": "property", + "name": "fields_mapping", + "serializedName": "fields_mapping", + "type": { + "$id": "939", + "kind": "model", + "name": "AzureCosmosDBChatDataSourceParametersFieldsMapping", + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "940", + "kind": "property", + "name": "content_fields", + "serializedName": "content_fields", + "type": { + "$id": "941", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "942", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.content_fields" + }, + { + "$id": "943", + "kind": "property", + "name": "vector_fields", + "serializedName": "vector_fields", + "type": { + "$id": "944", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "945", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.vector_fields" + }, + { + "$id": "946", + "kind": "property", + "name": "title_field", + "serializedName": "title_field", + "type": { + "$id": "947", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.title_field" + }, + { + "$id": "948", + "kind": "property", + "name": "url_field", + "serializedName": "url_field", + "type": { + "$id": "949", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.url_field" + }, + { + "$id": "950", + "kind": "property", + "name": "filepath_field", + "serializedName": "filepath_field", + "type": { + "$id": "951", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.filepath_field" + }, + { + "$id": "952", + "kind": "property", + "name": "content_fields_separator", + "serializedName": "content_fields_separator", + "type": { + "$id": "953", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.fields_mapping" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters" + } + ] + }, + "elasticsearch": { + "$id": "954", + "kind": "model", + "name": "ElasticsearchChatDataSource", + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource", + "access": "public", + "usage": "Input,Json", + "discriminatorValue": "elasticsearch", + "decorators": [], + "baseModel": { + "$ref": "773" + }, + "properties": [ + { + "$id": "955", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The discriminated type identifier, which is always 'elasticsearch'.", + "type": { + "$id": "956", + "kind": "constant", + "valueType": { + "$id": "957", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "elasticsearch", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.type" + }, + { + "$id": "958", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "description": "The parameter information to control the use of the Elasticsearch data source.", + "type": { + "$id": "959", + "kind": "model", + "name": "ElasticsearchChatDataSourceParameters", + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "960", + "kind": "property", + "name": "top_n_documents", + "serializedName": "top_n_documents", + "description": "The configured number of documents to feature in the query.", + "type": { + "$id": "961", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.top_n_documents" + }, + { + "$id": "962", + "kind": "property", + "name": "in_scope", + "serializedName": "in_scope", + "description": "Whether queries should be restricted to use of the indexed data.", + "type": { + "$id": "963", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.in_scope" + }, + { + "$id": "964", + "kind": "property", + "name": "strictness", + "serializedName": "strictness", + "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", + "type": { + "$id": "965", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.strictness" + }, + { + "$id": "966", + "kind": "property", + "name": "max_search_queries", + "serializedName": "max_search_queries", + "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", + "type": { + "$id": "967", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.max_search_queries" + }, + { + "$id": "968", + "kind": "property", + "name": "allow_partial_result", + "serializedName": "allow_partial_result", + "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", + "type": { + "$id": "969", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.allow_partial_result" + }, + { + "$id": "970", + "kind": "property", + "name": "include_contexts", + "serializedName": "include_contexts", + "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", + "type": { + "$id": "971", + "kind": "array", + "name": "Array", + "valueType": { + "$ref": "186" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.include_contexts" + }, + { + "$id": "972", + "kind": "property", + "name": "endpoint", + "serializedName": "endpoint", + "type": { + "$id": "973", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.endpoint" + }, + { + "$id": "974", + "kind": "property", + "name": "index_name", + "serializedName": "index_name", + "type": { + "$id": "975", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.index_name" + }, + { + "$id": "976", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "type": { + "$id": "977", + "kind": "union", + "name": "ElasticsearchChatDataSourceParametersAuthentication", + "variantTypes": [ + { + "$ref": "822" + }, + { + "$ref": "830" + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.authentication" + }, + { + "$id": "978", + "kind": "property", + "name": "fields_mapping", + "serializedName": "fields_mapping", + "type": { + "$id": "979", + "kind": "model", + "name": "ElasticsearchChatDataSourceParametersFieldsMapping", + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "980", + "kind": "property", + "name": "title_field", + "serializedName": "title_field", + "type": { + "$id": "981", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.title_field" + }, + { + "$id": "982", + "kind": "property", + "name": "url_field", + "serializedName": "url_field", + "type": { + "$id": "983", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.url_field" + }, + { + "$id": "984", + "kind": "property", + "name": "filepath_field", + "serializedName": "filepath_field", + "type": { + "$id": "985", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.filepath_field" + }, + { + "$id": "986", + "kind": "property", + "name": "content_fields", + "serializedName": "content_fields", + "type": { + "$id": "987", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "988", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.content_fields" + }, + { + "$id": "989", + "kind": "property", + "name": "content_fields_separator", + "serializedName": "content_fields_separator", + "type": { + "$id": "990", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" + }, + { + "$id": "991", + "kind": "property", + "name": "vector_fields", + "serializedName": "vector_fields", + "type": { + "$id": "992", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "993", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.vector_fields" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.fields_mapping" + }, + { + "$id": "994", + "kind": "property", + "name": "query_type", + "serializedName": "query_type", + "type": { + "$ref": "206" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.query_type" + }, + { + "$id": "995", + "kind": "property", + "name": "embedding_dependency", + "serializedName": "embedding_dependency", + "type": { + "$ref": "880" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.embedding_dependency" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters" + } + ] + }, + "pinecone": { + "$id": "996", + "kind": "model", + "name": "PineconeChatDataSource", + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource", + "access": "public", + "usage": "Input,Json", + "discriminatorValue": "pinecone", + "decorators": [], + "baseModel": { + "$ref": "773" + }, + "properties": [ + { + "$id": "997", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The discriminated type identifier, which is always 'pinecone'.", + "type": { + "$id": "998", + "kind": "constant", + "valueType": { + "$id": "999", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "pinecone", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.type" + }, + { + "$id": "1000", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "description": "The parameter information to control the use of the Pinecone data source.", + "type": { + "$id": "1001", + "kind": "model", + "name": "PineconeChatDataSourceParameters", + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "1002", + "kind": "property", + "name": "top_n_documents", + "serializedName": "top_n_documents", + "description": "The configured number of documents to feature in the query.", + "type": { + "$id": "1003", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.top_n_documents" + }, + { + "$id": "1004", + "kind": "property", + "name": "in_scope", + "serializedName": "in_scope", + "description": "Whether queries should be restricted to use of the indexed data.", + "type": { + "$id": "1005", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.in_scope" + }, + { + "$id": "1006", + "kind": "property", + "name": "strictness", + "serializedName": "strictness", + "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", + "type": { + "$id": "1007", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.strictness" + }, + { + "$id": "1008", + "kind": "property", + "name": "max_search_queries", + "serializedName": "max_search_queries", + "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", + "type": { + "$id": "1009", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.max_search_queries" + }, + { + "$id": "1010", + "kind": "property", + "name": "allow_partial_result", + "serializedName": "allow_partial_result", + "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", + "type": { + "$id": "1011", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.allow_partial_result" + }, + { + "$id": "1012", + "kind": "property", + "name": "include_contexts", + "serializedName": "include_contexts", + "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", + "type": { + "$id": "1013", + "kind": "array", + "name": "Array", + "valueType": { + "$ref": "186" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.include_contexts" + }, + { + "$id": "1014", + "kind": "property", + "name": "environment", + "serializedName": "environment", + "description": "The environment name to use with Pinecone.", + "type": { + "$id": "1015", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.environment" + }, + { + "$id": "1016", + "kind": "property", + "name": "index_name", + "serializedName": "index_name", + "description": "The name of the Pinecone database index to use.", + "type": { + "$id": "1017", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.index_name" + }, + { + "$id": "1018", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "description": "The authentication mechanism to use with Pinecone.\nSupported authentication mechanisms for Pinecone include: API key.", + "type": { + "$ref": "801" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.authentication" + }, + { + "$id": "1019", + "kind": "property", + "name": "embedding_dependency", + "serializedName": "embedding_dependency", + "description": "The vectorization source to use as an embedding dependency for the Pinecone data source.\nSupported vectorization sources for Pinecone include: deployment name.", + "type": { + "$ref": "880" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.embedding_dependency" + }, + { + "$id": "1020", + "kind": "property", + "name": "fields_mapping", + "serializedName": "fields_mapping", + "description": "Field mappings to apply to data used by the Pinecone data source.\nNote that content field mappings are required for Pinecone.", + "type": { + "$id": "1021", + "kind": "model", + "name": "PineconeChatDataSourceParametersFieldsMapping", + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "1022", + "kind": "property", + "name": "content_fields", + "serializedName": "content_fields", + "type": { + "$id": "1023", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1024", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.content_fields" + }, + { + "$id": "1025", + "kind": "property", + "name": "title_field", + "serializedName": "title_field", + "type": { + "$id": "1026", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.title_field" + }, + { + "$id": "1027", + "kind": "property", + "name": "url_field", + "serializedName": "url_field", + "type": { + "$id": "1028", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.url_field" + }, + { + "$id": "1029", + "kind": "property", + "name": "filepath_field", + "serializedName": "filepath_field", + "type": { + "$id": "1030", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.filepath_field" + }, + { + "$id": "1031", + "kind": "property", + "name": "content_fields_separator", + "serializedName": "content_fields_separator", + "type": { + "$id": "1032", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.fields_mapping" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters" + } + ] + }, + "mongo_db": { + "$id": "1033", + "kind": "model", + "name": "MongoDBChatDataSource", + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource", + "usage": "Input,Json", + "discriminatorValue": "mongo_db", + "decorators": [], + "baseModel": { + "$ref": "773" + }, + "properties": [ + { + "$id": "1034", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The discriminated type identifier, which is always 'mongo_db'.", + "type": { + "$id": "1035", + "kind": "constant", + "valueType": { + "$id": "1036", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "mongo_db", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": true, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.type" + }, + { + "$id": "1037", + "kind": "property", + "name": "parameters", + "serializedName": "parameters", + "description": "The parameter information to control the use of the MongoDB data source.", + "type": { + "$id": "1038", + "kind": "model", + "name": "MongoDBChatDataSourceParameters", + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "1039", + "kind": "property", + "name": "top_n_documents", + "serializedName": "top_n_documents", + "description": "The configured number of documents to feature in the query.", + "type": { + "$id": "1040", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.top_n_documents" + }, + { + "$id": "1041", + "kind": "property", + "name": "in_scope", + "serializedName": "in_scope", + "description": "Whether queries should be restricted to use of the indexed data.", + "type": { + "$id": "1042", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.in_scope" + }, + { + "$id": "1043", + "kind": "property", + "name": "strictness", + "serializedName": "strictness", + "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", + "type": { + "$id": "1044", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.strictness" + }, + { + "$id": "1045", + "kind": "property", + "name": "max_search_queries", + "serializedName": "max_search_queries", + "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", + "type": { + "$id": "1046", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.max_search_queries" + }, + { + "$id": "1047", + "kind": "property", + "name": "allow_partial_result", + "serializedName": "allow_partial_result", + "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", + "type": { + "$id": "1048", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.allow_partial_result" + }, + { + "$id": "1049", + "kind": "property", + "name": "include_contexts", + "serializedName": "include_contexts", + "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", + "type": { + "$id": "1050", + "kind": "array", + "name": "Array", + "valueType": { + "$ref": "186" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.include_contexts" + }, + { + "$id": "1051", + "kind": "property", + "name": "endpoint", + "serializedName": "endpoint", + "description": "The name of the MongoDB cluster endpoint.", + "type": { + "$id": "1052", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.endpoint" + }, + { + "$id": "1053", + "kind": "property", + "name": "database_name", + "serializedName": "database_name", + "description": "The name of the MongoDB database.", + "type": { + "$id": "1054", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.database_name" + }, + { + "$id": "1055", + "kind": "property", + "name": "collection_name", + "serializedName": "collection_name", + "description": "The name of the MongoDB collection.", + "type": { + "$id": "1056", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.collection_name" + }, + { + "$id": "1057", + "kind": "property", + "name": "app_name", + "serializedName": "app_name", + "description": "The name of the MongoDB application.", + "type": { + "$id": "1058", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.app_name" + }, + { + "$id": "1059", + "kind": "property", + "name": "index_name", + "serializedName": "index_name", + "description": "The name of the MongoDB index.", + "type": { + "$id": "1060", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.index_name" + }, + { + "$id": "1061", + "kind": "property", + "name": "authentication", + "serializedName": "authentication", + "description": "The authentication mechanism to use with Pinecone.\nSupported authentication mechanisms for Pinecone include: username and password.", + "type": { + "$ref": "842" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.authentication" + }, + { + "$id": "1062", + "kind": "property", + "name": "embedding_dependency", + "serializedName": "embedding_dependency", + "description": "The vectorization source to use as an embedding dependency for the MongoDB data source.\nSupported vectorization sources for MongoDB include: endpoint, deployment name.", + "type": { + "$id": "1063", + "kind": "union", + "name": "MongoDBChatDataSourceParametersEmbeddingDependency", + "variantTypes": [ + { + "$ref": "884" + }, + { + "$ref": "894" + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.embedding_dependency" + }, + { + "$id": "1064", + "kind": "property", + "name": "fields_mapping", + "serializedName": "fields_mapping", + "description": "Field mappings to apply to data used by the MongoDB data source.\nNote that content and vector field mappings are required for MongoDB.", + "type": { + "$id": "1065", + "kind": "model", + "name": "MongoDBChatDataSourceParametersFieldsMapping", + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous", + "usage": "Input,Json", + "decorators": [], + "properties": [ + { + "$id": "1066", + "kind": "property", + "name": "content_fields", + "serializedName": "content_fields", + "type": { + "$id": "1067", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1068", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.content_fields" + }, + { + "$id": "1069", + "kind": "property", + "name": "vector_fields", + "serializedName": "vector_fields", + "type": { + "$id": "1070", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1071", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.vector_fields" + }, + { + "$id": "1072", + "kind": "property", + "name": "title_field", + "serializedName": "title_field", + "type": { + "$id": "1073", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.title_field" + }, + { + "$id": "1074", + "kind": "property", + "name": "url_field", + "serializedName": "url_field", + "type": { + "$id": "1075", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.url_field" + }, + { + "$id": "1076", + "kind": "property", + "name": "filepath_field", + "serializedName": "filepath_field", + "type": { + "$id": "1077", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.filepath_field" + }, + { + "$id": "1078", + "kind": "property", + "name": "content_fields_separator", + "serializedName": "content_fields_separator", + "type": { + "$id": "1079", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.fields_mapping" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters" + } + ] + } + } + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.data_sources" + }, + { + "$id": "1080", + "kind": "property", + "name": "user_security_context", + "serializedName": "user_security_context", + "type": { + "$id": "1081", + "kind": "model", + "name": "AzureUserSecurityContext", + "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext", + "usage": "Input,Json", + "description": "User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud.", + "decorators": [], + "properties": [ + { + "$id": "1082", + "kind": "property", + "name": "application_name", + "serializedName": "application_name", + "description": "The name of the application. Sensitive personal information should not be included in this field.", + "type": { + "$id": "1083", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext.application_name" + }, + { + "$id": "1084", + "kind": "property", + "name": "end_user_id", + "serializedName": "end_user_id", + "description": "This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field.", + "type": { + "$id": "1085", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext.end_user_id" + }, + { + "$id": "1086", + "kind": "property", + "name": "end_user_tenant_id", + "serializedName": "end_user_tenant_id", + "description": "The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multitenant.", + "type": { + "$id": "1087", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext.end_user_tenant_id" + }, + { + "$id": "1088", + "kind": "property", + "name": "source_ip", + "serializedName": "source_ip", + "description": "Captures the original client's IP address.", + "type": { + "$id": "1089", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext.source_ip" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.user_security_context" + } + ] + }, + { + "$ref": "504" + }, + { + "$ref": "508" + }, + { + "$ref": "514" + }, + { + "$ref": "524" + }, + { + "$ref": "534" + }, + { + "$ref": "540" + }, + { + "$ref": "544" + }, + { + "$ref": "548" + }, + { + "$ref": "552" + }, + { + "$ref": "561" + }, + { + "$ref": "568" + }, + { + "$ref": "583" + }, + { + "$ref": "588" + }, + { + "$ref": "594" + }, + { + "$ref": "601" + }, + { + "$ref": "606" + }, + { + "$ref": "617" + }, + { + "$ref": "662" + }, + { + "$ref": "665" + }, + { + "$ref": "675" + }, + { + "$ref": "682" + }, + { + "$ref": "686" + }, + { + "$ref": "690" + }, + { + "$ref": "694" + }, + { + "$ref": "699" + }, + { + "$ref": "705" + }, + { + "$ref": "724" + }, + { + "$ref": "735" + }, + { + "$ref": "741" + }, + { + "$ref": "745" + }, + { + "$ref": "759" + }, + { + "$ref": "764" + }, + { + "$ref": "773" + }, + { + "$ref": "777" + }, + { + "$ref": "782" + }, + { + "$ref": "801" + }, + { + "$ref": "802" + }, + { + "$ref": "806" + }, + { + "$ref": "812" + }, + { + "$ref": "816" + }, + { + "$ref": "822" + }, + { + "$ref": "830" + }, + { + "$ref": "836" + }, + { + "$ref": "842" + }, + { + "$ref": "856" + }, + { + "$ref": "880" + }, + { + "$ref": "884" + }, + { + "$ref": "894" + }, + { + "$ref": "902" + }, + { + "$ref": "908" + }, + { + "$ref": "912" + }, + { + "$ref": "917" + }, + { + "$ref": "939" + }, + { + "$ref": "954" + }, + { + "$ref": "959" + }, + { + "$ref": "979" + }, + { + "$ref": "996" + }, + { + "$ref": "1001" + }, + { + "$ref": "1021" + }, + { + "$ref": "1033" + }, + { + "$ref": "1038" + }, + { + "$ref": "1065" + }, + { + "$ref": "1081" + }, + { + "$id": "1090", + "kind": "model", + "name": "AzureCreateChatCompletionResponse", + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse", + "usage": "Output,Json", + "description": "The extended top-level chat completion response model for the Azure OpenAI service.\nThis model adds Responsible AI content filter annotations for prompt input.", + "decorators": [], + "properties": [ + { + "$id": "1091", + "kind": "property", + "name": "id", + "serializedName": "id", + "description": "A unique identifier for the chat completion.", + "type": { + "$id": "1092", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.id" + }, + { + "$id": "1093", + "kind": "property", + "name": "created", + "serializedName": "created", + "description": "The Unix timestamp (in seconds) of when the chat completion was created.", + "type": { + "$id": "1094", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "unixTimestamp", + "wireType": { + "$id": "1095", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.created" + }, + { + "$id": "1096", + "kind": "property", + "name": "model", + "serializedName": "model", + "description": "The model used for the chat completion.", + "type": { + "$id": "1097", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.model" + }, + { + "$id": "1098", + "kind": "property", + "name": "service_tier", + "serializedName": "service_tier", + "description": "The service tier used for processing the request.", + "type": { + "$id": "1099", + "kind": "nullable", + "type": { + "$ref": "212" + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.service_tier" + }, + { + "$id": "1100", + "kind": "property", + "name": "system_fingerprint", + "serializedName": "system_fingerprint", + "description": "This fingerprint represents the backend configuration that the model runs with.\n\nCan be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.", + "type": { + "$id": "1101", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.system_fingerprint" + }, + { + "$id": "1102", + "kind": "property", + "name": "object", + "serializedName": "object", + "description": "The object type, which is always `chat.completion`.", + "type": { + "$id": "1103", + "kind": "constant", + "valueType": { + "$ref": "218" + }, + "value": "chat.completion", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.object" + }, + { + "$id": "1104", + "kind": "property", + "name": "usage", + "serializedName": "usage", + "type": { + "$id": "1105", + "kind": "model", + "name": "CompletionUsage", + "crossLanguageDefinitionId": "OpenAI.CompletionUsage", + "usage": "Output,Json", + "description": "Usage statistics for the completion request.", + "decorators": [], + "properties": [ + { + "$id": "1106", + "kind": "property", + "name": "completion_tokens", + "serializedName": "completion_tokens", + "description": "Number of tokens in the generated completion.", + "type": { + "$id": "1107", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CompletionUsage.completion_tokens" + }, + { + "$id": "1108", + "kind": "property", + "name": "prompt_tokens", + "serializedName": "prompt_tokens", + "description": "Number of tokens in the prompt.", + "type": { + "$id": "1109", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CompletionUsage.prompt_tokens" + }, + { + "$id": "1110", + "kind": "property", + "name": "total_tokens", + "serializedName": "total_tokens", + "description": "Total number of tokens used in the request (prompt + completion).", + "type": { + "$id": "1111", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CompletionUsage.total_tokens" + }, + { + "$id": "1112", + "kind": "property", + "name": "completion_tokens_details", + "serializedName": "completion_tokens_details", + "description": "Breakdown of tokens used in a completion.", + "type": { + "$id": "1113", + "kind": "model", + "name": "CompletionUsageCompletionTokensDetails", + "crossLanguageDefinitionId": "OpenAI.CompletionUsage.completion_tokens_details.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1114", + "kind": "property", + "name": "accepted_prediction_tokens", + "serializedName": "accepted_prediction_tokens", + "description": "When using Predicted Outputs, the number of tokens in the\nprediction that appeared in the completion.", + "type": { + "$id": "1115", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CompletionUsage.completion_tokens_details.anonymous.accepted_prediction_tokens" + }, + { + "$id": "1116", + "kind": "property", + "name": "audio_tokens", + "serializedName": "audio_tokens", + "description": "Audio input tokens generated by the model.", + "type": { + "$id": "1117", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CompletionUsage.completion_tokens_details.anonymous.audio_tokens" + }, + { + "$id": "1118", + "kind": "property", + "name": "reasoning_tokens", + "serializedName": "reasoning_tokens", + "description": "Tokens generated by the model for reasoning.", + "type": { + "$id": "1119", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CompletionUsage.completion_tokens_details.anonymous.reasoning_tokens" + }, + { + "$id": "1120", + "kind": "property", + "name": "rejected_prediction_tokens", + "serializedName": "rejected_prediction_tokens", + "description": "When using Predicted Outputs, the number of tokens in the\nprediction that did not appear in the completion. However, like\nreasoning tokens, these tokens are still counted in the total\ncompletion tokens for purposes of billing, output, and context window\nlimits.", + "type": { + "$id": "1121", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CompletionUsage.completion_tokens_details.anonymous.rejected_prediction_tokens" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CompletionUsage.completion_tokens_details" + }, + { + "$id": "1122", + "kind": "property", + "name": "prompt_tokens_details", + "serializedName": "prompt_tokens_details", + "description": "Breakdown of tokens used in the prompt.", + "type": { + "$id": "1123", + "kind": "model", + "name": "CompletionUsagePromptTokensDetails", + "crossLanguageDefinitionId": "OpenAI.CompletionUsage.prompt_tokens_details.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1124", + "kind": "property", + "name": "audio_tokens", + "serializedName": "audio_tokens", + "description": "Audio input tokens present in the prompt.", + "type": { + "$id": "1125", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CompletionUsage.prompt_tokens_details.anonymous.audio_tokens" + }, + { + "$id": "1126", + "kind": "property", + "name": "cached_tokens", + "serializedName": "cached_tokens", + "description": "Cached tokens present in the prompt.", + "type": { + "$id": "1127", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CompletionUsage.prompt_tokens_details.anonymous.cached_tokens" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.CompletionUsage.prompt_tokens_details" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.usage" + }, + { + "$id": "1128", + "kind": "property", + "name": "choices", + "serializedName": "choices", + "type": { + "$id": "1129", + "kind": "array", + "name": "ArrayAzureCreateChatCompletionResponseChoice", + "valueType": { + "$id": "1130", + "kind": "model", + "name": "AzureCreateChatCompletionResponseChoice", + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponseChoice", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1131", + "kind": "property", + "name": "finish_reason", + "serializedName": "finish_reason", + "description": "The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,\n`length` if the maximum number of tokens specified in the request was reached,\n`content_filter` if content was omitted due to a flag from our content filters,\n`tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.", + "type": { + "$ref": "221" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponseChoice.finish_reason" + }, + { + "$id": "1132", + "kind": "property", + "name": "index", + "serializedName": "index", + "description": "The index of the choice in the list of choices.", + "type": { + "$id": "1133", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponseChoice.index" + }, + { + "$id": "1134", + "kind": "property", + "name": "message", + "serializedName": "message", + "type": { + "$id": "1135", + "kind": "model", + "name": "ChatCompletionResponseMessage", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage", + "usage": "Output,Json", + "description": "A chat completion message generated by the model.", + "decorators": [], + "properties": [ + { + "$id": "1136", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The contents of the message.", + "type": { + "$id": "1137", + "kind": "nullable", + "type": { + "$id": "1138", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.content" + }, + { + "$id": "1139", + "kind": "property", + "name": "refusal", + "serializedName": "refusal", + "description": "The refusal message generated by the model.", + "type": { + "$id": "1140", + "kind": "nullable", + "type": { + "$id": "1141", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.refusal" + }, + { + "$id": "1142", + "kind": "property", + "name": "tool_calls", + "serializedName": "tool_calls", + "type": { + "$id": "1143", + "kind": "array", + "name": "ChatCompletionMessageToolCalls", + "valueType": { + "$ref": "588" + }, + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCalls", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.tool_calls" + }, + { + "$id": "1144", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the author of this message.", + "type": { + "$id": "1145", + "kind": "constant", + "valueType": { + "$ref": "233" + }, + "value": "assistant", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.role" + }, + { + "$id": "1146", + "kind": "property", + "name": "function_call", + "serializedName": "function_call", + "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.", + "type": { + "$id": "1147", + "kind": "model", + "name": "ChatCompletionResponseMessageFunctionCall", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.function_call.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1148", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "1149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.function_call.anonymous.name" + }, + { + "$id": "1150", + "kind": "property", + "name": "arguments", + "serializedName": "arguments", + "type": { + "$id": "1151", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.function_call.anonymous.arguments" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.function_call" + }, + { + "$id": "1152", + "kind": "property", + "name": "audio", + "serializedName": "audio", + "description": "If the audio output modality is requested, this object contains data\nabout the audio response from the model. [Learn more](/docs/guides/audio).", + "type": { + "$id": "1153", + "kind": "nullable", + "type": { + "$id": "1154", + "kind": "model", + "name": "ChatCompletionResponseMessageAudio", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.audio.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1155", + "kind": "property", + "name": "id", + "serializedName": "id", + "description": "Unique identifier for this audio response.", + "type": { + "$id": "1156", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.audio.anonymous.id" + }, + { + "$id": "1157", + "kind": "property", + "name": "expires_at", + "serializedName": "expires_at", + "description": "The Unix timestamp (in seconds) for when this audio response will\nno longer be accessible on the server for use in multi-turn\nconversations.", + "type": { + "$id": "1158", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "unixTimestamp", + "wireType": { + "$id": "1159", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.audio.anonymous.expires_at" + }, + { + "$id": "1160", + "kind": "property", + "name": "data", + "serializedName": "data", + "description": "Base64 encoded audio bytes generated by the model, in the format\nspecified in the request.", + "type": { + "$id": "1161", + "kind": "bytes", + "name": "bytes", + "encode": "base64", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.audio.anonymous.data" + }, + { + "$id": "1162", + "kind": "property", + "name": "transcript", + "serializedName": "transcript", + "description": "Transcript of the audio generated by the model.", + "type": { + "$id": "1163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.audio.anonymous.transcript" + } + ] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.audio" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponseChoice.message" + }, + { + "$id": "1164", + "kind": "property", + "name": "logprobs", + "serializedName": "logprobs", + "description": "Log probability information for the choice.", + "type": { + "$id": "1165", + "kind": "nullable", + "type": { + "$id": "1166", + "kind": "model", + "name": "AzureCreateChatCompletionResponseChoiceLogprobs", + "crossLanguageDefinitionId": "OpenAI.AzureCreateChatCompletionResponseChoice.logprobs.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1167", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "A list of message content tokens with log probability information.", + "type": { + "$id": "1168", + "kind": "nullable", + "type": { + "$id": "1169", + "kind": "array", + "name": "ArrayChatCompletionTokenLogprob", + "valueType": { + "$id": "1170", + "kind": "model", + "name": "ChatCompletionTokenLogprob", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1171", + "kind": "property", + "name": "token", + "serializedName": "token", + "description": "The token.", + "type": { + "$id": "1172", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob.token" + }, + { + "$id": "1173", + "kind": "property", + "name": "logprob", + "serializedName": "logprob", + "description": "The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.", + "type": { + "$id": "1174", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob.logprob" + }, + { + "$id": "1175", + "kind": "property", + "name": "bytes", + "serializedName": "bytes", + "description": "A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.", + "type": { + "$id": "1176", + "kind": "nullable", + "type": { + "$id": "1177", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1178", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob.bytes" + }, + { + "$id": "1179", + "kind": "property", + "name": "top_logprobs", + "serializedName": "top_logprobs", + "description": "List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned.", + "type": { + "$id": "1180", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1181", + "kind": "model", + "name": "ChatCompletionTokenLogprobTopLogprob", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob.top_logprob.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1182", + "kind": "property", + "name": "token", + "serializedName": "token", + "description": "The token.", + "type": { + "$id": "1183", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob.top_logprob.anonymous.token" + }, + { + "$id": "1184", + "kind": "property", + "name": "logprob", + "serializedName": "logprob", + "description": "The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.", + "type": { + "$id": "1185", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob.top_logprob.anonymous.logprob" + }, + { + "$id": "1186", + "kind": "property", + "name": "bytes", + "serializedName": "bytes", + "description": "A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.", + "type": { + "$id": "1187", + "kind": "nullable", + "type": { + "$id": "1188", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1189", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob.top_logprob.anonymous.bytes" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob.top_logprobs" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AzureCreateChatCompletionResponseChoice.logprobs.anonymous.content" + }, + { + "$id": "1190", + "kind": "property", + "name": "refusal", + "serializedName": "refusal", + "description": "A list of message refusal tokens with log probability information.", + "type": { + "$id": "1191", + "kind": "nullable", + "type": { + "$id": "1192", + "kind": "array", + "name": "ArrayChatCompletionTokenLogprob", + "valueType": { + "$ref": "1170" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + } + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AzureCreateChatCompletionResponseChoice.logprobs.anonymous.refusal" + } + ] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponseChoice.logprobs" + }, + { + "$id": "1193", + "kind": "property", + "name": "content_filter_results", + "serializedName": "content_filter_results", + "description": "The Responsible AI content filter annotations associated with the choice.", + "type": { + "$id": "1194", + "kind": "model", + "name": "AzureContentFilterResultForChoice", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice", + "access": "public", + "usage": "Output,Json", + "description": "A content filter result for a single response item produced by a generative AI system.", + "decorators": [], + "properties": [ + { + "$id": "1195", + "kind": "property", + "name": "sexual", + "serializedName": "sexual", + "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse.", + "type": { + "$ref": "476" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.sexual" + }, + { + "$id": "1196", + "kind": "property", + "name": "hate", + "serializedName": "hate", + "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size.", + "type": { + "$ref": "476" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.hate" + }, + { + "$id": "1197", + "kind": "property", + "name": "violence", + "serializedName": "violence", + "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on.", + "type": { + "$ref": "476" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.violence" + }, + { + "$id": "1198", + "kind": "property", + "name": "self_harm", + "serializedName": "self_harm", + "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself.", + "type": { + "$ref": "476" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.self_harm" + }, + { + "$id": "1199", + "kind": "property", + "name": "profanity", + "serializedName": "profanity", + "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent.", + "type": { + "$ref": "484" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.profanity" + }, + { + "$id": "1200", + "kind": "property", + "name": "custom_blocklists", + "serializedName": "custom_blocklists", + "description": "A collection of binary filtering outcomes for configured custom blocklists.", + "type": { + "$ref": "490" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.custom_blocklists" + }, + { + "$id": "1201", + "kind": "property", + "name": "error", + "serializedName": "error", + "description": "If present, details about an error that prevented content filtering from completing its evaluation.", + "type": { + "$id": "1202", + "kind": "model", + "name": "AzureContentFilterResultForChoiceError", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.error.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1203", + "kind": "property", + "name": "code", + "serializedName": "code", + "description": "A distinct, machine-readable code associated with the error.", + "type": { + "$id": "1204", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.error.anonymous.code" + }, + { + "$id": "1205", + "kind": "property", + "name": "message", + "serializedName": "message", + "description": "A human-readable message associated with the error.", + "type": { + "$id": "1206", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.error.anonymous.message" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.error" + }, + { + "$id": "1207", + "kind": "property", + "name": "protected_material_text", + "serializedName": "protected_material_text", + "description": "A detection result that describes a match against text protected under copyright or other status.", + "type": { + "$ref": "484" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_text" + }, + { + "$id": "1208", + "kind": "property", + "name": "protected_material_code", + "serializedName": "protected_material_code", + "description": "A detection result that describes a match against licensed code or other protected source material.", + "type": { + "$id": "1209", + "kind": "model", + "name": "AzureContentFilterResultForChoiceProtectedMaterialCode", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1210", + "kind": "property", + "name": "filtered", + "serializedName": "filtered", + "description": "Whether the content detection resulted in a content filtering action.", + "type": { + "$id": "1211", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.anonymous.filtered" + }, + { + "$id": "1212", + "kind": "property", + "name": "detected", + "serializedName": "detected", + "description": "Whether the labeled content category was detected in the content.", + "type": { + "$id": "1213", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.anonymous.detected" + }, + { + "$id": "1214", + "kind": "property", + "name": "citation", + "serializedName": "citation", + "description": "If available, the citation details describing the associated license and its location.", + "type": { + "$id": "1215", + "kind": "model", + "name": "AzureContentFilterResultForChoiceProtectedMaterialCodeCitation", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.citation.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1216", + "kind": "property", + "name": "license", + "serializedName": "license", + "description": "The name or identifier of the license associated with the detection.", + "type": { + "$id": "1217", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.citation.anonymous.license" + }, + { + "$id": "1218", + "kind": "property", + "name": "URL", + "serializedName": "URL", + "description": "The URL associated with the license.", + "type": { + "$id": "1219", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.citation.anonymous.URL" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.anonymous.citation" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code" + }, + { + "$id": "1220", + "kind": "property", + "name": "ungrounded_material", + "serializedName": "ungrounded_material", + "type": { + "$id": "1221", + "kind": "model", + "name": "AzureContentFilterCompletionTextSpanDetectionResult", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpanDetectionResult", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1222", + "kind": "property", + "name": "filtered", + "serializedName": "filtered", + "description": "Whether the content detection resulted in a content filtering action.", + "type": { + "$id": "1223", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpanDetectionResult.filtered" + }, + { + "$id": "1224", + "kind": "property", + "name": "detected", + "serializedName": "detected", + "description": "Whether the labeled content category was detected in the content.", + "type": { + "$id": "1225", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpanDetectionResult.detected" + }, + { + "$id": "1226", + "kind": "property", + "name": "details", + "serializedName": "details", + "description": "Detailed information about the detected completion text spans.", + "type": { + "$id": "1227", + "kind": "array", + "name": "ArrayAzureContentFilterCompletionTextSpan", + "valueType": { + "$id": "1228", + "kind": "model", + "name": "AzureContentFilterCompletionTextSpan", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpan", + "usage": "Output,Json", + "description": "A representation of a span of completion text as used by Azure OpenAI content filter results.", + "decorators": [], + "properties": [ + { + "$id": "1229", + "kind": "property", + "name": "completion_start_offset", + "serializedName": "completion_start_offset", + "description": "Offset of the UTF32 code point which begins the span.", + "type": { + "$id": "1230", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpan.completion_start_offset" + }, + { + "$id": "1231", + "kind": "property", + "name": "completion_end_offset", + "serializedName": "completion_end_offset", + "description": "Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans.", + "type": { + "$id": "1232", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpan.completion_end_offset" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpanDetectionResult.details" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.ungrounded_material" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponseChoice.content_filter_results" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.choices" + }, + { + "$id": "1233", + "kind": "property", + "name": "prompt_filter_results", + "serializedName": "prompt_filter_results", + "description": "The Responsible AI content filter annotations associated with prompt inputs into chat completions.", + "type": { + "$id": "1234", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1235", + "kind": "model", + "name": "AzureCreateChatCompletionResponsePromptFilterResult", + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.prompt_filter_result.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1236", + "kind": "property", + "name": "prompt_index", + "serializedName": "prompt_index", + "description": "The index of the input prompt that this content filter result corresponds to.", + "type": { + "$id": "1237", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.prompt_filter_result.anonymous.prompt_index" + }, + { + "$id": "1238", + "kind": "property", + "name": "content_filter_results", + "serializedName": "content_filter_results", + "description": "The content filter results associated with the indexed input prompt.", + "type": { + "$id": "1239", + "kind": "model", + "name": "AzureContentFilterResultForPrompt", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt", + "usage": "Output,Json", + "description": "A content filter result associated with a single input prompt item into a generative AI system.", + "decorators": [], + "properties": [ + { + "$id": "1240", + "kind": "property", + "name": "prompt_index", + "serializedName": "prompt_index", + "description": "The index of the input prompt associated with the accompanying content filter result categories.", + "type": { + "$id": "1241", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.prompt_index" + }, + { + "$id": "1242", + "kind": "property", + "name": "content_filter_results", + "serializedName": "content_filter_results", + "description": "The content filter category details for the result.", + "type": { + "$id": "1243", + "kind": "model", + "name": "AzureContentFilterResultForPromptContentFilterResults", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1244", + "kind": "property", + "name": "sexual", + "serializedName": "sexual", + "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse.", + "type": { + "$ref": "476" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.sexual" + }, + { + "$id": "1245", + "kind": "property", + "name": "hate", + "serializedName": "hate", + "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size.", + "type": { + "$ref": "476" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.hate" + }, + { + "$id": "1246", + "kind": "property", + "name": "violence", + "serializedName": "violence", + "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on.", + "type": { + "$ref": "476" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.violence" + }, + { + "$id": "1247", + "kind": "property", + "name": "self_harm", + "serializedName": "self_harm", + "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself.", + "type": { + "$ref": "476" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.self_harm" + }, + { + "$id": "1248", + "kind": "property", + "name": "profanity", + "serializedName": "profanity", + "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent.", + "type": { + "$ref": "484" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.profanity" + }, + { + "$id": "1249", + "kind": "property", + "name": "custom_blocklists", + "serializedName": "custom_blocklists", + "description": "A collection of binary filtering outcomes for configured custom blocklists.", + "type": { + "$ref": "490" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.custom_blocklists" + }, + { + "$id": "1250", + "kind": "property", + "name": "error", + "serializedName": "error", + "description": "If present, details about an error that prevented content filtering from completing its evaluation.", + "type": { + "$ref": "1202" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.error" + }, + { + "$id": "1251", + "kind": "property", + "name": "jailbreak", + "serializedName": "jailbreak", + "description": "A detection result that describes user prompt injection attacks, where malicious users deliberately exploit\nsystem vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content\ngeneration or violations of system-imposed restrictions.", + "type": { + "$ref": "484" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.jailbreak" + }, + { + "$id": "1252", + "kind": "property", + "name": "indirect_attack", + "serializedName": "indirect_attack", + "description": "A detection result that describes attacks on systems powered by Generative AI models that can happen every time\nan application processes information that wasn’t directly authored by either the developer of the application or\nthe user.", + "type": { + "$ref": "484" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.indirect_attack" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results" + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.prompt_filter_result.anonymous.content_filter_results" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.prompt_filter_results" + } + ] + }, + { + "$ref": "1105" + }, + { + "$ref": "1113" + }, + { + "$ref": "1123" + }, + { + "$ref": "1130" + }, + { + "$ref": "1135" + }, + { + "$ref": "1147" + }, + { + "$ref": "1154" + }, + { + "$ref": "1166" + }, + { + "$ref": "1170" + }, + { + "$ref": "1181" + }, + { + "$ref": "1194" + }, + { + "$ref": "1202" + }, + { + "$ref": "1209" + }, + { + "$ref": "1215" + }, + { + "$ref": "1221" + }, + { + "$ref": "1228" + }, + { + "$ref": "1235" + }, + { + "$ref": "1239" + }, + { + "$ref": "1243" + }, + { + "$id": "1253", + "kind": "model", + "name": "AzureChatCompletionStreamResponseDelta", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatCompletionStreamResponseDelta", + "usage": "Output,Json", + "description": "The extended response model for a streaming chat response message on the Azure OpenAI service.\nThis model adds support for chat message context, used by the On Your Data feature for intent, citations, and other\ninformation related to retrieval-augmented generation performed.", + "decorators": [], + "properties": [ + { + "$id": "1254", + "kind": "property", + "name": "audio", + "serializedName": "audio", + "description": "Response audio associated with the streaming chat delta payload.", + "type": { + "$id": "1255", + "kind": "model", + "name": "ChatCompletionMessageAudioChunk", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageAudioChunk", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1256", + "kind": "property", + "name": "id", + "serializedName": "id", + "type": { + "$id": "1257", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageAudioChunk.id" + }, + { + "$id": "1258", + "kind": "property", + "name": "transcript", + "serializedName": "transcript", + "type": { + "$id": "1259", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageAudioChunk.transcript" + }, + { + "$id": "1260", + "kind": "property", + "name": "data", + "serializedName": "data", + "type": { + "$id": "1261", + "kind": "bytes", + "name": "bytes", + "encode": "base64", + "crossLanguageDefinitionId": "TypeSpec.bytes", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageAudioChunk.data" + }, + { + "$id": "1262", + "kind": "property", + "name": "expires_at", + "serializedName": "expires_at", + "type": { + "$id": "1263", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "unixTimestamp", + "wireType": { + "$id": "1264", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageAudioChunk.expires_at" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatCompletionStreamResponseDelta.audio" + }, + { + "$id": "1265", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The contents of the chunk message.", + "type": { + "$id": "1266", + "kind": "nullable", + "type": { + "$id": "1267", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatCompletionStreamResponseDelta.content" + }, + { + "$id": "1268", + "kind": "property", + "name": "function_call", + "serializedName": "function_call", + "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.", + "type": { + "$id": "1269", + "kind": "model", + "name": "AzureChatCompletionStreamResponseDeltaFunctionCall", + "crossLanguageDefinitionId": "OpenAI.AzureChatCompletionStreamResponseDelta.function_call.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1270", + "kind": "property", + "name": "name", + "serializedName": "name", + "type": { + "$id": "1271", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AzureChatCompletionStreamResponseDelta.function_call.anonymous.name" + }, + { + "$id": "1272", + "kind": "property", + "name": "arguments", + "serializedName": "arguments", + "type": { + "$id": "1273", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.AzureChatCompletionStreamResponseDelta.function_call.anonymous.arguments" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatCompletionStreamResponseDelta.function_call" + }, + { + "$id": "1274", + "kind": "property", + "name": "tool_calls", + "serializedName": "tool_calls", + "type": { + "$id": "1275", + "kind": "array", + "name": "ArrayChatCompletionMessageToolCallChunk", + "valueType": { + "$id": "1276", + "kind": "model", + "name": "ChatCompletionMessageToolCallChunk", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCallChunk", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1277", + "kind": "property", + "name": "index", + "serializedName": "index", + "type": { + "$id": "1278", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCallChunk.index" + }, + { + "$id": "1279", + "kind": "property", + "name": "id", + "serializedName": "id", + "description": "The ID of the tool call.", + "type": { + "$id": "1280", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCallChunk.id" + }, + { + "$id": "1281", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "The type of the tool. Currently, only `function` is supported.", + "type": { + "$id": "1282", + "kind": "constant", + "valueType": { + "$ref": "236" + }, + "value": "function", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCallChunk.type" + }, + { + "$id": "1283", + "kind": "property", + "name": "function", + "serializedName": "function", + "type": { + "$id": "1284", + "kind": "model", + "name": "ChatCompletionMessageToolCallChunkFunction", + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCallChunk.function.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1285", + "kind": "property", + "name": "name", + "serializedName": "name", + "description": "The name of the function to call.", + "type": { + "$id": "1286", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCallChunk.function.anonymous.name" + }, + { + "$id": "1287", + "kind": "property", + "name": "arguments", + "serializedName": "arguments", + "description": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.", + "type": { + "$id": "1288", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCallChunk.function.anonymous.arguments" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCallChunk.function" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatCompletionStreamResponseDelta.tool_calls" + }, + { + "$id": "1289", + "kind": "property", + "name": "role", + "serializedName": "role", + "description": "The role of the author of this message.", + "type": { + "$ref": "239" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatCompletionStreamResponseDelta.role" + }, + { + "$id": "1290", + "kind": "property", + "name": "refusal", + "serializedName": "refusal", + "description": "The refusal message generated by the model.", + "type": { + "$id": "1291", + "kind": "nullable", + "type": { + "$id": "1292", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatCompletionStreamResponseDelta.refusal" + }, + { + "$id": "1293", + "kind": "property", + "name": "context", + "serializedName": "context", + "description": "The Azure-specific context information associated with the chat completion response message.", + "type": { + "$id": "1294", + "kind": "model", + "name": "AzureChatMessageContext", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext", + "access": "public", + "usage": "Output,Json", + "description": "An additional property, added to chat completion response messages, produced by the Azure OpenAI service when using\nextension behavior. This includes intent and citation information from the On Your Data feature.", + "decorators": [], + "properties": [ + { + "$id": "1295", + "kind": "property", + "name": "intent", + "serializedName": "intent", + "description": "The detected intent from the chat history, which is used to carry conversation context between interactions", + "type": { + "$id": "1296", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.intent" + }, + { + "$id": "1297", + "kind": "property", + "name": "citations", + "serializedName": "citations", + "description": "The citations produced by the data retrieval.", + "type": { + "$id": "1298", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1299", + "kind": "model", + "name": "AzureChatMessageContextCitation", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1300", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The content of the citation.", + "type": { + "$id": "1301", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.content" + }, + { + "$id": "1302", + "kind": "property", + "name": "title", + "serializedName": "title", + "description": "The title for the citation.", + "type": { + "$id": "1303", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.title" + }, + { + "$id": "1304", + "kind": "property", + "name": "url", + "serializedName": "url", + "description": "The URL of the citation.", + "type": { + "$id": "1305", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.url" + }, + { + "$id": "1306", + "kind": "property", + "name": "filepath", + "serializedName": "filepath", + "description": "The file path for the citation.", + "type": { + "$id": "1307", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.filepath" + }, + { + "$id": "1308", + "kind": "property", + "name": "chunk_id", + "serializedName": "chunk_id", + "description": "The chunk ID for the citation.", + "type": { + "$id": "1309", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.chunk_id" + }, + { + "$id": "1310", + "kind": "property", + "name": "rerank_score", + "serializedName": "rerank_score", + "description": "The rerank score for the retrieval.", + "type": { + "$id": "1311", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.rerank_score" + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citations" + }, + { + "$id": "1312", + "kind": "property", + "name": "all_retrieved_documents", + "serializedName": "all_retrieved_documents", + "description": "Summary information about documents retrieved by the data retrieval operation.", + "type": { + "$id": "1313", + "kind": "model", + "name": "AzureChatMessageContextAllRetrievedDocuments", + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1314", + "kind": "property", + "name": "content", + "serializedName": "content", + "description": "The content of the citation.", + "type": { + "$id": "1315", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.content" + }, + { + "$id": "1316", + "kind": "property", + "name": "title", + "serializedName": "title", + "description": "The title for the citation.", + "type": { + "$id": "1317", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.title" + }, + { + "$id": "1318", + "kind": "property", + "name": "url", + "serializedName": "url", + "description": "The URL of the citation.", + "type": { + "$id": "1319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.url" + }, + { + "$id": "1320", + "kind": "property", + "name": "filepath", + "serializedName": "filepath", + "description": "The file path for the citation.", + "type": { + "$id": "1321", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.filepath" + }, + { + "$id": "1322", + "kind": "property", + "name": "chunk_id", + "serializedName": "chunk_id", + "description": "The chunk ID for the citation.", + "type": { + "$id": "1323", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.chunk_id" + }, + { + "$id": "1324", + "kind": "property", + "name": "rerank_score", + "serializedName": "rerank_score", + "description": "The rerank score for the retrieval.", + "type": { + "$id": "1325", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.rerank_score" + }, + { + "$id": "1326", + "kind": "property", + "name": "search_queries", + "serializedName": "search_queries", + "description": "The search queries executed to retrieve documents.", + "type": { + "$id": "1327", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1328", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.search_queries" + }, + { + "$id": "1329", + "kind": "property", + "name": "data_source_index", + "serializedName": "data_source_index", + "description": "The index of the data source used for retrieval.", + "type": { + "$id": "1330", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.data_source_index" + }, + { + "$id": "1331", + "kind": "property", + "name": "original_search_score", + "serializedName": "original_search_score", + "description": "The original search score for the retrieval.", + "type": { + "$id": "1332", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.original_search_score" + }, + { + "$id": "1333", + "kind": "property", + "name": "filter_reason", + "serializedName": "filter_reason", + "description": "If applicable, an indication of why the document was filtered.", + "type": { + "$ref": "249" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.filter_reason" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureChatCompletionStreamResponseDelta.context" + } + ] + }, + { + "$ref": "1255" + }, + { + "$ref": "1269" + }, + { + "$ref": "1276" + }, + { + "$ref": "1284" + }, + { + "$ref": "1294" + }, + { + "$ref": "1299" + }, + { + "$ref": "1313" + }, + { + "$id": "1334", + "kind": "model", + "name": "AzureOpenAIChatErrorResponse", + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatErrorResponse", + "access": "public", + "usage": "Output,Json", + "description": "A structured representation of an error an Azure OpenAI request.", + "decorators": [], + "properties": [ + { + "$id": "1335", + "kind": "property", + "name": "error", + "serializedName": "error", + "type": { + "$id": "1336", + "kind": "model", + "name": "AzureOpenAIChatError", + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError", + "access": "public", + "usage": "Output,Json", + "description": "The structured representation of an error from an Azure OpenAI chat completion request.", + "decorators": [], + "properties": [ + { + "$id": "1337", + "kind": "property", + "name": "code", + "serializedName": "code", + "description": "The distinct, machine-generated identifier for the error.", + "type": { + "$id": "1338", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.code" + }, + { + "$id": "1339", + "kind": "property", + "name": "message", + "serializedName": "message", + "description": "A human-readable message associated with the error.", + "type": { + "$id": "1340", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.message" + }, + { + "$id": "1341", + "kind": "property", + "name": "param", + "serializedName": "param", + "description": "If applicable, the request input parameter associated with the error", + "type": { + "$id": "1342", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.param" + }, + { + "$id": "1343", + "kind": "property", + "name": "type", + "serializedName": "type", + "description": "If applicable, the input line number associated with the error.", + "type": { + "$id": "1344", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.type" + }, + { + "$id": "1345", + "kind": "property", + "name": "inner_error", + "serializedName": "inner_error", + "description": "If applicable, an upstream error that originated this error.", + "type": { + "$id": "1346", + "kind": "model", + "name": "AzureOpenAIChatErrorInnerError", + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error.anonymous", + "usage": "Output,Json", + "decorators": [], + "properties": [ + { + "$id": "1347", + "kind": "property", + "name": "code", + "serializedName": "code", + "description": "The code associated with the inner error.", + "type": { + "$id": "1348", + "kind": "constant", + "valueType": { + "$ref": "255" + }, + "value": "ResponsibleAIPolicyViolation", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error.anonymous.code" + }, + { + "$id": "1349", + "kind": "property", + "name": "revised_prompt", + "serializedName": "revised_prompt", + "description": "If applicable, the modified prompt used for generation.", + "type": { + "$id": "1350", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error.anonymous.revised_prompt" + }, + { + "$id": "1351", + "kind": "property", + "name": "content_filter_results", + "serializedName": "content_filter_results", + "description": "The content filter result details associated with the inner error.", + "type": { + "$ref": "1239" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error.anonymous.content_filter_results" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error" + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatErrorResponse.error" + } + ] + }, + { + "$ref": "1336" + }, + { + "$ref": "1346" + }, + { + "$id": "1352", + "kind": "model", + "name": "AzureContentFilterBlocklistIdResult", + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistIdResult", + "access": "public", + "usage": "Output", + "description": "A content filter result item that associates an existing custom blocklist ID with a value indicating whether or not\nthe corresponding blocklist resulted in content being filtered.", + "decorators": [], + "properties": [ + { + "$id": "1353", + "kind": "property", + "name": "id", + "serializedName": "id", + "description": "The ID of the custom blocklist associated with the filtered status.", + "type": { + "$id": "1354", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistIdResult.id" + }, + { + "$id": "1355", + "kind": "property", + "name": "filtered", + "serializedName": "filtered", + "description": "Whether the associated blocklist resulted in the content being filtered.", + "type": { + "$id": "1356", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistIdResult.filtered" + } + ] + }, + { + "$id": "1357", + "kind": "model", + "name": "AzureOpenAIFile", + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile", + "access": "public", + "usage": "Output", + "decorators": [], + "properties": [ + { + "$id": "1358", + "kind": "property", + "name": "id", + "serializedName": "id", + "description": "The file identifier, which can be referenced in the API endpoints.", + "type": { + "$id": "1359", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.id" + }, + { + "$id": "1360", + "kind": "property", + "name": "bytes", + "serializedName": "bytes", + "description": "The size of the file, in bytes.", + "type": { + "$id": "1361", + "kind": "nullable", + "type": { + "$id": "1362", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.bytes" + }, + { + "$id": "1363", + "kind": "property", + "name": "created_at", + "serializedName": "created_at", + "description": "The Unix timestamp (in seconds) for when the file was created.", + "type": { + "$id": "1364", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "unixTimestamp", + "wireType": { + "$id": "1365", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.created_at" + }, + { + "$id": "1366", + "kind": "property", + "name": "filename", + "serializedName": "filename", + "description": "The name of the file.", + "type": { + "$id": "1367", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.filename" + }, + { + "$id": "1368", + "kind": "property", + "name": "object", + "serializedName": "object", + "description": "The object type, which is always `file`.", + "type": { + "$id": "1369", + "kind": "constant", + "valueType": { + "$ref": "290" + }, + "value": "file", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.object" + }, + { + "$id": "1370", + "kind": "property", + "name": "purpose", + "serializedName": "purpose", + "description": "The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results` and `vision`.", + "type": { + "$ref": "274" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.purpose" + }, + { + "$id": "1371", + "kind": "property", + "name": "status_details", + "serializedName": "status_details", + "description": "Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.", + "type": { + "$id": "1372", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.status_details" + }, + { + "$id": "1373", + "kind": "property", + "name": "status", + "serializedName": "status", + "type": { + "$ref": "293" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.status" + } + ] + }, + { + "$id": "1374", + "kind": "model", + "name": "AzureImage", + "crossLanguageDefinitionId": "AzureOpenAI.AzureImage", + "access": "public", + "usage": "Output", + "decorators": [], + "baseModel": { + "$ref": "448" + }, + "properties": [ + { + "$id": "1375", + "kind": "property", + "name": "prompt_filter_results", + "serializedName": "prompt_filter_results", + "type": { + "$ref": "473" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureImage.prompt_filter_results" + }, + { + "$id": "1376", + "kind": "property", + "name": "content_filter_results", + "serializedName": "content_filter_results", + "type": { + "$ref": "474" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureOpenAI.AzureImage.content_filter_results" + } + ] + } + ], + "Clients": [ + { + "$id": "1377", + "Name": "AzureOpenAIClient", + "Operations": [], + "Protocol": { + "$id": "1378" + }, + "Parameters": [ + { + "$id": "1379", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", + "Type": { + "$id": "1380", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "1381", + "Name": "AzureChat", + "Operations": [ + { + "$id": "1382", + "Name": "createChatCompletion", + "ResourceName": "AzureChat", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1383", + "Name": "deployment_id", + "NameInRequest": "deployment_id", + "Type": { + "$id": "1384", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1385", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1386", + "kind": "constant", + "valueType": { + "$id": "1387", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1388", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1389", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1390", + "Name": "request", + "NameInRequest": "request", + "Type": { + "$ref": "501" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1391", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "1334" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json", + "application/json", + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/openai", + "Path": "/{deployment_id}/chat/completions", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "AzureOpenAI.AzureChat.createChatCompletion", + "Decorators": [] + } + ], + "Protocol": { + "$id": "1392" + }, + "Parent": "AzureOpenAIClient", + "Parameters": [ + { + "$id": "1393", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", + "Type": { + "$id": "1394", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "1395", + "Name": "AzureImages", + "Operations": [ + { + "$id": "1396", + "Name": "createImage", + "ResourceName": "AzureImages", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1397", + "Name": "deploymentId", + "NameInRequest": "deploymentId", + "Type": { + "$id": "1398", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1399", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1400", + "kind": "constant", + "valueType": { + "$id": "1401", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1402", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1403", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1404", + "Name": "image", + "NameInRequest": "image", + "Type": { + "$ref": "425" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1405", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "455" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json", + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/openai", + "Path": "/deployments/{deploymentId}/images/generations", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "AzureOpenAI.AzureImages.createImage", + "Decorators": [] + } + ], + "Protocol": { + "$id": "1406" + }, + "Parent": "AzureOpenAIClient", + "Parameters": [ + { + "$id": "1407", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", + "Type": { + "$id": "1408", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "1409", + "Name": "AzureMessages", + "Operations": [ + { + "$id": "1410", + "Name": "createMessage", + "ResourceName": "AzureMessages", + "Summary": "Create a message.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "1411", + "Name": "thread_id", + "NameInRequest": "thread_id", + "Description": "The ID of the [thread](/docs/api-reference/threads) to create a message for.", + "Type": { + "$id": "1412", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Path", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1413", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "1414", + "kind": "constant", + "valueType": { + "$id": "1415", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1416", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "1417", + "kind": "constant", + "valueType": { + "$id": "1418", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "1419", + "Name": "requestBody", + "NameInRequest": "requestBody", + "Type": { + "$ref": "309" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "1420", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "366" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/openai", + "Path": "/threads/{thread_id}/messages", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "AzureOpenAI.AzureMessages.createMessage", + "Decorators": [] + } + ], + "Protocol": { + "$id": "1421" + }, + "Parent": "AzureOpenAIClient", + "Parameters": [ + { + "$id": "1422", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", + "Type": { + "$id": "1423", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ], + "Auth": { + "$id": "1424", + "ApiKey": { + "$id": "1425", + "Name": "api-key" + }, + "OAuth2": { + "$id": "1426", + "Scopes": [ + "https://cognitiveservices.azure.com/.default" + ] + } + } +} diff --git a/.plugin.azure/generator/src/AzureOpenAILibraryPlugin.cs b/.plugin.azure/generator/src/AzureOpenAILibraryPlugin.cs index 6c4f6cf9b..ac32a0a3e 100644 --- a/.plugin.azure/generator/src/AzureOpenAILibraryPlugin.cs +++ b/.plugin.azure/generator/src/AzureOpenAILibraryPlugin.cs @@ -14,7 +14,7 @@ public AzureOpenAILibraryPlugin(GeneratorContext context) : base(context) { } public override void Configure() { base.Configure(); - // AddVisitor(new AzureOpenAILibraryVisitor()); + AddVisitor(new DocEditVisitor()); AddVisitor(new AdditionalPropertiesVisitor()); AddVisitor(new ModelSerializationEmptySentinelVisitor()); diff --git a/.plugin.azure/tspconfig.yaml b/.plugin.azure/tspconfig.yaml deleted file mode 100644 index 6e4a491f2..000000000 --- a/.plugin.azure/tspconfig.yaml +++ /dev/null @@ -1,4 +0,0 @@ -"emit": - - "@azure-openai/plugin" -"options": - "@azure-openai/plugin": \ No newline at end of file diff --git a/.typespec.azure/tspconfig.yaml b/.typespec.azure/tspconfig.yaml index d8aee255f..53c4932f5 100644 --- a/.typespec.azure/tspconfig.yaml +++ b/.typespec.azure/tspconfig.yaml @@ -9,4 +9,5 @@ options: namespace: "Azure.AI.OpenAI" emitter-output-dir: "{project-root}/../.dotnet.azure/sdk/openai/Azure.AI.OpenAI" unreferenced-types-handling: keepAll - new-project: false \ No newline at end of file + new-project: false + save-inputs: true From 9e3af94bc9cf955b39f9c2348e814387ce2e09cc Mon Sep 17 00:00:00 2001 From: Travis Wilson Date: Tue, 25 Feb 2025 11:11:16 -0800 Subject: [PATCH 7/8] post-merge fix for reverted mpfd type --- .../Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs index 5948dbd4f..dc68a126d 100644 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs +++ b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs @@ -47,7 +47,7 @@ public override ClientResult UploadFile(Stream file, string filename Argument.AssertNotNull(file, "file"); Argument.AssertNotNullOrEmpty(filename, "filename"); - using MultipartFormDataBinaryContent content = CreateMultiPartContentWithMimeType(file, filename, purpose); + using MultiPartFormDataBinaryContent content = CreateMultiPartContentWithMimeType(file, filename, purpose); ClientResult clientResult = UploadFile(content, content.ContentType, new() { CancellationToken = cancellationToken }); return GetAzureFileResult(clientResult); @@ -66,7 +66,7 @@ public override async Task> UploadFileAsync(Stream file Argument.AssertNotNull(file, "file"); Argument.AssertNotNullOrEmpty(filename, "filename"); - using MultipartFormDataBinaryContent content = CreateMultiPartContentWithMimeType(file, filename, purpose); + using MultiPartFormDataBinaryContent content = CreateMultiPartContentWithMimeType(file, filename, purpose); ClientResult result = await UploadFileAsync(content, content.ContentType, new() { CancellationToken = cancellationToken }) .ConfigureAwait(continueOnCapturedContext: false); return GetAzureFileResult(result); @@ -108,9 +108,9 @@ public override ClientResult GetFiles(FilePurpose purpose, return GetTypedResult(protocolResult, AzureOpenAIFileCollection.FromResponse); } - private MultipartFormDataBinaryContent CreateMultiPartContentWithMimeType(Stream file, string filename, FileUploadPurpose purpose) + private MultiPartFormDataBinaryContent CreateMultiPartContentWithMimeType(Stream file, string filename, FileUploadPurpose purpose) { - MultipartFormDataBinaryContent multipartFormDataBinaryContent = new MultipartFormDataBinaryContent(); + MultiPartFormDataBinaryContent multipartFormDataBinaryContent = new(); string contentType = "text/plain"; if (purpose == FileUploadPurpose.Batch) { From 715e95828a6defeb27ffbc092bac3b82fee91e43 Mon Sep 17 00:00:00 2001 From: Travis Wilson Date: Wed, 26 Feb 2025 17:02:17 -0800 Subject: [PATCH 8/8] PR feedback -- visitor comments and gitignore consistency --- .dotnet.azure/.gitignore | 3 + .dotnet.azure/sdk/openai/.gitignore | 1 - .../openai/Azure.AI.OpenAI/Configuration.json | 7 - .../openai/Azure.AI.OpenAI/tspCodeModel.json | 14442 ---------------- .../Visitors/AdditionalPropertiesVisitor.cs | 204 +- .../generator/src/Visitors/DocEditVisitor.cs | 83 +- .../InternalSettablePropertiesVisitor.cs | 41 +- .../ModelSerializationEmptySentinelVisitor.cs | 97 +- .../src/Visitors/TypeRemovalVisitor.cs | 96 +- .../src/Visitors/WriteableSardVisitor.cs | 33 +- 10 files changed, 271 insertions(+), 14736 deletions(-) create mode 100644 .dotnet.azure/.gitignore delete mode 100644 .dotnet.azure/sdk/openai/.gitignore delete mode 100644 .dotnet.azure/sdk/openai/Azure.AI.OpenAI/Configuration.json delete mode 100644 .dotnet.azure/sdk/openai/Azure.AI.OpenAI/tspCodeModel.json diff --git a/.dotnet.azure/.gitignore b/.dotnet.azure/.gitignore new file mode 100644 index 000000000..f72a03698 --- /dev/null +++ b/.dotnet.azure/.gitignore @@ -0,0 +1,3 @@ +# Artifacts from the generator +sdk/openai/Azure.AI.OpenAI/tspCodeModel.json +sdk/openai/Azure.AI.OpenAI/Configuration.json diff --git a/.dotnet.azure/sdk/openai/.gitignore b/.dotnet.azure/sdk/openai/.gitignore deleted file mode 100644 index 5e5364f16..000000000 --- a/.dotnet.azure/sdk/openai/.gitignore +++ /dev/null @@ -1 +0,0 @@ -#Azure.AI.OpenAI/Directory.Build.props \ No newline at end of file diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/Configuration.json b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/Configuration.json deleted file mode 100644 index 2a48b3996..000000000 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/Configuration.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "output-folder": ".", - "namespace": "Azure.AI.OpenAI", - "library-name": "Azure.AI.OpenAI", - "unreferenced-types-handling": "keepAll", - "use-model-reader-writer": true -} diff --git a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/tspCodeModel.json b/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/tspCodeModel.json deleted file mode 100644 index 648048ede..000000000 --- a/.dotnet.azure/sdk/openai/Azure.AI.OpenAI/tspCodeModel.json +++ /dev/null @@ -1,14442 +0,0 @@ -{ - "$id": "1", - "Name": "AzureOpenAI", - "ApiVersions": [ - "2024-06-01", - "2024-08-01-preview", - "2024-09-01-preview", - "2024-10-01-preview", - "2024-10-21", - "2024-12-01-preview", - "2025-01-01-preview" - ], - "Enums": [ - { - "$id": "2", - "kind": "enum", - "name": "CreateMessageRequestRole", - "crossLanguageDefinitionId": "CreateMessageRequest.role.anonymous", - "valueType": { - "$id": "3", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "4", - "kind": "enumvalue", - "name": "user", - "value": "user", - "valueType": { - "$id": "5", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "2" - }, - "decorators": [] - }, - { - "$id": "6", - "kind": "enumvalue", - "name": "assistant", - "value": "assistant", - "valueType": { - "$id": "7", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "2" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "8", - "kind": "enum", - "name": "FileSearchRankingOptionsRanker", - "crossLanguageDefinitionId": "FileSearchRankingOptions.ranker.anonymous", - "valueType": { - "$id": "9", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "10", - "kind": "enumvalue", - "name": "auto", - "value": "auto", - "valueType": { - "$id": "11", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "8" - }, - "decorators": [] - }, - { - "$id": "12", - "kind": "enumvalue", - "name": "default_2024_08_21", - "value": "default_2024_08_21", - "valueType": { - "$id": "13", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "8" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "None", - "decorators": [] - }, - { - "$id": "14", - "kind": "enum", - "name": "AssistantToolsFileSearchTypeOnly_type", - "valueType": { - "$id": "15", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "16", - "kind": "enumvalue", - "name": "file_search", - "value": "file_search", - "description": "file_search", - "valueType": { - "$ref": "15" - }, - "enumType": { - "$ref": "14" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The AssistantToolsFileSearchTypeOnly_type", - "isFixed": false, - "isFlags": false, - "usage": "Input,Output,Json", - "decorators": [] - }, - { - "$id": "17", - "kind": "enum", - "name": "MessageObject_object", - "valueType": { - "$id": "18", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "19", - "kind": "enumvalue", - "name": "thread.message", - "value": "thread.message", - "description": "thread.message", - "valueType": { - "$ref": "18" - }, - "enumType": { - "$ref": "17" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The MessageObject_object", - "isFixed": false, - "isFlags": false, - "usage": "Output,Json", - "decorators": [] - }, - { - "$id": "20", - "kind": "enum", - "name": "MessageObjectStatus", - "crossLanguageDefinitionId": "MessageObject.status.anonymous", - "valueType": { - "$id": "21", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "22", - "kind": "enumvalue", - "name": "in_progress", - "value": "in_progress", - "valueType": { - "$id": "23", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "20" - }, - "decorators": [] - }, - { - "$id": "24", - "kind": "enumvalue", - "name": "incomplete", - "value": "incomplete", - "valueType": { - "$id": "25", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "20" - }, - "decorators": [] - }, - { - "$id": "26", - "kind": "enumvalue", - "name": "completed", - "value": "completed", - "valueType": { - "$id": "27", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "20" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Output,Json", - "decorators": [] - }, - { - "$id": "28", - "kind": "enum", - "name": "MessageObjectIncompleteDetailsReason", - "crossLanguageDefinitionId": "MessageObject.incomplete_details.reason.anonymous", - "valueType": { - "$id": "29", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "30", - "kind": "enumvalue", - "name": "content_filter", - "value": "content_filter", - "valueType": { - "$id": "31", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "28" - }, - "decorators": [] - }, - { - "$id": "32", - "kind": "enumvalue", - "name": "max_tokens", - "value": "max_tokens", - "valueType": { - "$id": "33", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "28" - }, - "decorators": [] - }, - { - "$id": "34", - "kind": "enumvalue", - "name": "run_cancelled", - "value": "run_cancelled", - "valueType": { - "$id": "35", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "28" - }, - "decorators": [] - }, - { - "$id": "36", - "kind": "enumvalue", - "name": "run_expired", - "value": "run_expired", - "valueType": { - "$id": "37", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "28" - }, - "decorators": [] - }, - { - "$id": "38", - "kind": "enumvalue", - "name": "run_failed", - "value": "run_failed", - "valueType": { - "$id": "39", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "28" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Output,Json", - "decorators": [] - }, - { - "$id": "40", - "kind": "enum", - "name": "MessageObjectRole", - "crossLanguageDefinitionId": "MessageObject.role.anonymous", - "valueType": { - "$id": "41", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "42", - "kind": "enumvalue", - "name": "user", - "value": "user", - "valueType": { - "$id": "43", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "40" - }, - "decorators": [] - }, - { - "$id": "44", - "kind": "enumvalue", - "name": "assistant", - "value": "assistant", - "valueType": { - "$id": "45", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "40" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Output,Json", - "decorators": [] - }, - { - "$id": "46", - "kind": "enum", - "name": "CreateImageRequestModel", - "crossLanguageDefinitionId": "CreateImageRequest.model.anonymous", - "valueType": { - "$id": "47", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "48", - "kind": "enumvalue", - "name": "dall-e-2", - "value": "dall-e-2", - "valueType": { - "$id": "49", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "46" - }, - "decorators": [] - }, - { - "$id": "50", - "kind": "enumvalue", - "name": "dall-e-3", - "value": "dall-e-3", - "valueType": { - "$id": "51", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "46" - }, - "decorators": [] - } - ], - "isFixed": false, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "52", - "kind": "enum", - "name": "CreateImageRequestQuality", - "crossLanguageDefinitionId": "CreateImageRequest.quality.anonymous", - "valueType": { - "$id": "53", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "54", - "kind": "enumvalue", - "name": "standard", - "value": "standard", - "valueType": { - "$id": "55", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "52" - }, - "decorators": [] - }, - { - "$id": "56", - "kind": "enumvalue", - "name": "hd", - "value": "hd", - "valueType": { - "$id": "57", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "52" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "58", - "kind": "enum", - "name": "CreateImageRequestResponseFormat", - "crossLanguageDefinitionId": "CreateImageRequest.response_format.anonymous", - "valueType": { - "$id": "59", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "60", - "kind": "enumvalue", - "name": "url", - "value": "url", - "valueType": { - "$id": "61", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "58" - }, - "decorators": [] - }, - { - "$id": "62", - "kind": "enumvalue", - "name": "b64_json", - "value": "b64_json", - "valueType": { - "$id": "63", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "58" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "64", - "kind": "enum", - "name": "CreateImageRequestSize", - "crossLanguageDefinitionId": "CreateImageRequest.size.anonymous", - "valueType": { - "$id": "65", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "66", - "kind": "enumvalue", - "name": "256x256", - "value": "256x256", - "valueType": { - "$id": "67", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "64" - }, - "decorators": [] - }, - { - "$id": "68", - "kind": "enumvalue", - "name": "512x512", - "value": "512x512", - "valueType": { - "$id": "69", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "64" - }, - "decorators": [] - }, - { - "$id": "70", - "kind": "enumvalue", - "name": "1024x1024", - "value": "1024x1024", - "valueType": { - "$id": "71", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "64" - }, - "decorators": [] - }, - { - "$id": "72", - "kind": "enumvalue", - "name": "1792x1024", - "value": "1792x1024", - "valueType": { - "$id": "73", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "64" - }, - "decorators": [] - }, - { - "$id": "74", - "kind": "enumvalue", - "name": "1024x1792", - "value": "1024x1792", - "valueType": { - "$id": "75", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "64" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "76", - "kind": "enum", - "name": "CreateImageRequestStyle", - "crossLanguageDefinitionId": "CreateImageRequest.style.anonymous", - "valueType": { - "$id": "77", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "78", - "kind": "enumvalue", - "name": "vivid", - "value": "vivid", - "valueType": { - "$id": "79", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "76" - }, - "decorators": [] - }, - { - "$id": "80", - "kind": "enumvalue", - "name": "natural", - "value": "natural", - "valueType": { - "$id": "81", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "76" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "82", - "kind": "enum", - "name": "AzureOpenAIDalleErrorInnerError_code", - "valueType": { - "$id": "83", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "84", - "kind": "enumvalue", - "name": "ResponsibleAIPolicyViolation", - "value": "ResponsibleAIPolicyViolation", - "description": "ResponsibleAIPolicyViolation", - "valueType": { - "$ref": "83" - }, - "enumType": { - "$ref": "82" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The AzureOpenAIDalleErrorInnerError_code", - "isFixed": false, - "isFlags": false, - "usage": "Output,Json", - "decorators": [] - }, - { - "$id": "85", - "kind": "enum", - "name": "AzureContentFilterSeverityResultSeverity", - "crossLanguageDefinitionId": "AzureContentFilterSeverityResult.severity.anonymous", - "valueType": { - "$id": "86", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "87", - "kind": "enumvalue", - "name": "safe", - "value": "safe", - "valueType": { - "$id": "88", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "85" - }, - "decorators": [] - }, - { - "$id": "89", - "kind": "enumvalue", - "name": "low", - "value": "low", - "valueType": { - "$id": "90", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "85" - }, - "decorators": [] - }, - { - "$id": "91", - "kind": "enumvalue", - "name": "medium", - "value": "medium", - "valueType": { - "$id": "92", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "85" - }, - "decorators": [] - }, - { - "$id": "93", - "kind": "enumvalue", - "name": "high", - "value": "high", - "valueType": { - "$id": "94", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "85" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Output,Json", - "decorators": [] - }, - { - "$id": "95", - "kind": "enum", - "name": "ChatCompletionRequestMessageContentPartText_type", - "valueType": { - "$id": "96", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "97", - "kind": "enumvalue", - "name": "text", - "value": "text", - "description": "text", - "valueType": { - "$ref": "96" - }, - "enumType": { - "$ref": "95" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The ChatCompletionRequestMessageContentPartText_type", - "isFixed": false, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "98", - "kind": "enum", - "name": "ChatCompletionRequestMessageContentPartImage_type", - "valueType": { - "$id": "99", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "100", - "kind": "enumvalue", - "name": "image_url", - "value": "image_url", - "description": "image_url", - "valueType": { - "$ref": "99" - }, - "enumType": { - "$ref": "98" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The ChatCompletionRequestMessageContentPartImage_type", - "isFixed": false, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "101", - "kind": "enum", - "name": "ChatCompletionRequestMessageContentPartImageImageUrlDetail", - "crossLanguageDefinitionId": "ChatCompletionRequestMessageContentPartImage.image_url.detail.anonymous", - "valueType": { - "$id": "102", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "103", - "kind": "enumvalue", - "name": "auto", - "value": "auto", - "valueType": { - "$id": "104", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "101" - }, - "decorators": [] - }, - { - "$id": "105", - "kind": "enumvalue", - "name": "low", - "value": "low", - "valueType": { - "$id": "106", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "101" - }, - "decorators": [] - }, - { - "$id": "107", - "kind": "enumvalue", - "name": "high", - "value": "high", - "valueType": { - "$id": "108", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "101" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "109", - "kind": "enum", - "name": "ChatCompletionRequestMessageContentPartAudio_type", - "valueType": { - "$id": "110", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "111", - "kind": "enumvalue", - "name": "input_audio", - "value": "input_audio", - "description": "input_audio", - "valueType": { - "$ref": "110" - }, - "enumType": { - "$ref": "109" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The ChatCompletionRequestMessageContentPartAudio_type", - "isFixed": false, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "112", - "kind": "enum", - "name": "ChatCompletionRequestMessageContentPartAudioInputAudioFormat", - "crossLanguageDefinitionId": "ChatCompletionRequestMessageContentPartAudio.input_audio.format.anonymous", - "valueType": { - "$id": "113", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "114", - "kind": "enumvalue", - "name": "wav", - "value": "wav", - "valueType": { - "$id": "115", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "112" - }, - "decorators": [] - }, - { - "$id": "116", - "kind": "enumvalue", - "name": "mp3", - "value": "mp3", - "valueType": { - "$id": "117", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "112" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "118", - "kind": "enum", - "name": "ChatCompletionRequestMessageContentPartRefusal_type", - "valueType": { - "$id": "119", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "120", - "kind": "enumvalue", - "name": "refusal", - "value": "refusal", - "description": "refusal", - "valueType": { - "$ref": "119" - }, - "enumType": { - "$ref": "118" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The ChatCompletionRequestMessageContentPartRefusal_type", - "isFixed": false, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "121", - "kind": "enum", - "name": "ChatCompletionMessageToolCall_type", - "valueType": { - "$id": "122", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "123", - "kind": "enumvalue", - "name": "function", - "value": "function", - "description": "function", - "valueType": { - "$ref": "122" - }, - "enumType": { - "$ref": "121" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The ChatCompletionMessageToolCall_type", - "isFixed": false, - "isFlags": false, - "usage": "Input,Output,Json", - "decorators": [] - }, - { - "$id": "124", - "kind": "enum", - "name": "AzureCreateChatCompletionRequestReasoningEffort", - "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.reasoning_effort.anonymous", - "valueType": { - "$id": "125", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "126", - "kind": "enumvalue", - "name": "low", - "value": "low", - "valueType": { - "$id": "127", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "124" - }, - "decorators": [] - }, - { - "$id": "128", - "kind": "enumvalue", - "name": "medium", - "value": "medium", - "valueType": { - "$id": "129", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "124" - }, - "decorators": [] - }, - { - "$id": "130", - "kind": "enumvalue", - "name": "high", - "value": "high", - "valueType": { - "$id": "131", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "124" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "132", - "kind": "enum", - "name": "AzureCreateChatCompletionRequestModality", - "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.modality.anonymous", - "valueType": { - "$id": "133", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "134", - "kind": "enumvalue", - "name": "text", - "value": "text", - "valueType": { - "$id": "135", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "132" - }, - "decorators": [] - }, - { - "$id": "136", - "kind": "enumvalue", - "name": "audio", - "value": "audio", - "valueType": { - "$id": "137", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "132" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "138", - "kind": "enum", - "name": "ChatOutputPredictionType", - "crossLanguageDefinitionId": "ChatOutputPrediction.type.anonymous", - "valueType": { - "$id": "139", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "140", - "kind": "enumvalue", - "name": "content", - "value": "content", - "valueType": { - "$id": "141", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "138" - }, - "decorators": [] - } - ], - "isFixed": false, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "142", - "kind": "enum", - "name": "AzureCreateChatCompletionRequestAudioVoice", - "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.audio.voice.anonymous", - "valueType": { - "$id": "143", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "144", - "kind": "enumvalue", - "name": "alloy", - "value": "alloy", - "valueType": { - "$id": "145", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "142" - }, - "decorators": [] - }, - { - "$id": "146", - "kind": "enumvalue", - "name": "ash", - "value": "ash", - "valueType": { - "$id": "147", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "142" - }, - "decorators": [] - }, - { - "$id": "148", - "kind": "enumvalue", - "name": "ballad", - "value": "ballad", - "valueType": { - "$id": "149", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "142" - }, - "decorators": [] - }, - { - "$id": "150", - "kind": "enumvalue", - "name": "coral", - "value": "coral", - "valueType": { - "$id": "151", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "142" - }, - "decorators": [] - }, - { - "$id": "152", - "kind": "enumvalue", - "name": "echo", - "value": "echo", - "valueType": { - "$id": "153", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "142" - }, - "decorators": [] - }, - { - "$id": "154", - "kind": "enumvalue", - "name": "sage", - "value": "sage", - "valueType": { - "$id": "155", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "142" - }, - "decorators": [] - }, - { - "$id": "156", - "kind": "enumvalue", - "name": "shimmer", - "value": "shimmer", - "valueType": { - "$id": "157", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "142" - }, - "decorators": [] - }, - { - "$id": "158", - "kind": "enumvalue", - "name": "verse", - "value": "verse", - "valueType": { - "$id": "159", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "142" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "160", - "kind": "enum", - "name": "AzureCreateChatCompletionRequestAudioFormat", - "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.audio.format.anonymous", - "valueType": { - "$id": "161", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "162", - "kind": "enumvalue", - "name": "wav", - "value": "wav", - "valueType": { - "$id": "163", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "160" - }, - "decorators": [] - }, - { - "$id": "164", - "kind": "enumvalue", - "name": "mp3", - "value": "mp3", - "valueType": { - "$id": "165", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "160" - }, - "decorators": [] - }, - { - "$id": "166", - "kind": "enumvalue", - "name": "flac", - "value": "flac", - "valueType": { - "$id": "167", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "160" - }, - "decorators": [] - }, - { - "$id": "168", - "kind": "enumvalue", - "name": "opus", - "value": "opus", - "valueType": { - "$id": "169", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "160" - }, - "decorators": [] - }, - { - "$id": "170", - "kind": "enumvalue", - "name": "pcm16", - "value": "pcm16", - "valueType": { - "$id": "171", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "160" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "172", - "kind": "enum", - "name": "ChatCompletionTool_type", - "valueType": { - "$id": "173", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "174", - "kind": "enumvalue", - "name": "function", - "value": "function", - "description": "function", - "valueType": { - "$ref": "173" - }, - "enumType": { - "$ref": "172" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The ChatCompletionTool_type", - "isFixed": false, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "175", - "kind": "enum", - "name": "AzureCreateChatCompletionRequestToolChoice", - "crossLanguageDefinitionId": "AzureCreateChatCompletionRequest.tool_choice.anonymous", - "valueType": { - "$id": "176", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "177", - "kind": "enumvalue", - "name": "none", - "value": "none", - "valueType": { - "$id": "178", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "175" - }, - "decorators": [] - }, - { - "$id": "179", - "kind": "enumvalue", - "name": "auto", - "value": "auto", - "valueType": { - "$id": "180", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "175" - }, - "decorators": [] - }, - { - "$id": "181", - "kind": "enumvalue", - "name": "required", - "value": "required", - "valueType": { - "$id": "182", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "175" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "183", - "kind": "enum", - "name": "ChatCompletionNamedToolChoice_type", - "valueType": { - "$id": "184", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "185", - "kind": "enumvalue", - "name": "function", - "value": "function", - "description": "function", - "valueType": { - "$ref": "184" - }, - "enumType": { - "$ref": "183" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The ChatCompletionNamedToolChoice_type", - "isFixed": false, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "186", - "kind": "enum", - "name": "AzureSearchChatDataSourceParametersIncludeContext", - "crossLanguageDefinitionId": "AzureSearchChatDataSource.parameters.include_context.anonymous", - "valueType": { - "$id": "187", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "188", - "kind": "enumvalue", - "name": "citations", - "value": "citations", - "valueType": { - "$id": "189", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "186" - }, - "decorators": [] - }, - { - "$id": "190", - "kind": "enumvalue", - "name": "intent", - "value": "intent", - "valueType": { - "$id": "191", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "186" - }, - "decorators": [] - }, - { - "$id": "192", - "kind": "enumvalue", - "name": "all_retrieved_documents", - "value": "all_retrieved_documents", - "valueType": { - "$id": "193", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "186" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "194", - "kind": "enum", - "name": "AzureSearchChatDataSourceParametersQueryType", - "crossLanguageDefinitionId": "AzureSearchChatDataSource.parameters.query_type.anonymous", - "valueType": { - "$id": "195", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "196", - "kind": "enumvalue", - "name": "simple", - "value": "simple", - "valueType": { - "$id": "197", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "194" - }, - "decorators": [] - }, - { - "$id": "198", - "kind": "enumvalue", - "name": "semantic", - "value": "semantic", - "valueType": { - "$id": "199", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "194" - }, - "decorators": [] - }, - { - "$id": "200", - "kind": "enumvalue", - "name": "vector", - "value": "vector", - "valueType": { - "$id": "201", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "194" - }, - "decorators": [] - }, - { - "$id": "202", - "kind": "enumvalue", - "name": "vector_simple_hybrid", - "value": "vector_simple_hybrid", - "valueType": { - "$id": "203", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "194" - }, - "decorators": [] - }, - { - "$id": "204", - "kind": "enumvalue", - "name": "vector_semantic_hybrid", - "value": "vector_semantic_hybrid", - "valueType": { - "$id": "205", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "194" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "206", - "kind": "enum", - "name": "ElasticsearchChatDataSourceParametersQueryType", - "crossLanguageDefinitionId": "ElasticsearchChatDataSource.parameters.query_type.anonymous", - "valueType": { - "$id": "207", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "208", - "kind": "enumvalue", - "name": "simple", - "value": "simple", - "valueType": { - "$id": "209", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "206" - }, - "decorators": [] - }, - { - "$id": "210", - "kind": "enumvalue", - "name": "vector", - "value": "vector", - "valueType": { - "$id": "211", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "206" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Input,Json", - "decorators": [] - }, - { - "$id": "212", - "kind": "enum", - "name": "AzureCreateChatCompletionResponseServiceTier", - "crossLanguageDefinitionId": "AzureCreateChatCompletionResponse.service_tier.anonymous", - "valueType": { - "$id": "213", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "214", - "kind": "enumvalue", - "name": "scale", - "value": "scale", - "valueType": { - "$id": "215", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "212" - }, - "decorators": [] - }, - { - "$id": "216", - "kind": "enumvalue", - "name": "default", - "value": "default", - "valueType": { - "$id": "217", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "212" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Output,Json", - "decorators": [] - }, - { - "$id": "218", - "kind": "enum", - "name": "AzureCreateChatCompletionResponse_object", - "valueType": { - "$id": "219", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "220", - "kind": "enumvalue", - "name": "chat.completion", - "value": "chat.completion", - "description": "chat.completion", - "valueType": { - "$ref": "219" - }, - "enumType": { - "$ref": "218" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The AzureCreateChatCompletionResponse_object", - "isFixed": false, - "isFlags": false, - "usage": "Output,Json", - "decorators": [] - }, - { - "$id": "221", - "kind": "enum", - "name": "AzureCreateChatCompletionResponseChoiceFinishReason", - "crossLanguageDefinitionId": "AzureCreateChatCompletionResponseChoice.finish_reason.anonymous", - "valueType": { - "$id": "222", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "223", - "kind": "enumvalue", - "name": "stop", - "value": "stop", - "valueType": { - "$id": "224", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "221" - }, - "decorators": [] - }, - { - "$id": "225", - "kind": "enumvalue", - "name": "length", - "value": "length", - "valueType": { - "$id": "226", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "221" - }, - "decorators": [] - }, - { - "$id": "227", - "kind": "enumvalue", - "name": "tool_calls", - "value": "tool_calls", - "valueType": { - "$id": "228", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "221" - }, - "decorators": [] - }, - { - "$id": "229", - "kind": "enumvalue", - "name": "content_filter", - "value": "content_filter", - "valueType": { - "$id": "230", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "221" - }, - "decorators": [] - }, - { - "$id": "231", - "kind": "enumvalue", - "name": "function_call", - "value": "function_call", - "valueType": { - "$id": "232", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "221" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Output,Json", - "decorators": [] - }, - { - "$id": "233", - "kind": "enum", - "name": "ChatCompletionResponseMessage_role", - "valueType": { - "$id": "234", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "235", - "kind": "enumvalue", - "name": "assistant", - "value": "assistant", - "description": "assistant", - "valueType": { - "$ref": "234" - }, - "enumType": { - "$ref": "233" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The ChatCompletionResponseMessage_role", - "isFixed": false, - "isFlags": false, - "usage": "Output,Json", - "decorators": [] - }, - { - "$id": "236", - "kind": "enum", - "name": "ChatCompletionMessageToolCallChunk_type", - "valueType": { - "$id": "237", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "238", - "kind": "enumvalue", - "name": "function", - "value": "function", - "description": "function", - "valueType": { - "$ref": "237" - }, - "enumType": { - "$ref": "236" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The ChatCompletionMessageToolCallChunk_type", - "isFixed": false, - "isFlags": false, - "usage": "Output,Json", - "decorators": [] - }, - { - "$id": "239", - "kind": "enum", - "name": "AzureChatCompletionStreamResponseDeltaRole", - "crossLanguageDefinitionId": "AzureChatCompletionStreamResponseDelta.role.anonymous", - "valueType": { - "$id": "240", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "241", - "kind": "enumvalue", - "name": "system", - "value": "system", - "valueType": { - "$id": "242", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "239" - }, - "decorators": [] - }, - { - "$id": "243", - "kind": "enumvalue", - "name": "user", - "value": "user", - "valueType": { - "$id": "244", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "239" - }, - "decorators": [] - }, - { - "$id": "245", - "kind": "enumvalue", - "name": "assistant", - "value": "assistant", - "valueType": { - "$id": "246", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "239" - }, - "decorators": [] - }, - { - "$id": "247", - "kind": "enumvalue", - "name": "tool", - "value": "tool", - "valueType": { - "$id": "248", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "239" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Output,Json", - "decorators": [] - }, - { - "$id": "249", - "kind": "enum", - "name": "AzureChatMessageContextAllRetrievedDocumentsFilterReason", - "crossLanguageDefinitionId": "AzureChatMessageContext.all_retrieved_documents.filter_reason.anonymous", - "valueType": { - "$id": "250", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "251", - "kind": "enumvalue", - "name": "score", - "value": "score", - "valueType": { - "$id": "252", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "249" - }, - "decorators": [] - }, - { - "$id": "253", - "kind": "enumvalue", - "name": "rerank", - "value": "rerank", - "valueType": { - "$id": "254", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "249" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Output,Json", - "decorators": [] - }, - { - "$id": "255", - "kind": "enum", - "name": "AzureOpenAIChatErrorInnerError_code", - "valueType": { - "$id": "256", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "257", - "kind": "enumvalue", - "name": "ResponsibleAIPolicyViolation", - "value": "ResponsibleAIPolicyViolation", - "description": "ResponsibleAIPolicyViolation", - "valueType": { - "$ref": "256" - }, - "enumType": { - "$ref": "255" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The AzureOpenAIChatErrorInnerError_code", - "isFixed": false, - "isFlags": false, - "usage": "Output,Json", - "decorators": [] - }, - { - "$id": "258", - "kind": "enum", - "name": "AzureOpenAIServiceApiVersion", - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIServiceApiVersion", - "valueType": { - "$id": "259", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "260", - "kind": "enumvalue", - "name": "v2024_06_01", - "value": "2024-06-01", - "valueType": { - "$id": "261", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "258" - }, - "description": "The 2024-06-01 (stable) service API version label.", - "decorators": [] - }, - { - "$id": "262", - "kind": "enumvalue", - "name": "v2024_08_01_preview", - "value": "2024-08-01-preview", - "valueType": { - "$id": "263", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "258" - }, - "description": "The 2024-08-01-preview service API version label.", - "decorators": [] - }, - { - "$id": "264", - "kind": "enumvalue", - "name": "v2024_09_01_preview", - "value": "2024-09-01-preview", - "valueType": { - "$id": "265", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "258" - }, - "description": "The 2024-09-01-preview service API version label.", - "decorators": [] - }, - { - "$id": "266", - "kind": "enumvalue", - "name": "v2024_10_01_preview", - "value": "2024-10-01-preview", - "valueType": { - "$id": "267", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "258" - }, - "description": "The 2024-10-01-preview service API version label.", - "decorators": [] - }, - { - "$id": "268", - "kind": "enumvalue", - "name": "v2024_10_21", - "value": "2024-10-21", - "valueType": { - "$id": "269", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "258" - }, - "description": "The 2024-10-21 (stable) service API version label.", - "decorators": [] - }, - { - "$id": "270", - "kind": "enumvalue", - "name": "v2024_12_01_preview", - "value": "2024-12-01-preview", - "valueType": { - "$id": "271", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "258" - }, - "description": "The 2024-12-01-preview service API version label.", - "decorators": [] - }, - { - "$id": "272", - "kind": "enumvalue", - "name": "v2025_01_01_preview", - "value": "2025-01-01-preview", - "valueType": { - "$id": "273", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "258" - }, - "description": "The 2025-01-01-preview service API version label.", - "decorators": [] - } - ], - "description": "Known service API versions for Azure OpenAI.", - "isFixed": true, - "isFlags": false, - "usage": "ApiVersionEnum", - "decorators": [] - }, - { - "$id": "274", - "kind": "enum", - "name": "OpenAIFileWithOmittedPropertiesPurpose", - "crossLanguageDefinitionId": "OpenAIFileWithOmittedProperties.purpose.anonymous", - "valueType": { - "$id": "275", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "276", - "kind": "enumvalue", - "name": "assistants", - "value": "assistants", - "valueType": { - "$id": "277", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "274" - }, - "decorators": [] - }, - { - "$id": "278", - "kind": "enumvalue", - "name": "assistants_output", - "value": "assistants_output", - "valueType": { - "$id": "279", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "274" - }, - "decorators": [] - }, - { - "$id": "280", - "kind": "enumvalue", - "name": "batch", - "value": "batch", - "valueType": { - "$id": "281", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "274" - }, - "decorators": [] - }, - { - "$id": "282", - "kind": "enumvalue", - "name": "batch_output", - "value": "batch_output", - "valueType": { - "$id": "283", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "274" - }, - "decorators": [] - }, - { - "$id": "284", - "kind": "enumvalue", - "name": "fine-tune", - "value": "fine-tune", - "valueType": { - "$id": "285", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "274" - }, - "decorators": [] - }, - { - "$id": "286", - "kind": "enumvalue", - "name": "fine-tune-results", - "value": "fine-tune-results", - "valueType": { - "$id": "287", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "274" - }, - "decorators": [] - }, - { - "$id": "288", - "kind": "enumvalue", - "name": "vision", - "value": "vision", - "valueType": { - "$id": "289", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "274" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Output", - "decorators": [] - }, - { - "$id": "290", - "kind": "enum", - "name": "AzureOpenAIFile_object", - "valueType": { - "$id": "291", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "292", - "kind": "enumvalue", - "name": "file", - "value": "file", - "description": "file", - "valueType": { - "$ref": "291" - }, - "enumType": { - "$ref": "290" - } - } - ], - "crossLanguageDefinitionId": "", - "description": "The AzureOpenAIFile_object", - "isFixed": false, - "isFlags": false, - "usage": "Output", - "decorators": [] - }, - { - "$id": "293", - "kind": "enum", - "name": "AzureOpenAIFileStatus", - "crossLanguageDefinitionId": "AzureOpenAIFile.status.anonymous", - "valueType": { - "$id": "294", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "values": [ - { - "$id": "295", - "kind": "enumvalue", - "name": "uploaded", - "value": "uploaded", - "valueType": { - "$id": "296", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "293" - }, - "decorators": [] - }, - { - "$id": "297", - "kind": "enumvalue", - "name": "pending", - "value": "pending", - "valueType": { - "$id": "298", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "293" - }, - "decorators": [] - }, - { - "$id": "299", - "kind": "enumvalue", - "name": "running", - "value": "running", - "valueType": { - "$id": "300", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "293" - }, - "decorators": [] - }, - { - "$id": "301", - "kind": "enumvalue", - "name": "processed", - "value": "processed", - "valueType": { - "$id": "302", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "293" - }, - "decorators": [] - }, - { - "$id": "303", - "kind": "enumvalue", - "name": "error", - "value": "error", - "valueType": { - "$id": "304", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "293" - }, - "decorators": [] - }, - { - "$id": "305", - "kind": "enumvalue", - "name": "deleting", - "value": "deleting", - "valueType": { - "$id": "306", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "293" - }, - "decorators": [] - }, - { - "$id": "307", - "kind": "enumvalue", - "name": "deleted", - "value": "deleted", - "valueType": { - "$id": "308", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "enumType": { - "$ref": "293" - }, - "decorators": [] - } - ], - "isFixed": true, - "isFlags": false, - "usage": "Output", - "decorators": [] - } - ], - "Models": [ - { - "$id": "309", - "kind": "model", - "name": "CreateMessageRequest", - "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "310", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the entity that is creating the message. Allowed values include:\n- `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.\n- `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.", - "type": { - "$ref": "2" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.role" - }, - { - "$id": "311", - "kind": "property", - "name": "content", - "serializedName": "content", - "type": { - "$id": "312", - "kind": "array", - "name": "ArrayMessageContent", - "valueType": { - "$id": "313", - "kind": "model", - "name": "MessageContent", - "crossLanguageDefinitionId": "OpenAI.MessageContent", - "access": "public", - "usage": "Input,Output,Json", - "description": "Represents a single piece of content in an Assistants API message.", - "decorators": [], - "properties": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.content" - }, - { - "$id": "314", - "kind": "property", - "name": "attachments", - "serializedName": "attachments", - "description": "A list of files attached to the message, and the tools they should be added to.", - "type": { - "$id": "315", - "kind": "nullable", - "type": { - "$id": "316", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "317", - "kind": "model", - "name": "CreateMessageRequestAttachment", - "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.attachment.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "318", - "kind": "property", - "name": "file_id", - "serializedName": "file_id", - "description": "The ID of the file to attach to the message.", - "type": { - "$id": "319", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.attachment.anonymous.file_id" - }, - { - "$id": "320", - "kind": "property", - "name": "tools", - "serializedName": "tools", - "description": "The tools to add this file to.", - "type": { - "$id": "321", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "322", - "kind": "union", - "name": "CreateMessageRequestAttachmentTool", - "variantTypes": [ - { - "$id": "323", - "kind": "model", - "name": "AssistantToolsCode", - "crossLanguageDefinitionId": "OpenAI.AssistantToolsCode", - "usage": "Input,Output,Json", - "discriminatorValue": "code_interpreter", - "decorators": [], - "baseModel": { - "$id": "324", - "kind": "model", - "name": "AssistantToolDefinition", - "crossLanguageDefinitionId": "OpenAI.AssistantToolDefinition", - "usage": "Input,Output,Json", - "decorators": [], - "discriminatorProperty": { - "$id": "325", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "326", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolDefinition.type" - }, - "properties": [ - { - "$ref": "325" - } - ], - "discriminatedSubtypes": { - "$id": "327", - "code_interpreter": { - "$ref": "323" - }, - "file_search": { - "$id": "328", - "kind": "model", - "name": "AssistantToolsFileSearch", - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch", - "usage": "None", - "discriminatorValue": "file_search", - "decorators": [], - "baseModel": { - "$ref": "324" - }, - "properties": [ - { - "$id": "329", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of tool being defined: `file_search`", - "type": { - "$id": "330", - "kind": "constant", - "valueType": { - "$id": "331", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "file_search", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.type" - }, - { - "$id": "332", - "kind": "property", - "name": "file_search", - "serializedName": "file_search", - "description": "Overrides for the file search tool.", - "type": { - "$id": "333", - "kind": "model", - "name": "AssistantToolsFileSearchFileSearch", - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.file_search.anonymous", - "usage": "None", - "decorators": [], - "properties": [ - { - "$id": "334", - "kind": "property", - "name": "max_num_results", - "serializedName": "max_num_results", - "description": "The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive.\n\nNote that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.", - "type": { - "$id": "335", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.file_search.anonymous.max_num_results" - }, - { - "$id": "336", - "kind": "property", - "name": "ranking_options", - "serializedName": "ranking_options", - "type": { - "$id": "337", - "kind": "model", - "name": "FileSearchRankingOptions", - "crossLanguageDefinitionId": "OpenAI.FileSearchRankingOptions", - "usage": "None", - "description": "The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.\n\nSee the [file search tool documentation](/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.", - "decorators": [], - "properties": [ - { - "$id": "338", - "kind": "property", - "name": "ranker", - "serializedName": "ranker", - "description": "The ranker to use for the file search. If not specified will use the `auto` ranker.", - "type": { - "$ref": "8" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.FileSearchRankingOptions.ranker" - }, - { - "$id": "339", - "kind": "property", - "name": "score_threshold", - "serializedName": "score_threshold", - "description": "The score threshold for the file search. All values must be a floating point number between 0 and 1.", - "type": { - "$id": "340", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.FileSearchRankingOptions.score_threshold" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.file_search.anonymous.ranking_options" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearch.file_search" - } - ] - }, - "function": { - "$id": "341", - "kind": "model", - "name": "AssistantToolsFunction", - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFunction", - "usage": "None", - "discriminatorValue": "function", - "decorators": [], - "baseModel": { - "$ref": "324" - }, - "properties": [ - { - "$id": "342", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of tool being defined: `function`", - "type": { - "$id": "343", - "kind": "constant", - "valueType": { - "$id": "344", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "function", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFunction.type" - }, - { - "$id": "345", - "kind": "property", - "name": "function", - "serializedName": "function", - "type": { - "$id": "346", - "kind": "model", - "name": "FunctionObject", - "crossLanguageDefinitionId": "OpenAI.FunctionObject", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "347", - "kind": "property", - "name": "description", - "serializedName": "description", - "description": "A description of what the function does, used by the model to choose when and how to call the function.", - "type": { - "$id": "348", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.FunctionObject.description" - }, - { - "$id": "349", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", - "type": { - "$id": "350", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.FunctionObject.name" - }, - { - "$id": "351", - "kind": "property", - "name": "parameters", - "serializedName": "parameters", - "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\n\nOmitting `parameters` defines a function with an empty parameter list.", - "type": { - "$id": "352", - "kind": "unknown", - "name": "unknown", - "crossLanguageDefinitionId": "", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.FunctionObject.parameters" - }, - { - "$id": "353", - "kind": "property", - "name": "strict", - "serializedName": "strict", - "description": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).", - "type": { - "$id": "354", - "kind": "nullable", - "type": { - "$id": "355", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.FunctionObject.strict" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFunction.function" - } - ] - } - } - }, - "properties": [ - { - "$id": "356", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of tool being defined: `code_interpreter`", - "type": { - "$id": "357", - "kind": "constant", - "valueType": { - "$id": "358", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "code_interpreter", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolsCode.type" - } - ] - }, - { - "$id": "359", - "kind": "model", - "name": "AssistantToolsFileSearchTypeOnly", - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearchTypeOnly", - "usage": "Input,Output,Json", - "decorators": [], - "properties": [ - { - "$id": "360", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of tool being defined: `file_search`", - "type": { - "$id": "361", - "kind": "constant", - "valueType": { - "$ref": "14" - }, - "value": "file_search", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AssistantToolsFileSearchTypeOnly.type" - } - ] - } - ], - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.attachment.anonymous.tools" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.attachments" - }, - { - "$id": "362", - "kind": "property", - "name": "metadata", - "serializedName": "metadata", - "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.", - "type": { - "$id": "363", - "kind": "dict", - "keyType": { - "$id": "364", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "365", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateMessageRequest.metadata" - } - ] - }, - { - "$ref": "313" - }, - { - "$ref": "317" - }, - { - "$ref": "323" - }, - { - "$ref": "324" - }, - { - "$ref": "328" - }, - { - "$ref": "333" - }, - { - "$ref": "337" - }, - { - "$ref": "341" - }, - { - "$ref": "346" - }, - { - "$ref": "359" - }, - { - "$id": "366", - "kind": "model", - "name": "MessageObject", - "crossLanguageDefinitionId": "OpenAI.MessageObject", - "usage": "Output,Json", - "description": "Represents a message within a [thread](/docs/api-reference/threads).", - "decorators": [], - "properties": [ - { - "$id": "367", - "kind": "property", - "name": "id", - "serializedName": "id", - "description": "The identifier, which can be referenced in API endpoints.", - "type": { - "$id": "368", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.id" - }, - { - "$id": "369", - "kind": "property", - "name": "object", - "serializedName": "object", - "description": "The object type, which is always `thread.message`.", - "type": { - "$id": "370", - "kind": "constant", - "valueType": { - "$ref": "17" - }, - "value": "thread.message", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.object" - }, - { - "$id": "371", - "kind": "property", - "name": "created_at", - "serializedName": "created_at", - "description": "The Unix timestamp (in seconds) for when the message was created.", - "type": { - "$id": "372", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "unixTimestamp", - "wireType": { - "$id": "373", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.created_at" - }, - { - "$id": "374", - "kind": "property", - "name": "thread_id", - "serializedName": "thread_id", - "description": "The [thread](/docs/api-reference/threads) ID that this message belongs to.", - "type": { - "$id": "375", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.thread_id" - }, - { - "$id": "376", - "kind": "property", - "name": "status", - "serializedName": "status", - "description": "The status of the message, which can be either `in_progress`, `incomplete`, or `completed`.", - "type": { - "$ref": "20" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.status" - }, - { - "$id": "377", - "kind": "property", - "name": "incomplete_details", - "serializedName": "incomplete_details", - "description": "On an incomplete message, details about why the message is incomplete.", - "type": { - "$id": "378", - "kind": "nullable", - "type": { - "$id": "379", - "kind": "model", - "name": "MessageObjectIncompleteDetails", - "crossLanguageDefinitionId": "OpenAI.MessageObject.incomplete_details.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "380", - "kind": "property", - "name": "reason", - "serializedName": "reason", - "description": "The reason the message is incomplete.", - "type": { - "$ref": "28" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.incomplete_details.anonymous.reason" - } - ] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.incomplete_details" - }, - { - "$id": "381", - "kind": "property", - "name": "completed_at", - "serializedName": "completed_at", - "description": "The Unix timestamp (in seconds) for when the message was completed.", - "type": { - "$id": "382", - "kind": "nullable", - "type": { - "$id": "383", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "unixTimestamp", - "wireType": { - "$id": "384", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.completed_at" - }, - { - "$id": "385", - "kind": "property", - "name": "incomplete_at", - "serializedName": "incomplete_at", - "description": "The Unix timestamp (in seconds) for when the message was marked as incomplete.", - "type": { - "$id": "386", - "kind": "nullable", - "type": { - "$id": "387", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "unixTimestamp", - "wireType": { - "$id": "388", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.incomplete_at" - }, - { - "$id": "389", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The entity that produced the message. One of `user` or `assistant`.", - "type": { - "$ref": "40" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.role" - }, - { - "$id": "390", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The content of the message in array of text and/or images.", - "type": { - "$id": "391", - "kind": "array", - "name": "ArrayMessageContent", - "valueType": { - "$ref": "313" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": true, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.content" - }, - { - "$id": "392", - "kind": "property", - "name": "assistant_id", - "serializedName": "assistant_id", - "description": "If applicable, the ID of the [assistant](/docs/api-reference/assistants) that authored this message.", - "type": { - "$id": "393", - "kind": "nullable", - "type": { - "$id": "394", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.assistant_id" - }, - { - "$id": "395", - "kind": "property", - "name": "run_id", - "serializedName": "run_id", - "description": "The ID of the [run](/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints.", - "type": { - "$id": "396", - "kind": "nullable", - "type": { - "$id": "397", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.run_id" - }, - { - "$id": "398", - "kind": "property", - "name": "attachments", - "serializedName": "attachments", - "description": "A list of files attached to the message, and the tools they were added to.", - "type": { - "$id": "399", - "kind": "nullable", - "type": { - "$id": "400", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "401", - "kind": "model", - "name": "MessageObjectAttachment", - "crossLanguageDefinitionId": "OpenAI.MessageObject.attachment.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "402", - "kind": "property", - "name": "file_id", - "serializedName": "file_id", - "description": "The ID of the file to attach to the message.", - "type": { - "$id": "403", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.attachment.anonymous.file_id" - }, - { - "$id": "404", - "kind": "property", - "name": "tools", - "serializedName": "tools", - "description": "The tools to add this file to.", - "type": { - "$id": "405", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "406", - "kind": "union", - "name": "MessageObjectAttachmentTool", - "variantTypes": [ - { - "$ref": "323" - }, - { - "$ref": "359" - } - ], - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.attachment.anonymous.tools" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.attachments" - }, - { - "$id": "407", - "kind": "property", - "name": "metadata", - "serializedName": "metadata", - "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.", - "type": { - "$id": "408", - "kind": "nullable", - "type": { - "$id": "409", - "kind": "dict", - "keyType": { - "$id": "410", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "411", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "decorators": [] - } - }, - "optional": false, - "readOnly": true, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.MessageObject.metadata" - } - ] - }, - { - "$ref": "379" - }, - { - "$ref": "401" - }, - { - "$id": "412", - "kind": "model", - "name": "ErrorResponse", - "crossLanguageDefinitionId": "OpenAI.ErrorResponse", - "usage": "Error,Json,Exception", - "decorators": [], - "properties": [ - { - "$id": "413", - "kind": "property", - "name": "error", - "serializedName": "error", - "type": { - "$id": "414", - "kind": "model", - "name": "Error", - "crossLanguageDefinitionId": "OpenAI.Error", - "usage": "Json,Exception", - "decorators": [], - "properties": [ - { - "$id": "415", - "kind": "property", - "name": "code", - "serializedName": "code", - "type": { - "$id": "416", - "kind": "nullable", - "type": { - "$id": "417", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.Error.code" - }, - { - "$id": "418", - "kind": "property", - "name": "message", - "serializedName": "message", - "type": { - "$id": "419", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.Error.message" - }, - { - "$id": "420", - "kind": "property", - "name": "param", - "serializedName": "param", - "type": { - "$id": "421", - "kind": "nullable", - "type": { - "$id": "422", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.Error.param" - }, - { - "$id": "423", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "424", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.Error.type" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ErrorResponse.error" - } - ] - }, - { - "$ref": "414" - }, - { - "$id": "425", - "kind": "model", - "name": "CreateImageRequest", - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "426", - "kind": "property", - "name": "prompt", - "serializedName": "prompt", - "description": "A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.", - "type": { - "$id": "427", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.prompt" - }, - { - "$id": "428", - "kind": "property", - "name": "model", - "serializedName": "model", - "description": "The model to use for image generation.", - "type": { - "$id": "429", - "kind": "nullable", - "type": { - "$ref": "46" - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.model" - }, - { - "$id": "430", - "kind": "property", - "name": "n", - "serializedName": "n", - "description": "The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.", - "type": { - "$id": "431", - "kind": "nullable", - "type": { - "$id": "432", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.n" - }, - { - "$id": "433", - "kind": "property", - "name": "quality", - "serializedName": "quality", - "description": "The quality of the image that will be generated. `hd` creates images with finer details and greater consistency across the image. This param is only supported for `dall-e-3`.", - "type": { - "$ref": "52" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.quality" - }, - { - "$id": "434", - "kind": "property", - "name": "response_format", - "serializedName": "response_format", - "description": "The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated.", - "type": { - "$id": "435", - "kind": "nullable", - "type": { - "$ref": "58" - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.response_format" - }, - { - "$id": "436", - "kind": "property", - "name": "size", - "serializedName": "size", - "description": "The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models.", - "type": { - "$id": "437", - "kind": "nullable", - "type": { - "$ref": "64" - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.size" - }, - { - "$id": "438", - "kind": "property", - "name": "style", - "serializedName": "style", - "description": "The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`.", - "type": { - "$id": "439", - "kind": "nullable", - "type": { - "$ref": "76" - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.style" - }, - { - "$id": "440", - "kind": "property", - "name": "user", - "serializedName": "user", - "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).", - "type": { - "$id": "441", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateImageRequest.user" - } - ] - }, - { - "$id": "442", - "kind": "model", - "name": "ImagesResponse", - "crossLanguageDefinitionId": "OpenAI.ImagesResponse", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "443", - "kind": "property", - "name": "created", - "serializedName": "created", - "type": { - "$id": "444", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "unixTimestamp", - "wireType": { - "$id": "445", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ImagesResponse.created" - }, - { - "$id": "446", - "kind": "property", - "name": "data", - "serializedName": "data", - "type": { - "$id": "447", - "kind": "array", - "name": "ArrayImage", - "valueType": { - "$id": "448", - "kind": "model", - "name": "Image", - "crossLanguageDefinitionId": "OpenAI.Image", - "usage": "Output,Json", - "description": "Represents the url or the content of an image generated by the OpenAI API.", - "decorators": [], - "properties": [ - { - "$id": "449", - "kind": "property", - "name": "b64_json", - "serializedName": "b64_json", - "description": "The base64-encoded JSON of the generated image, if `response_format` is `b64_json`.", - "type": { - "$id": "450", - "kind": "bytes", - "name": "bytes", - "encode": "base64", - "crossLanguageDefinitionId": "TypeSpec.bytes", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.Image.b64_json" - }, - { - "$id": "451", - "kind": "property", - "name": "url", - "serializedName": "url", - "description": "The URL of the generated image, if `response_format` is `url` (default).", - "type": { - "$id": "452", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.Image.url" - }, - { - "$id": "453", - "kind": "property", - "name": "revised_prompt", - "serializedName": "revised_prompt", - "description": "The prompt that was used to generate the image, if there was any revision to the prompt.", - "type": { - "$id": "454", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.Image.revised_prompt" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ImagesResponse.data" - } - ] - }, - { - "$ref": "448" - }, - { - "$id": "455", - "kind": "model", - "name": "AzureOpenAIDalleErrorResponse", - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleErrorResponse", - "access": "public", - "usage": "Output,Json", - "description": "A structured representation of an error an Azure OpenAI request.", - "decorators": [], - "properties": [ - { - "$id": "456", - "kind": "property", - "name": "error", - "serializedName": "error", - "type": { - "$id": "457", - "kind": "model", - "name": "AzureOpenAIDalleError", - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError", - "access": "public", - "usage": "Output,Json", - "description": "The structured representation of an error from an Azure OpenAI image generation request.", - "decorators": [], - "properties": [ - { - "$id": "458", - "kind": "property", - "name": "code", - "serializedName": "code", - "description": "The distinct, machine-generated identifier for the error.", - "type": { - "$id": "459", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.code" - }, - { - "$id": "460", - "kind": "property", - "name": "message", - "serializedName": "message", - "description": "A human-readable message associated with the error.", - "type": { - "$id": "461", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.message" - }, - { - "$id": "462", - "kind": "property", - "name": "param", - "serializedName": "param", - "description": "If applicable, the request input parameter associated with the error", - "type": { - "$id": "463", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.param" - }, - { - "$id": "464", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "If applicable, the input line number associated with the error.", - "type": { - "$id": "465", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.type" - }, - { - "$id": "466", - "kind": "property", - "name": "inner_error", - "serializedName": "inner_error", - "description": "If applicable, an upstream error that originated this error.", - "type": { - "$id": "467", - "kind": "model", - "name": "AzureOpenAIDalleErrorInnerError", - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "468", - "kind": "property", - "name": "code", - "serializedName": "code", - "description": "The code associated with the inner error.", - "type": { - "$id": "469", - "kind": "constant", - "valueType": { - "$ref": "82" - }, - "value": "ResponsibleAIPolicyViolation", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error.anonymous.code" - }, - { - "$id": "470", - "kind": "property", - "name": "revised_prompt", - "serializedName": "revised_prompt", - "description": "If applicable, the modified prompt used for generation.", - "type": { - "$id": "471", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error.anonymous.revised_prompt" - }, - { - "$id": "472", - "kind": "property", - "name": "content_filter_results", - "serializedName": "content_filter_results", - "description": "The content filter result details associated with the inner error.", - "type": { - "$id": "473", - "kind": "model", - "name": "AzureContentFilterImagePromptResults", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImagePromptResults", - "usage": "Output,Json", - "description": "A content filter result for an image generation operation's input request content.", - "decorators": [], - "baseModel": { - "$id": "474", - "kind": "model", - "name": "AzureContentFilterImageResponseResults", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults", - "usage": "Output,Json", - "description": "A content filter result for an image generation operation's output response content.", - "decorators": [], - "properties": [ - { - "$id": "475", - "kind": "property", - "name": "sexual", - "serializedName": "sexual", - "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse.", - "type": { - "$id": "476", - "kind": "model", - "name": "AzureContentFilterSeverityResult", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterSeverityResult", - "usage": "Output,Json", - "description": "A labeled content filter result item that indicates whether the content was filtered and what the qualitative\nseverity level of the content was, as evaluated against content filter configuration for the category.", - "decorators": [], - "properties": [ - { - "$id": "477", - "kind": "property", - "name": "filtered", - "serializedName": "filtered", - "description": "Whether the content severity resulted in a content filtering action.", - "type": { - "$id": "478", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterSeverityResult.filtered" - }, - { - "$id": "479", - "kind": "property", - "name": "severity", - "serializedName": "severity", - "description": "The labeled severity of the content.", - "type": { - "$ref": "85" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterSeverityResult.severity" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults.sexual" - }, - { - "$id": "480", - "kind": "property", - "name": "violence", - "serializedName": "violence", - "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on.", - "type": { - "$ref": "476" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults.violence" - }, - { - "$id": "481", - "kind": "property", - "name": "hate", - "serializedName": "hate", - "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size.", - "type": { - "$ref": "476" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults.hate" - }, - { - "$id": "482", - "kind": "property", - "name": "self_harm", - "serializedName": "self_harm", - "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself.", - "type": { - "$ref": "476" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImageResponseResults.self_harm" - } - ] - }, - "properties": [ - { - "$id": "483", - "kind": "property", - "name": "profanity", - "serializedName": "profanity", - "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent.", - "type": { - "$id": "484", - "kind": "model", - "name": "AzureContentFilterDetectionResult", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterDetectionResult", - "usage": "Output,Json", - "description": "A labeled content filter result item that indicates whether the content was detected and whether the content was\nfiltered.", - "decorators": [], - "properties": [ - { - "$id": "485", - "kind": "property", - "name": "filtered", - "serializedName": "filtered", - "description": "Whether the content detection resulted in a content filtering action.", - "type": { - "$id": "486", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterDetectionResult.filtered" - }, - { - "$id": "487", - "kind": "property", - "name": "detected", - "serializedName": "detected", - "description": "Whether the labeled content category was detected in the content.", - "type": { - "$id": "488", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterDetectionResult.detected" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImagePromptResults.profanity" - }, - { - "$id": "489", - "kind": "property", - "name": "custom_blocklists", - "serializedName": "custom_blocklists", - "description": "A collection of binary filtering outcomes for configured custom blocklists.", - "type": { - "$id": "490", - "kind": "model", - "name": "AzureContentFilterBlocklistResult", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult", - "access": "public", - "usage": "Output,Json", - "description": "A collection of true/false filtering results for configured custom blocklists.", - "decorators": [], - "properties": [ - { - "$id": "491", - "kind": "property", - "name": "filtered", - "serializedName": "filtered", - "description": "A value indicating whether any of the detailed blocklists resulted in a filtering action.", - "type": { - "$id": "492", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.filtered" - }, - { - "$id": "493", - "kind": "property", - "name": "details", - "serializedName": "details", - "description": "The pairs of individual blocklist IDs and whether they resulted in a filtering action.", - "type": { - "$id": "494", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "495", - "kind": "model", - "name": "AzureContentFilterBlocklistResultDetail", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.detail.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "496", - "kind": "property", - "name": "filtered", - "serializedName": "filtered", - "description": "A value indicating whether the blocklist produced a filtering action.", - "type": { - "$id": "497", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.detail.anonymous.filtered" - }, - { - "$id": "498", - "kind": "property", - "name": "id", - "serializedName": "id", - "description": "The ID of the custom blocklist evaluated.", - "type": { - "$id": "499", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.detail.anonymous.id" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistResult.details" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImagePromptResults.custom_blocklists" - }, - { - "$id": "500", - "kind": "property", - "name": "jailbreak", - "serializedName": "jailbreak", - "description": "A detection result that describes user prompt injection attacks, where malicious users deliberately exploit\nsystem vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content\ngeneration or violations of system-imposed restrictions.", - "type": { - "$ref": "484" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterImagePromptResults.jailbreak" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error.anonymous.content_filter_results" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleError.inner_error" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIDalleErrorResponse.error" - } - ] - }, - { - "$ref": "457" - }, - { - "$ref": "467" - }, - { - "$ref": "473" - }, - { - "$ref": "484" - }, - { - "$ref": "490" - }, - { - "$ref": "495" - }, - { - "$ref": "474" - }, - { - "$ref": "476" - }, - { - "$id": "501", - "kind": "model", - "name": "AzureCreateChatCompletionRequest", - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest", - "usage": "Input,Json", - "description": "The extended request model for chat completions against the Azure OpenAI service.\nThis adds the ability to provide data sources for the On Your Data feature.", - "decorators": [], - "properties": [ - { - "$id": "502", - "kind": "property", - "name": "messages", - "serializedName": "messages", - "description": "A list of messages comprising the conversation so far. Depending on the\n[model](/docs/models) you use, different message types (modalities) are\nsupported, like [text](/docs/guides/text-generation),\n[images](/docs/guides/vision), and [audio](/docs/guides/audio).", - "type": { - "$id": "503", - "kind": "array", - "name": "ArrayChatCompletionRequestMessage", - "valueType": { - "$id": "504", - "kind": "model", - "name": "ChatCompletionRequestMessage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessage", - "usage": "Input,Json", - "decorators": [], - "discriminatorProperty": { - "$id": "505", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the author of this message.", - "type": { - "$id": "506", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessage.role" - }, - "properties": [ - { - "$ref": "505" - } - ], - "discriminatedSubtypes": { - "$id": "507", - "system": { - "$id": "508", - "kind": "model", - "name": "ChatCompletionRequestSystemMessage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestSystemMessage", - "usage": "Input,Json", - "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, use `developer` messages\nfor this purpose instead.", - "discriminatorValue": "system", - "decorators": [], - "baseModel": { - "$ref": "504" - }, - "properties": [ - { - "$id": "509", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The contents of the system message.", - "type": { - "$id": "510", - "kind": "union", - "name": "ChatCompletionRequestSystemMessageContent", - "variantTypes": [ - { - "$id": "511", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - { - "$id": "512", - "kind": "array", - "name": "ArrayChatCompletionRequestSystemMessageContentPart", - "valueType": { - "$id": "513", - "kind": "union", - "name": "ChatCompletionRequestSystemMessageContentPart", - "variantTypes": [ - { - "$id": "514", - "kind": "model", - "name": "ChatCompletionRequestMessageContentPartText", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartText", - "usage": "Input,Json", - "description": "Learn about [text inputs](/docs/guides/text-generation).", - "decorators": [], - "properties": [ - { - "$id": "515", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the content part.", - "type": { - "$id": "516", - "kind": "constant", - "valueType": { - "$ref": "95" - }, - "value": "text", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartText.type" - }, - { - "$id": "517", - "kind": "property", - "name": "text", - "serializedName": "text", - "description": "The text content.", - "type": { - "$id": "518", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartText.text" - } - ] - } - ], - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestSystemMessage.content" - }, - { - "$id": "519", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the messages author, in this case `system`.", - "type": { - "$id": "520", - "kind": "constant", - "valueType": { - "$id": "521", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "system", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestSystemMessage.role" - }, - { - "$id": "522", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", - "type": { - "$id": "523", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestSystemMessage.name" - } - ] - }, - "developer": { - "$id": "524", - "kind": "model", - "name": "ChatCompletionRequestDeveloperMessage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestDeveloperMessage", - "usage": "Input,Json", - "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, `developer` messages\nreplace the previous `system` messages.", - "discriminatorValue": "developer", - "decorators": [], - "baseModel": { - "$ref": "504" - }, - "properties": [ - { - "$id": "525", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The contents of the developer message.", - "type": { - "$id": "526", - "kind": "union", - "name": "ChatCompletionRequestDeveloperMessageContent", - "variantTypes": [ - { - "$id": "527", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - { - "$id": "528", - "kind": "array", - "name": "ArrayChatCompletionRequestMessageContentPartText", - "valueType": { - "$ref": "514" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestDeveloperMessage.content" - }, - { - "$id": "529", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the messages author, in this case `developer`.", - "type": { - "$id": "530", - "kind": "constant", - "valueType": { - "$id": "531", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "developer", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestDeveloperMessage.role" - }, - { - "$id": "532", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", - "type": { - "$id": "533", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestDeveloperMessage.name" - } - ] - }, - "user": { - "$id": "534", - "kind": "model", - "name": "ChatCompletionRequestUserMessage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestUserMessage", - "usage": "Input,Json", - "description": "Messages sent by an end user, containing prompts or additional context\ninformation.", - "discriminatorValue": "user", - "decorators": [], - "baseModel": { - "$ref": "504" - }, - "properties": [ - { - "$id": "535", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The contents of the user message.", - "type": { - "$id": "536", - "kind": "union", - "name": "ChatCompletionRequestUserMessageContent", - "variantTypes": [ - { - "$id": "537", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - { - "$id": "538", - "kind": "array", - "name": "ArrayChatCompletionRequestUserMessageContentPart", - "valueType": { - "$id": "539", - "kind": "union", - "name": "ChatCompletionRequestUserMessageContentPart", - "variantTypes": [ - { - "$ref": "514" - }, - { - "$id": "540", - "kind": "model", - "name": "ChatCompletionRequestMessageContentPartImage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage", - "usage": "Input,Json", - "description": "Learn about [image inputs](/docs/guides/vision).", - "decorators": [], - "properties": [ - { - "$id": "541", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the content part.", - "type": { - "$id": "542", - "kind": "constant", - "valueType": { - "$ref": "98" - }, - "value": "image_url", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.type" - }, - { - "$id": "543", - "kind": "property", - "name": "image_url", - "serializedName": "image_url", - "type": { - "$id": "544", - "kind": "model", - "name": "ChatCompletionRequestMessageContentPartImageImageUrl", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.image_url.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "545", - "kind": "property", - "name": "url", - "serializedName": "url", - "description": "Either a URL of the image or the base64 encoded image data.", - "type": { - "$id": "546", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.image_url.anonymous.url" - }, - { - "$id": "547", - "kind": "property", - "name": "detail", - "serializedName": "detail", - "description": "Specifies the detail level of the image. Learn more in the [Vision guide](/docs/guides/vision#low-or-high-fidelity-image-understanding).", - "type": { - "$ref": "101" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.image_url.anonymous.detail" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartImage.image_url" - } - ] - }, - { - "$id": "548", - "kind": "model", - "name": "ChatCompletionRequestMessageContentPartAudio", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio", - "usage": "Input,Json", - "description": "Learn about [audio inputs](/docs/guides/audio).", - "decorators": [], - "properties": [ - { - "$id": "549", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the content part. Always `input_audio`.", - "type": { - "$id": "550", - "kind": "constant", - "valueType": { - "$ref": "109" - }, - "value": "input_audio", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.type" - }, - { - "$id": "551", - "kind": "property", - "name": "input_audio", - "serializedName": "input_audio", - "type": { - "$id": "552", - "kind": "model", - "name": "ChatCompletionRequestMessageContentPartAudioInputAudio", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.input_audio.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "553", - "kind": "property", - "name": "data", - "serializedName": "data", - "description": "Base64 encoded audio data.", - "type": { - "$id": "554", - "kind": "bytes", - "name": "bytes", - "encode": "base64", - "crossLanguageDefinitionId": "TypeSpec.bytes", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.input_audio.anonymous.data" - }, - { - "$id": "555", - "kind": "property", - "name": "format", - "serializedName": "format", - "description": "The format of the encoded audio data. Currently supports \"wav\" and \"mp3\".", - "type": { - "$ref": "112" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.input_audio.anonymous.format" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartAudio.input_audio" - } - ] - } - ], - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestUserMessage.content" - }, - { - "$id": "556", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the messages author, in this case `user`.", - "type": { - "$id": "557", - "kind": "constant", - "valueType": { - "$id": "558", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "user", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestUserMessage.role" - }, - { - "$id": "559", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", - "type": { - "$id": "560", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestUserMessage.name" - } - ] - }, - "assistant": { - "$id": "561", - "kind": "model", - "name": "ChatCompletionRequestAssistantMessage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage", - "usage": "Input,Json", - "description": "Messages sent by the model in response to user messages.", - "discriminatorValue": "assistant", - "decorators": [], - "baseModel": { - "$ref": "504" - }, - "properties": [ - { - "$id": "562", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.", - "type": { - "$id": "563", - "kind": "nullable", - "type": { - "$id": "564", - "kind": "union", - "name": "ChatCompletionRequestAssistantMessageContent", - "variantTypes": [ - { - "$id": "565", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - { - "$id": "566", - "kind": "array", - "name": "ArrayChatCompletionRequestAssistantMessageContentPart", - "valueType": { - "$id": "567", - "kind": "union", - "name": "ChatCompletionRequestAssistantMessageContentPart", - "variantTypes": [ - { - "$ref": "514" - }, - { - "$id": "568", - "kind": "model", - "name": "ChatCompletionRequestMessageContentPartRefusal", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartRefusal", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "569", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the content part.", - "type": { - "$id": "570", - "kind": "constant", - "valueType": { - "$ref": "118" - }, - "value": "refusal", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartRefusal.type" - }, - { - "$id": "571", - "kind": "property", - "name": "refusal", - "serializedName": "refusal", - "description": "The refusal message generated by the model.", - "type": { - "$id": "572", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestMessageContentPartRefusal.refusal" - } - ] - } - ], - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - ], - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.content" - }, - { - "$id": "573", - "kind": "property", - "name": "refusal", - "serializedName": "refusal", - "description": "The refusal message by the assistant.", - "type": { - "$id": "574", - "kind": "nullable", - "type": { - "$id": "575", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.refusal" - }, - { - "$id": "576", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the messages author, in this case `assistant`.", - "type": { - "$id": "577", - "kind": "constant", - "valueType": { - "$id": "578", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "assistant", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.role" - }, - { - "$id": "579", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role.", - "type": { - "$id": "580", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.name" - }, - { - "$id": "581", - "kind": "property", - "name": "audio", - "serializedName": "audio", - "description": "Data about a previous audio response from the model.\n[Learn more](/docs/guides/audio).", - "type": { - "$id": "582", - "kind": "nullable", - "type": { - "$id": "583", - "kind": "model", - "name": "ChatCompletionRequestAssistantMessageAudio", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.audio.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "584", - "kind": "property", - "name": "id", - "serializedName": "id", - "description": "Unique identifier for a previous audio response from the model.", - "type": { - "$id": "585", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.audio.anonymous.id" - } - ] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.audio" - }, - { - "$id": "586", - "kind": "property", - "name": "tool_calls", - "serializedName": "tool_calls", - "type": { - "$id": "587", - "kind": "array", - "name": "ChatCompletionMessageToolCalls", - "valueType": { - "$id": "588", - "kind": "model", - "name": "ChatCompletionMessageToolCall", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall", - "usage": "Input,Output,Json", - "decorators": [], - "properties": [ - { - "$id": "589", - "kind": "property", - "name": "id", - "serializedName": "id", - "description": "The ID of the tool call.", - "type": { - "$id": "590", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.id" - }, - { - "$id": "591", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the tool. Currently, only `function` is supported.", - "type": { - "$id": "592", - "kind": "constant", - "valueType": { - "$ref": "121" - }, - "value": "function", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.type" - }, - { - "$id": "593", - "kind": "property", - "name": "function", - "serializedName": "function", - "description": "The function that the model called.", - "type": { - "$id": "594", - "kind": "model", - "name": "ChatCompletionMessageToolCallFunction", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.function.anonymous", - "usage": "Input,Output,Json", - "decorators": [], - "properties": [ - { - "$id": "595", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "The name of the function to call.", - "type": { - "$id": "596", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.function.anonymous.name" - }, - { - "$id": "597", - "kind": "property", - "name": "arguments", - "serializedName": "arguments", - "description": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.", - "type": { - "$id": "598", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.function.anonymous.arguments" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCall.function" - } - ] - }, - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCalls", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.tool_calls" - }, - { - "$id": "599", - "kind": "property", - "name": "function_call", - "serializedName": "function_call", - "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.", - "type": { - "$id": "600", - "kind": "nullable", - "type": { - "$id": "601", - "kind": "model", - "name": "ChatCompletionRequestAssistantMessageFunctionCall", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.function_call.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "602", - "kind": "property", - "name": "name", - "serializedName": "name", - "type": { - "$id": "603", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.function_call.anonymous.name" - }, - { - "$id": "604", - "kind": "property", - "name": "arguments", - "serializedName": "arguments", - "type": { - "$id": "605", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.function_call.anonymous.arguments" - } - ] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestAssistantMessage.function_call" - } - ] - }, - "tool": { - "$id": "606", - "kind": "model", - "name": "ChatCompletionRequestToolMessage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestToolMessage", - "usage": "Input,Json", - "discriminatorValue": "tool", - "decorators": [], - "baseModel": { - "$ref": "504" - }, - "properties": [ - { - "$id": "607", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the messages author, in this case `tool`.", - "type": { - "$id": "608", - "kind": "constant", - "valueType": { - "$id": "609", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "tool", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestToolMessage.role" - }, - { - "$id": "610", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The contents of the tool message.", - "type": { - "$id": "611", - "kind": "union", - "name": "ChatCompletionRequestToolMessageContent", - "variantTypes": [ - { - "$id": "612", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - { - "$id": "613", - "kind": "array", - "name": "ArrayChatCompletionRequestToolMessageContentPart", - "valueType": { - "$id": "614", - "kind": "union", - "name": "ChatCompletionRequestToolMessageContentPart", - "variantTypes": [ - { - "$ref": "514" - } - ], - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestToolMessage.content" - }, - { - "$id": "615", - "kind": "property", - "name": "tool_call_id", - "serializedName": "tool_call_id", - "description": "Tool call that this message is responding to.", - "type": { - "$id": "616", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestToolMessage.tool_call_id" - } - ] - }, - "function": { - "$id": "617", - "kind": "model", - "name": "ChatCompletionRequestFunctionMessage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestFunctionMessage", - "usage": "Input,Json", - "deprecation": "This field is marked as deprecated.", - "discriminatorValue": "function", - "decorators": [], - "baseModel": { - "$ref": "504" - }, - "properties": [ - { - "$id": "618", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the messages author, in this case `function`.", - "type": { - "$id": "619", - "kind": "constant", - "valueType": { - "$id": "620", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "function", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestFunctionMessage.role" - }, - { - "$id": "621", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The contents of the function message.", - "type": { - "$id": "622", - "kind": "nullable", - "type": { - "$id": "623", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestFunctionMessage.content" - }, - { - "$id": "624", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "The name of the function to call.", - "type": { - "$id": "625", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionRequestFunctionMessage.name" - } - ] - } - } - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.messages" - }, - { - "$id": "626", - "kind": "property", - "name": "store", - "serializedName": "store", - "description": "Whether or not to store the output of this chat completion request for\nuse in our [model distillation](/docs/guides/distillation) or\n[evals](/docs/guides/evals) products.", - "type": { - "$id": "627", - "kind": "nullable", - "type": { - "$id": "628", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.store" - }, - { - "$id": "629", - "kind": "property", - "name": "reasoning_effort", - "serializedName": "reasoning_effort", - "description": "**o1 models only** \n\nConstrains effort on reasoning for \n[reasoning models](https://platform.openai.com/docs/guides/reasoning).\nCurrently supported values are `low`, `medium`, and `high`. Reducing\nreasoning effort can result in faster responses and fewer tokens used\non reasoning in a response.", - "type": { - "$ref": "124" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.reasoning_effort" - }, - { - "$id": "630", - "kind": "property", - "name": "metadata", - "serializedName": "metadata", - "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.", - "type": { - "$id": "631", - "kind": "dict", - "keyType": { - "$id": "632", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "633", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.metadata" - }, - { - "$id": "634", - "kind": "property", - "name": "frequency_penalty", - "serializedName": "frequency_penalty", - "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\ntheir existing frequency in the text so far, decreasing the model's\nlikelihood to repeat the same line verbatim.", - "type": { - "$id": "635", - "kind": "nullable", - "type": { - "$id": "636", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.frequency_penalty" - }, - { - "$id": "637", - "kind": "property", - "name": "logit_bias", - "serializedName": "logit_bias", - "description": "Modify the likelihood of specified tokens appearing in the completion.\n\nAccepts a JSON object that maps tokens (specified by their token ID in the\ntokenizer) to an associated bias value from -100 to 100. Mathematically,\nthe bias is added to the logits generated by the model prior to sampling.\nThe exact effect will vary per model, but values between -1 and 1 should\ndecrease or increase likelihood of selection; values like -100 or 100\nshould result in a ban or exclusive selection of the relevant token.", - "type": { - "$id": "638", - "kind": "nullable", - "type": { - "$id": "639", - "kind": "dict", - "keyType": { - "$id": "640", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "641", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.logit_bias" - }, - { - "$id": "642", - "kind": "property", - "name": "logprobs", - "serializedName": "logprobs", - "description": "Whether to return log probabilities of the output tokens or not. If true,\nreturns the log probabilities of each output token returned in the\n`content` of `message`.", - "type": { - "$id": "643", - "kind": "nullable", - "type": { - "$id": "644", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.logprobs" - }, - { - "$id": "645", - "kind": "property", - "name": "top_logprobs", - "serializedName": "top_logprobs", - "description": "An integer between 0 and 20 specifying the number of most likely tokens to\nreturn at each token position, each with an associated log probability.\n`logprobs` must be set to `true` if this parameter is used.", - "type": { - "$id": "646", - "kind": "nullable", - "type": { - "$id": "647", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.top_logprobs" - }, - { - "$id": "648", - "kind": "property", - "name": "max_tokens", - "serializedName": "max_tokens", - "description": "The maximum number of [tokens](/tokenizer) that can be generated in the\nchat completion. This value can be used to control\n[costs](https://openai.com/api/pricing/) for text generated via API.\n\nThis value is now deprecated in favor of `max_completion_tokens`, and is\nnot compatible with [o1 series models](/docs/guides/reasoning).", - "type": { - "$id": "649", - "kind": "nullable", - "type": { - "$id": "650", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.max_tokens" - }, - { - "$id": "651", - "kind": "property", - "name": "max_completion_tokens", - "serializedName": "max_completion_tokens", - "description": "An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](/docs/guides/reasoning).", - "type": { - "$id": "652", - "kind": "nullable", - "type": { - "$id": "653", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.max_completion_tokens" - }, - { - "$id": "654", - "kind": "property", - "name": "n", - "serializedName": "n", - "description": "How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.", - "type": { - "$id": "655", - "kind": "nullable", - "type": { - "$id": "656", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.n" - }, - { - "$id": "657", - "kind": "property", - "name": "modalities", - "serializedName": "modalities", - "type": { - "$id": "658", - "kind": "nullable", - "type": { - "$id": "659", - "kind": "array", - "name": "ChatCompletionModalities", - "valueType": { - "$ref": "132" - }, - "crossLanguageDefinitionId": "OpenAI.ChatCompletionModalities", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.modalities" - }, - { - "$id": "660", - "kind": "property", - "name": "prediction", - "serializedName": "prediction", - "description": "Configuration for a [Predicted Output](/docs/guides/predicted-outputs),\nwhich can greatly improve response times when large parts of the model\nresponse are known ahead of time. This is most common when you are\nregenerating a file with only minor changes to most of the content.", - "type": { - "$id": "661", - "kind": "nullable", - "type": { - "$id": "662", - "kind": "model", - "name": "ChatOutputPrediction", - "crossLanguageDefinitionId": "OpenAI.ChatOutputPrediction", - "usage": "Input,Json", - "description": "Base representation of predicted output from a model.", - "decorators": [], - "discriminatorProperty": { - "$id": "663", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$ref": "138" - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatOutputPrediction.type" - }, - "properties": [ - { - "$ref": "663" - } - ], - "discriminatedSubtypes": { - "$id": "664", - "content": { - "$id": "665", - "kind": "model", - "name": "ChatOutputPredictionContent", - "crossLanguageDefinitionId": "OpenAI.ChatOutputPredictionContent", - "usage": "Input,Json", - "description": "Static predicted output content, such as the content of a text file that is\nbeing regenerated.", - "discriminatorValue": "content", - "decorators": [], - "baseModel": { - "$ref": "662" - }, - "properties": [ - { - "$id": "666", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the predicted content you want to provide. This type is\ncurrently always `content`.", - "type": { - "$id": "667", - "kind": "constant", - "valueType": { - "$id": "668", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "content", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatOutputPredictionContent.type" - }, - { - "$id": "669", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The content that should be matched when generating a model response.\nIf generated tokens would match this content, the entire model response\ncan be returned much more quickly.", - "type": { - "$id": "670", - "kind": "union", - "name": "ChatOutputPredictionContentContent", - "variantTypes": [ - { - "$id": "671", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - { - "$id": "672", - "kind": "array", - "name": "ArrayChatCompletionRequestMessageContentPartText", - "valueType": { - "$ref": "514" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatOutputPredictionContent.content" - } - ] - } - } - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.prediction" - }, - { - "$id": "673", - "kind": "property", - "name": "audio", - "serializedName": "audio", - "description": "Parameters for audio output. Required when audio output is requested with\n`modalities: [\"audio\"]`. [Learn more](/docs/guides/audio).", - "type": { - "$id": "674", - "kind": "nullable", - "type": { - "$id": "675", - "kind": "model", - "name": "AzureCreateChatCompletionRequestAudio", - "crossLanguageDefinitionId": "OpenAI.AzureCreateChatCompletionRequest.audio.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "676", - "kind": "property", - "name": "voice", - "serializedName": "voice", - "description": "The voice the model uses to respond. Supported voices are `ash`, `ballad`, `coral`, `sage`, and `verse` (also supported but not recommended are `alloy`, `echo`, and `shimmer`; these voices are less expressive).", - "type": { - "$ref": "142" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateChatCompletionRequestCommonBase.audio.anonymous.voice" - }, - { - "$id": "677", - "kind": "property", - "name": "format", - "serializedName": "format", - "description": "Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`,\n`opus`, or `pcm16`.", - "type": { - "$ref": "160" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CreateChatCompletionRequestCommonBase.audio.anonymous.format" - } - ] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.audio" - }, - { - "$id": "678", - "kind": "property", - "name": "presence_penalty", - "serializedName": "presence_penalty", - "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\nwhether they appear in the text so far, increasing the model's likelihood\nto talk about new topics.", - "type": { - "$id": "679", - "kind": "nullable", - "type": { - "$id": "680", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.presence_penalty" - }, - { - "$id": "681", - "kind": "property", - "name": "response_format", - "serializedName": "response_format", - "description": "An object specifying the format that the model must output.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\nStructured Outputs which ensures the model will match your supplied JSON\nschema. Learn more in the [Structured Outputs\nguide](/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures\nthe message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model\nto produce JSON yourself via a system or user message. Without this, the\nmodel may generate an unending stream of whitespace until the generation\nreaches the token limit, resulting in a long-running and seemingly \"stuck\"\nrequest. Also note that the message content may be partially cut off if\n`finish_reason=\"length\"`, which indicates the generation exceeded\n`max_tokens` or the conversation exceeded the max context length.", - "type": { - "$id": "682", - "kind": "model", - "name": "ChatResponseFormat", - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormat", - "usage": "Input,Json", - "decorators": [], - "discriminatorProperty": { - "$id": "683", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "684", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormat.type" - }, - "properties": [ - { - "$ref": "683" - } - ], - "discriminatedSubtypes": { - "$id": "685", - "text": { - "$id": "686", - "kind": "model", - "name": "ChatResponseFormatText", - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatText", - "usage": "Input,Json", - "discriminatorValue": "text", - "decorators": [], - "baseModel": { - "$ref": "682" - }, - "properties": [ - { - "$id": "687", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of response format being defined: `text`", - "type": { - "$id": "688", - "kind": "constant", - "valueType": { - "$id": "689", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "text", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatText.type" - } - ] - }, - "json_object": { - "$id": "690", - "kind": "model", - "name": "ChatResponseFormatJsonObject", - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonObject", - "usage": "Input,Json", - "discriminatorValue": "json_object", - "decorators": [], - "baseModel": { - "$ref": "682" - }, - "properties": [ - { - "$id": "691", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of response format being defined: `json_object`", - "type": { - "$id": "692", - "kind": "constant", - "valueType": { - "$id": "693", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "json_object", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonObject.type" - } - ] - }, - "json_schema": { - "$id": "694", - "kind": "model", - "name": "ChatResponseFormatJsonSchema", - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema", - "usage": "Input,Json", - "discriminatorValue": "json_schema", - "decorators": [], - "baseModel": { - "$ref": "682" - }, - "properties": [ - { - "$id": "695", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of response format being defined: `json_schema`", - "type": { - "$id": "696", - "kind": "constant", - "valueType": { - "$id": "697", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "json_schema", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.type" - }, - { - "$id": "698", - "kind": "property", - "name": "json_schema", - "serializedName": "json_schema", - "type": { - "$id": "699", - "kind": "model", - "name": "ChatResponseFormatJsonSchemaJsonSchema", - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "700", - "kind": "property", - "name": "description", - "serializedName": "description", - "description": "A description of what the response format is for, used by the model to determine how to respond in the format.", - "type": { - "$id": "701", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous.description" - }, - { - "$id": "702", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "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.", - "type": { - "$id": "703", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous.name" - }, - { - "$id": "704", - "kind": "property", - "name": "schema", - "serializedName": "schema", - "type": { - "$id": "705", - "kind": "model", - "name": "ResponseFormatJsonSchemaSchema", - "crossLanguageDefinitionId": "OpenAI.ResponseFormatJsonSchemaSchema", - "usage": "Input,Json", - "description": "The schema for the response format, described as a JSON Schema object.", - "decorators": [], - "additionalProperties": { - "$id": "706", - "kind": "unknown", - "name": "unknown", - "crossLanguageDefinitionId": "", - "decorators": [] - }, - "properties": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous.schema" - }, - { - "$id": "707", - "kind": "property", - "name": "strict", - "serializedName": "strict", - "description": "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](/docs/guides/structured-outputs).", - "type": { - "$id": "708", - "kind": "nullable", - "type": { - "$id": "709", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema.anonymous.strict" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatResponseFormatJsonSchema.json_schema" - } - ] - } - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.response_format" - }, - { - "$id": "710", - "kind": "property", - "name": "seed", - "serializedName": "seed", - "description": "This feature is in Beta.\nIf specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.", - "type": { - "$id": "711", - "kind": "nullable", - "type": { - "$id": "712", - "kind": "int64", - "name": "int64", - "crossLanguageDefinitionId": "TypeSpec.int64", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.seed" - }, - { - "$id": "713", - "kind": "property", - "name": "stop", - "serializedName": "stop", - "description": "Up to 4 sequences where the API will stop generating further tokens.", - "type": { - "$id": "714", - "kind": "nullable", - "type": { - "$id": "715", - "kind": "union", - "name": "AzureCreateChatCompletionRequestStop", - "variantTypes": [ - { - "$id": "716", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - { - "$id": "717", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "718", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - ], - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.stop" - }, - { - "$id": "719", - "kind": "property", - "name": "stream", - "serializedName": "stream", - "description": "If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).", - "type": { - "$id": "720", - "kind": "nullable", - "type": { - "$id": "721", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.stream" - }, - { - "$id": "722", - "kind": "property", - "name": "stream_options", - "serializedName": "stream_options", - "type": { - "$id": "723", - "kind": "nullable", - "type": { - "$id": "724", - "kind": "model", - "name": "ChatCompletionStreamOptions", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionStreamOptions", - "usage": "Input,Json", - "description": "Options for streaming response. Only set this when you set `stream: true`.", - "decorators": [], - "properties": [ - { - "$id": "725", - "kind": "property", - "name": "include_usage", - "serializedName": "include_usage", - "description": "If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.", - "type": { - "$id": "726", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionStreamOptions.include_usage" - } - ] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.stream_options" - }, - { - "$id": "727", - "kind": "property", - "name": "temperature", - "serializedName": "temperature", - "description": "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.\nWe generally recommend altering this or `top_p` but not both.", - "type": { - "$id": "728", - "kind": "nullable", - "type": { - "$id": "729", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.temperature" - }, - { - "$id": "730", - "kind": "property", - "name": "top_p", - "serializedName": "top_p", - "description": "An alternative to sampling with temperature, called nucleus sampling,\nwhere the model considers the results of the tokens with top_p probability\nmass. So 0.1 means only the tokens comprising the top 10% probability mass\nare considered.\n\nWe generally recommend altering this or `temperature` but not both.", - "type": { - "$id": "731", - "kind": "nullable", - "type": { - "$id": "732", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.top_p" - }, - { - "$id": "733", - "kind": "property", - "name": "tools", - "serializedName": "tools", - "description": "A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.", - "type": { - "$id": "734", - "kind": "array", - "name": "ArrayChatCompletionTool", - "valueType": { - "$id": "735", - "kind": "model", - "name": "ChatCompletionTool", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionTool", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "736", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the tool. Currently, only `function` is supported.", - "type": { - "$id": "737", - "kind": "constant", - "valueType": { - "$ref": "172" - }, - "value": "function", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionTool.type" - }, - { - "$id": "738", - "kind": "property", - "name": "function", - "serializedName": "function", - "type": { - "$ref": "346" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionTool.function" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.tools" - }, - { - "$id": "739", - "kind": "property", - "name": "tool_choice", - "serializedName": "tool_choice", - "type": { - "$id": "740", - "kind": "union", - "name": "ChatCompletionToolChoiceOption", - "variantTypes": [ - { - "$ref": "175" - }, - { - "$id": "741", - "kind": "model", - "name": "ChatCompletionNamedToolChoice", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice", - "usage": "Input,Json", - "description": "Specifies a tool the model should use. Use to force the model to call a specific function.", - "decorators": [], - "properties": [ - { - "$id": "742", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the tool. Currently, only `function` is supported.", - "type": { - "$id": "743", - "kind": "constant", - "valueType": { - "$ref": "183" - }, - "value": "function", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice.type" - }, - { - "$id": "744", - "kind": "property", - "name": "function", - "serializedName": "function", - "type": { - "$id": "745", - "kind": "model", - "name": "ChatCompletionNamedToolChoiceFunction", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice.function.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "746", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "The name of the function to call.", - "type": { - "$id": "747", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice.function.anonymous.name" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionNamedToolChoice.function" - } - ] - } - ], - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.tool_choice" - }, - { - "$id": "748", - "kind": "property", - "name": "parallel_tool_calls", - "serializedName": "parallel_tool_calls", - "type": { - "$id": "749", - "kind": "boolean", - "name": "ParallelToolCalls", - "crossLanguageDefinitionId": "OpenAI.ParallelToolCalls", - "baseType": { - "$id": "750", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.parallel_tool_calls" - }, - { - "$id": "751", - "kind": "property", - "name": "user", - "serializedName": "user", - "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).", - "type": { - "$id": "752", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.user" - }, - { - "$id": "753", - "kind": "property", - "name": "function_call", - "serializedName": "function_call", - "description": "Deprecated in favor of `tool_choice`.\n\nControls which (if any) function is called by the model.\n\n`none` means the model will not call a function and instead generates a\nmessage.\n\n`auto` means the model can pick between generating a message or calling a\nfunction.\n\nSpecifying a particular function via `{\"name\": \"my_function\"}` forces the\nmodel to call that function.\n\n`none` is the default when no functions are present. `auto` is the default\nif functions are present.", - "type": { - "$id": "754", - "kind": "union", - "name": "AzureCreateChatCompletionRequestFunctionCall", - "variantTypes": [ - { - "$id": "755", - "kind": "constant", - "valueType": { - "$id": "756", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "none", - "decorators": [] - }, - { - "$id": "757", - "kind": "constant", - "valueType": { - "$id": "758", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "auto", - "decorators": [] - }, - { - "$id": "759", - "kind": "model", - "name": "ChatCompletionFunctionCallOption", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctionCallOption", - "usage": "Input,Json", - "description": "Specifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function.", - "decorators": [], - "properties": [ - { - "$id": "760", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "The name of the function to call.", - "type": { - "$id": "761", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctionCallOption.name" - } - ] - } - ], - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.function_call" - }, - { - "$id": "762", - "kind": "property", - "name": "functions", - "serializedName": "functions", - "description": "Deprecated in favor of `tools`.\n\nA list of functions the model may generate JSON inputs for.", - "type": { - "$id": "763", - "kind": "array", - "name": "ArrayChatCompletionFunctions", - "valueType": { - "$id": "764", - "kind": "model", - "name": "ChatCompletionFunctions", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctions", - "usage": "Input,Json", - "deprecation": "This field is marked as deprecated.", - "decorators": [], - "properties": [ - { - "$id": "765", - "kind": "property", - "name": "description", - "serializedName": "description", - "description": "A description of what the function does, used by the model to choose when and how to call the function.", - "type": { - "$id": "766", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctions.description" - }, - { - "$id": "767", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", - "type": { - "$id": "768", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctions.name" - }, - { - "$id": "769", - "kind": "property", - "name": "parameters", - "serializedName": "parameters", - "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\n\nOmitting `parameters` defines a function with an empty parameter list.", - "type": { - "$id": "770", - "kind": "unknown", - "name": "unknown", - "crossLanguageDefinitionId": "", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionFunctions.parameters" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.functions" - }, - { - "$id": "771", - "kind": "property", - "name": "data_sources", - "serializedName": "data_sources", - "description": "The data sources to use for the On Your Data feature, exclusive to Azure OpenAI.", - "type": { - "$id": "772", - "kind": "array", - "name": "ArrayAzureChatDataSource", - "valueType": { - "$id": "773", - "kind": "model", - "name": "AzureChatDataSource", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSource", - "access": "public", - "usage": "Input,Json", - "description": "A representation of configuration data for a single Azure OpenAI chat data source.\nThis will be used by a chat completions request that should use Azure OpenAI chat extensions to augment the\nresponse behavior.\nThe use of this configuration is compatible only with Azure OpenAI.", - "decorators": [], - "discriminatorProperty": { - "$id": "774", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The differentiating type identifier for the data source.", - "type": { - "$id": "775", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSource.type" - }, - "properties": [ - { - "$ref": "774" - } - ], - "discriminatedSubtypes": { - "$id": "776", - "azure_search": { - "$id": "777", - "kind": "model", - "name": "AzureSearchChatDataSource", - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource", - "access": "public", - "usage": "Input,Json", - "description": "Represents a data source configuration that will use an Azure Search resource.", - "discriminatorValue": "azure_search", - "decorators": [], - "baseModel": { - "$ref": "773" - }, - "properties": [ - { - "$id": "778", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The discriminated type identifier, which is always 'azure_search'.", - "type": { - "$id": "779", - "kind": "constant", - "valueType": { - "$id": "780", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "azure_search", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.type" - }, - { - "$id": "781", - "kind": "property", - "name": "parameters", - "serializedName": "parameters", - "description": "The parameter information to control the use of the Azure Search data source.", - "type": { - "$id": "782", - "kind": "model", - "name": "AzureSearchChatDataSourceParameters", - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "783", - "kind": "property", - "name": "top_n_documents", - "serializedName": "top_n_documents", - "description": "The configured number of documents to feature in the query.", - "type": { - "$id": "784", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.top_n_documents" - }, - { - "$id": "785", - "kind": "property", - "name": "in_scope", - "serializedName": "in_scope", - "description": "Whether queries should be restricted to use of the indexed data.", - "type": { - "$id": "786", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.in_scope" - }, - { - "$id": "787", - "kind": "property", - "name": "strictness", - "serializedName": "strictness", - "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", - "type": { - "$id": "788", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.strictness" - }, - { - "$id": "789", - "kind": "property", - "name": "max_search_queries", - "serializedName": "max_search_queries", - "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", - "type": { - "$id": "790", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.max_search_queries" - }, - { - "$id": "791", - "kind": "property", - "name": "allow_partial_result", - "serializedName": "allow_partial_result", - "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", - "type": { - "$id": "792", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.allow_partial_result" - }, - { - "$id": "793", - "kind": "property", - "name": "include_contexts", - "serializedName": "include_contexts", - "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", - "type": { - "$id": "794", - "kind": "array", - "name": "Array", - "valueType": { - "$ref": "186" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.include_contexts" - }, - { - "$id": "795", - "kind": "property", - "name": "endpoint", - "serializedName": "endpoint", - "description": "The absolute endpoint path for the Azure Search resource to use.", - "type": { - "$id": "796", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.endpoint" - }, - { - "$id": "797", - "kind": "property", - "name": "index_name", - "serializedName": "index_name", - "description": "The name of the index to use, as specified in the Azure Search resource.", - "type": { - "$id": "798", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.index_name" - }, - { - "$id": "799", - "kind": "property", - "name": "authentication", - "serializedName": "authentication", - "description": "The authentication mechanism to use with Azure Search.", - "type": { - "$id": "800", - "kind": "union", - "name": "AzureSearchChatDataSourceParametersAuthentication", - "variantTypes": [ - { - "$id": "801", - "kind": "model", - "name": "AzureChatDataSourceApiKeyAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceApiKeyAuthenticationOptions", - "usage": "Input,Json", - "discriminatorValue": "api_key", - "decorators": [], - "baseModel": { - "$id": "802", - "kind": "model", - "name": "AzureChatDataSourceAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAuthenticationOptions", - "usage": "Input,Json", - "decorators": [], - "discriminatorProperty": { - "$id": "803", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "804", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAuthenticationOptions.type" - }, - "properties": [ - { - "$ref": "803" - } - ], - "discriminatedSubtypes": { - "$id": "805", - "api_key": { - "$ref": "801" - }, - "connection_string": { - "$id": "806", - "kind": "model", - "name": "AzureChatDataSourceConnectionStringAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceConnectionStringAuthenticationOptions", - "usage": "Input,Json", - "discriminatorValue": "connection_string", - "decorators": [], - "baseModel": { - "$ref": "802" - }, - "properties": [ - { - "$id": "807", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "808", - "kind": "constant", - "valueType": { - "$id": "809", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "connection_string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceConnectionStringAuthenticationOptions.type" - }, - { - "$id": "810", - "kind": "property", - "name": "connection_string", - "serializedName": "connection_string", - "type": { - "$id": "811", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceConnectionStringAuthenticationOptions.connection_string" - } - ] - }, - "system_assigned_managed_identity": { - "$id": "812", - "kind": "model", - "name": "AzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions", - "usage": "Input,Json", - "discriminatorValue": "system_assigned_managed_identity", - "decorators": [], - "baseModel": { - "$ref": "802" - }, - "properties": [ - { - "$id": "813", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "814", - "kind": "constant", - "valueType": { - "$id": "815", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "system_assigned_managed_identity", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.type" - } - ] - }, - "user_assigned_managed_identity": { - "$id": "816", - "kind": "model", - "name": "AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions", - "usage": "Input,Json", - "discriminatorValue": "user_assigned_managed_identity", - "decorators": [], - "baseModel": { - "$ref": "802" - }, - "properties": [ - { - "$id": "817", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "818", - "kind": "constant", - "valueType": { - "$id": "819", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "user_assigned_managed_identity", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.type" - }, - { - "$id": "820", - "kind": "property", - "name": "managed_identity_resource_id", - "serializedName": "managed_identity_resource_id", - "type": { - "$id": "821", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.managed_identity_resource_id" - } - ] - }, - "key_and_key_id": { - "$id": "822", - "kind": "model", - "name": "AzureChatDataSourceKeyAndKeyIdAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceKeyAndKeyIdAuthenticationOptions", - "usage": "Input,Json", - "discriminatorValue": "key_and_key_id", - "decorators": [], - "baseModel": { - "$ref": "802" - }, - "properties": [ - { - "$id": "823", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "824", - "kind": "constant", - "valueType": { - "$id": "825", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "key_and_key_id", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceKeyAndKeyIdAuthenticationOptions.type" - }, - { - "$id": "826", - "kind": "property", - "name": "key", - "serializedName": "key", - "type": { - "$id": "827", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceKeyAndKeyIdAuthenticationOptions.key" - }, - { - "$id": "828", - "kind": "property", - "name": "key_id", - "serializedName": "key_id", - "type": { - "$id": "829", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceKeyAndKeyIdAuthenticationOptions.key_id" - } - ] - }, - "encoded_api_key": { - "$id": "830", - "kind": "model", - "name": "AzureChatDataSourceEncodedApiKeyAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEncodedApiKeyAuthenticationOptions", - "usage": "Input,Json", - "discriminatorValue": "encoded_api_key", - "decorators": [], - "baseModel": { - "$ref": "802" - }, - "properties": [ - { - "$id": "831", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "832", - "kind": "constant", - "valueType": { - "$id": "833", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "encoded_api_key", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEncodedApiKeyAuthenticationOptions.type" - }, - { - "$id": "834", - "kind": "property", - "name": "encoded_api_key", - "serializedName": "encoded_api_key", - "type": { - "$id": "835", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEncodedApiKeyAuthenticationOptions.encoded_api_key" - } - ] - }, - "access_token": { - "$id": "836", - "kind": "model", - "name": "AzureChatDataSourceAccessTokenAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAccessTokenAuthenticationOptions", - "usage": "Input,Json", - "discriminatorValue": "access_token", - "decorators": [], - "baseModel": { - "$ref": "802" - }, - "properties": [ - { - "$id": "837", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "838", - "kind": "constant", - "valueType": { - "$id": "839", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "access_token", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAccessTokenAuthenticationOptions.type" - }, - { - "$id": "840", - "kind": "property", - "name": "access_token", - "serializedName": "access_token", - "type": { - "$id": "841", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceAccessTokenAuthenticationOptions.access_token" - } - ] - }, - "username_and_password": { - "$id": "842", - "kind": "model", - "name": "AzureChatDataSourceUsernameAndPasswordAuthenticationOptions", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUsernameAndPasswordAuthenticationOptions", - "usage": "Input,Json", - "discriminatorValue": "username_and_password", - "decorators": [], - "baseModel": { - "$ref": "802" - }, - "properties": [ - { - "$id": "843", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "844", - "kind": "constant", - "valueType": { - "$id": "845", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "username_and_password", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUsernameAndPasswordAuthenticationOptions.type" - }, - { - "$id": "846", - "kind": "property", - "name": "username", - "serializedName": "username", - "type": { - "$id": "847", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUsernameAndPasswordAuthenticationOptions.username" - }, - { - "$id": "848", - "kind": "property", - "name": "password", - "serializedName": "password", - "type": { - "$id": "849", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceUsernameAndPasswordAuthenticationOptions.password" - } - ] - } - } - }, - "properties": [ - { - "$id": "850", - "kind": "property", - "name": "type", - "serializedName": "type", - "type": { - "$id": "851", - "kind": "constant", - "valueType": { - "$id": "852", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "api_key", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceApiKeyAuthenticationOptions.type" - }, - { - "$id": "853", - "kind": "property", - "name": "key", - "serializedName": "key", - "type": { - "$id": "854", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceApiKeyAuthenticationOptions.key" - } - ] - }, - { - "$ref": "812" - }, - { - "$ref": "816" - }, - { - "$ref": "836" - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.authentication" - }, - { - "$id": "855", - "kind": "property", - "name": "fields_mapping", - "serializedName": "fields_mapping", - "description": "The field mappings to use with the Azure Search resource.", - "type": { - "$id": "856", - "kind": "model", - "name": "AzureSearchChatDataSourceParametersFieldsMapping", - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "857", - "kind": "property", - "name": "title_field", - "serializedName": "title_field", - "description": "The name of the index field to use as a title.", - "type": { - "$id": "858", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.title_field" - }, - { - "$id": "859", - "kind": "property", - "name": "url_field", - "serializedName": "url_field", - "description": "The name of the index field to use as a URL.", - "type": { - "$id": "860", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.url_field" - }, - { - "$id": "861", - "kind": "property", - "name": "filepath_field", - "serializedName": "filepath_field", - "description": "The name of the index field to use as a filepath.", - "type": { - "$id": "862", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.filepath_field" - }, - { - "$id": "863", - "kind": "property", - "name": "content_fields", - "serializedName": "content_fields", - "description": "The names of index fields that should be treated as content.", - "type": { - "$id": "864", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "865", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.content_fields" - }, - { - "$id": "866", - "kind": "property", - "name": "content_fields_separator", - "serializedName": "content_fields_separator", - "description": "The separator pattern that content fields should use.", - "type": { - "$id": "867", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" - }, - { - "$id": "868", - "kind": "property", - "name": "vector_fields", - "serializedName": "vector_fields", - "description": "The names of fields that represent vector data.", - "type": { - "$id": "869", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "870", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.vector_fields" - }, - { - "$id": "871", - "kind": "property", - "name": "image_vector_fields", - "serializedName": "image_vector_fields", - "description": "The names of fields that represent image vector data.", - "type": { - "$id": "872", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "873", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.fields_mapping.anonymous.image_vector_fields" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.fields_mapping" - }, - { - "$id": "874", - "kind": "property", - "name": "query_type", - "serializedName": "query_type", - "description": "The query type for the Azure Search resource to use.", - "type": { - "$ref": "194" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.query_type" - }, - { - "$id": "875", - "kind": "property", - "name": "semantic_configuration", - "serializedName": "semantic_configuration", - "description": "Additional semantic configuration for the query.", - "type": { - "$id": "876", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.semantic_configuration" - }, - { - "$id": "877", - "kind": "property", - "name": "filter", - "serializedName": "filter", - "description": "A filter to apply to the search.", - "type": { - "$id": "878", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.filter" - }, - { - "$id": "879", - "kind": "property", - "name": "embedding_dependency", - "serializedName": "embedding_dependency", - "description": "The vectorization source to use with Azure Search.\nSupported sources for Azure Search include endpoint, deployment name, and integrated.", - "type": { - "$id": "880", - "kind": "model", - "name": "AzureChatDataSourceVectorizationSource", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceVectorizationSource", - "access": "public", - "usage": "Input,Json", - "description": "A representation of a data vectorization source usable as an embedding resource with a data source.", - "decorators": [], - "discriminatorProperty": { - "$id": "881", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The differentiating identifier for the concrete vectorization source.", - "type": { - "$id": "882", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceVectorizationSource.type" - }, - "properties": [ - { - "$ref": "881" - } - ], - "discriminatedSubtypes": { - "$id": "883", - "endpoint": { - "$id": "884", - "kind": "model", - "name": "AzureChatDataSourceEndpointVectorizationSource", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource", - "access": "public", - "usage": "Input,Json", - "description": "Represents a vectorization source that makes public service calls against an Azure OpenAI embedding model deployment.", - "discriminatorValue": "endpoint", - "decorators": [], - "baseModel": { - "$ref": "880" - }, - "properties": [ - { - "$id": "885", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type identifier, always 'endpoint' for this vectorization source type.", - "type": { - "$id": "886", - "kind": "constant", - "valueType": { - "$id": "887", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "endpoint", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource.type" - }, - { - "$id": "888", - "kind": "property", - "name": "endpoint", - "serializedName": "endpoint", - "description": "Specifies the resource endpoint URL from which embeddings should be retrieved.\nIt should be in the format of:\nhttps://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/embeddings.\nThe api-version query parameter is not allowed.", - "type": { - "$id": "889", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource.endpoint" - }, - { - "$id": "890", - "kind": "property", - "name": "authentication", - "serializedName": "authentication", - "description": "The authentication mechanism to use with the endpoint-based vectorization source.\nEndpoint authentication supports API key and access token mechanisms.", - "type": { - "$id": "891", - "kind": "union", - "name": "AzureChatDataSourceEndpointVectorizationSourceAuthentication", - "variantTypes": [ - { - "$ref": "801" - }, - { - "$ref": "836" - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource.authentication" - }, - { - "$id": "892", - "kind": "property", - "name": "dimensions", - "serializedName": "dimensions", - "description": "The number of dimensions to request on embeddings.\nOnly supported in 'text-embedding-3' and later models.", - "type": { - "$id": "893", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceEndpointVectorizationSource.dimensions" - } - ] - }, - "deployment_name": { - "$id": "894", - "kind": "model", - "name": "AzureChatDataSourceDeploymentNameVectorizationSource", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceDeploymentNameVectorizationSource", - "access": "public", - "usage": "Input,Json", - "description": "Represents a vectorization source that makes internal service calls against an Azure OpenAI embedding model\ndeployment. In contrast with the endpoint-based vectorization source, a deployment-name-based vectorization source\nmust be part of the same Azure OpenAI resource but can be used even in private networks.", - "discriminatorValue": "deployment_name", - "decorators": [], - "baseModel": { - "$ref": "880" - }, - "properties": [ - { - "$id": "895", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type identifier, always 'deployment_name' for this vectorization source type.", - "type": { - "$id": "896", - "kind": "constant", - "valueType": { - "$id": "897", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "deployment_name", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceDeploymentNameVectorizationSource.type" - }, - { - "$id": "898", - "kind": "property", - "name": "deployment_name", - "serializedName": "deployment_name", - "description": "The embedding model deployment to use for vectorization. This deployment must exist within the same Azure OpenAI\nresource as the model deployment being used for chat completions.", - "type": { - "$id": "899", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceDeploymentNameVectorizationSource.deployment_name" - }, - { - "$id": "900", - "kind": "property", - "name": "dimensions", - "serializedName": "dimensions", - "description": "The number of dimensions to request on embeddings.\nOnly supported in 'text-embedding-3' and later models.", - "type": { - "$id": "901", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceDeploymentNameVectorizationSource.dimensions" - } - ] - }, - "model_id": { - "$id": "902", - "kind": "model", - "name": "AzureChatDataSourceModelIdVectorizationSource", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceModelIdVectorizationSource", - "access": "public", - "usage": "Input,Json", - "description": "Represents a vectorization source that makes service calls based on a search service model ID.\nThis source type is currently only supported by Elasticsearch.", - "discriminatorValue": "model_id", - "decorators": [], - "baseModel": { - "$ref": "880" - }, - "properties": [ - { - "$id": "903", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type identifier, always 'model_id' for this vectorization source type.", - "type": { - "$id": "904", - "kind": "constant", - "valueType": { - "$id": "905", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "model_id", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceModelIdVectorizationSource.type" - }, - { - "$id": "906", - "kind": "property", - "name": "model_id", - "serializedName": "model_id", - "description": "The embedding model build ID to use for vectorization.", - "type": { - "$id": "907", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceModelIdVectorizationSource.model_id" - } - ] - }, - "integrated": { - "$id": "908", - "kind": "model", - "name": "AzureChatDataSourceIntegratedVectorizationSource", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceIntegratedVectorizationSource", - "usage": "Input,Json", - "description": "Represents an integrated vectorization source as defined within the supporting search resource.", - "discriminatorValue": "integrated", - "decorators": [], - "baseModel": { - "$ref": "880" - }, - "properties": [ - { - "$id": "909", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type identifier, always 'integrated' for this vectorization source type.", - "type": { - "$id": "910", - "kind": "constant", - "valueType": { - "$id": "911", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "integrated", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatDataSourceIntegratedVectorizationSource.type" - } - ] - } - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters.anonymous.embedding_dependency" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureSearchChatDataSource.parameters" - } - ] - }, - "azure_cosmos_db": { - "$id": "912", - "kind": "model", - "name": "AzureCosmosDBChatDataSource", - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource", - "access": "public", - "usage": "Input,Json", - "description": "Represents a data source configuration that will use an Azure CosmosDB resource.", - "discriminatorValue": "azure_cosmos_db", - "decorators": [], - "baseModel": { - "$ref": "773" - }, - "properties": [ - { - "$id": "913", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The discriminated type identifier, which is always 'azure_cosmos_db'.", - "type": { - "$id": "914", - "kind": "constant", - "valueType": { - "$id": "915", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "azure_cosmos_db", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.type" - }, - { - "$id": "916", - "kind": "property", - "name": "parameters", - "serializedName": "parameters", - "description": "The parameter information to control the use of the Azure CosmosDB data source.", - "type": { - "$id": "917", - "kind": "model", - "name": "AzureCosmosDBChatDataSourceParameters", - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "918", - "kind": "property", - "name": "top_n_documents", - "serializedName": "top_n_documents", - "description": "The configured number of documents to feature in the query.", - "type": { - "$id": "919", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.top_n_documents" - }, - { - "$id": "920", - "kind": "property", - "name": "in_scope", - "serializedName": "in_scope", - "description": "Whether queries should be restricted to use of the indexed data.", - "type": { - "$id": "921", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.in_scope" - }, - { - "$id": "922", - "kind": "property", - "name": "strictness", - "serializedName": "strictness", - "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", - "type": { - "$id": "923", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.strictness" - }, - { - "$id": "924", - "kind": "property", - "name": "max_search_queries", - "serializedName": "max_search_queries", - "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", - "type": { - "$id": "925", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.max_search_queries" - }, - { - "$id": "926", - "kind": "property", - "name": "allow_partial_result", - "serializedName": "allow_partial_result", - "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", - "type": { - "$id": "927", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.allow_partial_result" - }, - { - "$id": "928", - "kind": "property", - "name": "include_contexts", - "serializedName": "include_contexts", - "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", - "type": { - "$id": "929", - "kind": "array", - "name": "Array", - "valueType": { - "$ref": "186" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.include_contexts" - }, - { - "$id": "930", - "kind": "property", - "name": "container_name", - "serializedName": "container_name", - "type": { - "$id": "931", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.container_name" - }, - { - "$id": "932", - "kind": "property", - "name": "database_name", - "serializedName": "database_name", - "type": { - "$id": "933", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.database_name" - }, - { - "$id": "934", - "kind": "property", - "name": "embedding_dependency", - "serializedName": "embedding_dependency", - "type": { - "$ref": "880" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.embedding_dependency" - }, - { - "$id": "935", - "kind": "property", - "name": "index_name", - "serializedName": "index_name", - "type": { - "$id": "936", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.index_name" - }, - { - "$id": "937", - "kind": "property", - "name": "authentication", - "serializedName": "authentication", - "type": { - "$ref": "806" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.authentication" - }, - { - "$id": "938", - "kind": "property", - "name": "fields_mapping", - "serializedName": "fields_mapping", - "type": { - "$id": "939", - "kind": "model", - "name": "AzureCosmosDBChatDataSourceParametersFieldsMapping", - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "940", - "kind": "property", - "name": "content_fields", - "serializedName": "content_fields", - "type": { - "$id": "941", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "942", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.content_fields" - }, - { - "$id": "943", - "kind": "property", - "name": "vector_fields", - "serializedName": "vector_fields", - "type": { - "$id": "944", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "945", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.vector_fields" - }, - { - "$id": "946", - "kind": "property", - "name": "title_field", - "serializedName": "title_field", - "type": { - "$id": "947", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.title_field" - }, - { - "$id": "948", - "kind": "property", - "name": "url_field", - "serializedName": "url_field", - "type": { - "$id": "949", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.url_field" - }, - { - "$id": "950", - "kind": "property", - "name": "filepath_field", - "serializedName": "filepath_field", - "type": { - "$id": "951", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.filepath_field" - }, - { - "$id": "952", - "kind": "property", - "name": "content_fields_separator", - "serializedName": "content_fields_separator", - "type": { - "$id": "953", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters.anonymous.fields_mapping" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCosmosDBChatDataSource.parameters" - } - ] - }, - "elasticsearch": { - "$id": "954", - "kind": "model", - "name": "ElasticsearchChatDataSource", - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource", - "access": "public", - "usage": "Input,Json", - "discriminatorValue": "elasticsearch", - "decorators": [], - "baseModel": { - "$ref": "773" - }, - "properties": [ - { - "$id": "955", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The discriminated type identifier, which is always 'elasticsearch'.", - "type": { - "$id": "956", - "kind": "constant", - "valueType": { - "$id": "957", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "elasticsearch", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.type" - }, - { - "$id": "958", - "kind": "property", - "name": "parameters", - "serializedName": "parameters", - "description": "The parameter information to control the use of the Elasticsearch data source.", - "type": { - "$id": "959", - "kind": "model", - "name": "ElasticsearchChatDataSourceParameters", - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "960", - "kind": "property", - "name": "top_n_documents", - "serializedName": "top_n_documents", - "description": "The configured number of documents to feature in the query.", - "type": { - "$id": "961", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.top_n_documents" - }, - { - "$id": "962", - "kind": "property", - "name": "in_scope", - "serializedName": "in_scope", - "description": "Whether queries should be restricted to use of the indexed data.", - "type": { - "$id": "963", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.in_scope" - }, - { - "$id": "964", - "kind": "property", - "name": "strictness", - "serializedName": "strictness", - "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", - "type": { - "$id": "965", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.strictness" - }, - { - "$id": "966", - "kind": "property", - "name": "max_search_queries", - "serializedName": "max_search_queries", - "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", - "type": { - "$id": "967", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.max_search_queries" - }, - { - "$id": "968", - "kind": "property", - "name": "allow_partial_result", - "serializedName": "allow_partial_result", - "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", - "type": { - "$id": "969", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.allow_partial_result" - }, - { - "$id": "970", - "kind": "property", - "name": "include_contexts", - "serializedName": "include_contexts", - "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", - "type": { - "$id": "971", - "kind": "array", - "name": "Array", - "valueType": { - "$ref": "186" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.include_contexts" - }, - { - "$id": "972", - "kind": "property", - "name": "endpoint", - "serializedName": "endpoint", - "type": { - "$id": "973", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.endpoint" - }, - { - "$id": "974", - "kind": "property", - "name": "index_name", - "serializedName": "index_name", - "type": { - "$id": "975", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.index_name" - }, - { - "$id": "976", - "kind": "property", - "name": "authentication", - "serializedName": "authentication", - "type": { - "$id": "977", - "kind": "union", - "name": "ElasticsearchChatDataSourceParametersAuthentication", - "variantTypes": [ - { - "$ref": "822" - }, - { - "$ref": "830" - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.authentication" - }, - { - "$id": "978", - "kind": "property", - "name": "fields_mapping", - "serializedName": "fields_mapping", - "type": { - "$id": "979", - "kind": "model", - "name": "ElasticsearchChatDataSourceParametersFieldsMapping", - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "980", - "kind": "property", - "name": "title_field", - "serializedName": "title_field", - "type": { - "$id": "981", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.title_field" - }, - { - "$id": "982", - "kind": "property", - "name": "url_field", - "serializedName": "url_field", - "type": { - "$id": "983", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.url_field" - }, - { - "$id": "984", - "kind": "property", - "name": "filepath_field", - "serializedName": "filepath_field", - "type": { - "$id": "985", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.filepath_field" - }, - { - "$id": "986", - "kind": "property", - "name": "content_fields", - "serializedName": "content_fields", - "type": { - "$id": "987", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "988", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.content_fields" - }, - { - "$id": "989", - "kind": "property", - "name": "content_fields_separator", - "serializedName": "content_fields_separator", - "type": { - "$id": "990", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" - }, - { - "$id": "991", - "kind": "property", - "name": "vector_fields", - "serializedName": "vector_fields", - "type": { - "$id": "992", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "993", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.fields_mapping.anonymous.vector_fields" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.fields_mapping" - }, - { - "$id": "994", - "kind": "property", - "name": "query_type", - "serializedName": "query_type", - "type": { - "$ref": "206" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.query_type" - }, - { - "$id": "995", - "kind": "property", - "name": "embedding_dependency", - "serializedName": "embedding_dependency", - "type": { - "$ref": "880" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters.anonymous.embedding_dependency" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.ElasticsearchChatDataSource.parameters" - } - ] - }, - "pinecone": { - "$id": "996", - "kind": "model", - "name": "PineconeChatDataSource", - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource", - "access": "public", - "usage": "Input,Json", - "discriminatorValue": "pinecone", - "decorators": [], - "baseModel": { - "$ref": "773" - }, - "properties": [ - { - "$id": "997", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The discriminated type identifier, which is always 'pinecone'.", - "type": { - "$id": "998", - "kind": "constant", - "valueType": { - "$id": "999", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "pinecone", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.type" - }, - { - "$id": "1000", - "kind": "property", - "name": "parameters", - "serializedName": "parameters", - "description": "The parameter information to control the use of the Pinecone data source.", - "type": { - "$id": "1001", - "kind": "model", - "name": "PineconeChatDataSourceParameters", - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "1002", - "kind": "property", - "name": "top_n_documents", - "serializedName": "top_n_documents", - "description": "The configured number of documents to feature in the query.", - "type": { - "$id": "1003", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.top_n_documents" - }, - { - "$id": "1004", - "kind": "property", - "name": "in_scope", - "serializedName": "in_scope", - "description": "Whether queries should be restricted to use of the indexed data.", - "type": { - "$id": "1005", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.in_scope" - }, - { - "$id": "1006", - "kind": "property", - "name": "strictness", - "serializedName": "strictness", - "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", - "type": { - "$id": "1007", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.strictness" - }, - { - "$id": "1008", - "kind": "property", - "name": "max_search_queries", - "serializedName": "max_search_queries", - "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", - "type": { - "$id": "1009", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.max_search_queries" - }, - { - "$id": "1010", - "kind": "property", - "name": "allow_partial_result", - "serializedName": "allow_partial_result", - "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", - "type": { - "$id": "1011", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.allow_partial_result" - }, - { - "$id": "1012", - "kind": "property", - "name": "include_contexts", - "serializedName": "include_contexts", - "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", - "type": { - "$id": "1013", - "kind": "array", - "name": "Array", - "valueType": { - "$ref": "186" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.include_contexts" - }, - { - "$id": "1014", - "kind": "property", - "name": "environment", - "serializedName": "environment", - "description": "The environment name to use with Pinecone.", - "type": { - "$id": "1015", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.environment" - }, - { - "$id": "1016", - "kind": "property", - "name": "index_name", - "serializedName": "index_name", - "description": "The name of the Pinecone database index to use.", - "type": { - "$id": "1017", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.index_name" - }, - { - "$id": "1018", - "kind": "property", - "name": "authentication", - "serializedName": "authentication", - "description": "The authentication mechanism to use with Pinecone.\nSupported authentication mechanisms for Pinecone include: API key.", - "type": { - "$ref": "801" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.authentication" - }, - { - "$id": "1019", - "kind": "property", - "name": "embedding_dependency", - "serializedName": "embedding_dependency", - "description": "The vectorization source to use as an embedding dependency for the Pinecone data source.\nSupported vectorization sources for Pinecone include: deployment name.", - "type": { - "$ref": "880" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.embedding_dependency" - }, - { - "$id": "1020", - "kind": "property", - "name": "fields_mapping", - "serializedName": "fields_mapping", - "description": "Field mappings to apply to data used by the Pinecone data source.\nNote that content field mappings are required for Pinecone.", - "type": { - "$id": "1021", - "kind": "model", - "name": "PineconeChatDataSourceParametersFieldsMapping", - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "1022", - "kind": "property", - "name": "content_fields", - "serializedName": "content_fields", - "type": { - "$id": "1023", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "1024", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.content_fields" - }, - { - "$id": "1025", - "kind": "property", - "name": "title_field", - "serializedName": "title_field", - "type": { - "$id": "1026", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.title_field" - }, - { - "$id": "1027", - "kind": "property", - "name": "url_field", - "serializedName": "url_field", - "type": { - "$id": "1028", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.url_field" - }, - { - "$id": "1029", - "kind": "property", - "name": "filepath_field", - "serializedName": "filepath_field", - "type": { - "$id": "1030", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.filepath_field" - }, - { - "$id": "1031", - "kind": "property", - "name": "content_fields_separator", - "serializedName": "content_fields_separator", - "type": { - "$id": "1032", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters.anonymous.fields_mapping" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.PineconeChatDataSource.parameters" - } - ] - }, - "mongo_db": { - "$id": "1033", - "kind": "model", - "name": "MongoDBChatDataSource", - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource", - "usage": "Input,Json", - "discriminatorValue": "mongo_db", - "decorators": [], - "baseModel": { - "$ref": "773" - }, - "properties": [ - { - "$id": "1034", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The discriminated type identifier, which is always 'mongo_db'.", - "type": { - "$id": "1035", - "kind": "constant", - "valueType": { - "$id": "1036", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "mongo_db", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": true, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.type" - }, - { - "$id": "1037", - "kind": "property", - "name": "parameters", - "serializedName": "parameters", - "description": "The parameter information to control the use of the MongoDB data source.", - "type": { - "$id": "1038", - "kind": "model", - "name": "MongoDBChatDataSourceParameters", - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "1039", - "kind": "property", - "name": "top_n_documents", - "serializedName": "top_n_documents", - "description": "The configured number of documents to feature in the query.", - "type": { - "$id": "1040", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.top_n_documents" - }, - { - "$id": "1041", - "kind": "property", - "name": "in_scope", - "serializedName": "in_scope", - "description": "Whether queries should be restricted to use of the indexed data.", - "type": { - "$id": "1042", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.in_scope" - }, - { - "$id": "1043", - "kind": "property", - "name": "strictness", - "serializedName": "strictness", - "description": "The configured strictness of the search relevance filtering.\nHigher strictness will increase precision but lower recall of the answer.", - "type": { - "$id": "1044", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.strictness" - }, - { - "$id": "1045", - "kind": "property", - "name": "max_search_queries", - "serializedName": "max_search_queries", - "description": "The maximum number of rewritten queries that should be sent to the search provider for a single user message.\nBy default, the system will make an automatic determination.", - "type": { - "$id": "1046", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.max_search_queries" - }, - { - "$id": "1047", - "kind": "property", - "name": "allow_partial_result", - "serializedName": "allow_partial_result", - "description": "If set to true, the system will allow partial search results to be used and the request will fail if all\npartial queries fail. If not specified or specified as false, the request will fail if any search query fails.", - "type": { - "$id": "1048", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.allow_partial_result" - }, - { - "$id": "1049", - "kind": "property", - "name": "include_contexts", - "serializedName": "include_contexts", - "description": "The output context properties to include on the response.\nBy default, citations and intent will be requested.", - "type": { - "$id": "1050", - "kind": "array", - "name": "Array", - "valueType": { - "$ref": "186" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.include_contexts" - }, - { - "$id": "1051", - "kind": "property", - "name": "endpoint", - "serializedName": "endpoint", - "description": "The name of the MongoDB cluster endpoint.", - "type": { - "$id": "1052", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.endpoint" - }, - { - "$id": "1053", - "kind": "property", - "name": "database_name", - "serializedName": "database_name", - "description": "The name of the MongoDB database.", - "type": { - "$id": "1054", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.database_name" - }, - { - "$id": "1055", - "kind": "property", - "name": "collection_name", - "serializedName": "collection_name", - "description": "The name of the MongoDB collection.", - "type": { - "$id": "1056", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.collection_name" - }, - { - "$id": "1057", - "kind": "property", - "name": "app_name", - "serializedName": "app_name", - "description": "The name of the MongoDB application.", - "type": { - "$id": "1058", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.app_name" - }, - { - "$id": "1059", - "kind": "property", - "name": "index_name", - "serializedName": "index_name", - "description": "The name of the MongoDB index.", - "type": { - "$id": "1060", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.index_name" - }, - { - "$id": "1061", - "kind": "property", - "name": "authentication", - "serializedName": "authentication", - "description": "The authentication mechanism to use with Pinecone.\nSupported authentication mechanisms for Pinecone include: username and password.", - "type": { - "$ref": "842" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.authentication" - }, - { - "$id": "1062", - "kind": "property", - "name": "embedding_dependency", - "serializedName": "embedding_dependency", - "description": "The vectorization source to use as an embedding dependency for the MongoDB data source.\nSupported vectorization sources for MongoDB include: endpoint, deployment name.", - "type": { - "$id": "1063", - "kind": "union", - "name": "MongoDBChatDataSourceParametersEmbeddingDependency", - "variantTypes": [ - { - "$ref": "884" - }, - { - "$ref": "894" - } - ], - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.embedding_dependency" - }, - { - "$id": "1064", - "kind": "property", - "name": "fields_mapping", - "serializedName": "fields_mapping", - "description": "Field mappings to apply to data used by the MongoDB data source.\nNote that content and vector field mappings are required for MongoDB.", - "type": { - "$id": "1065", - "kind": "model", - "name": "MongoDBChatDataSourceParametersFieldsMapping", - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous", - "usage": "Input,Json", - "decorators": [], - "properties": [ - { - "$id": "1066", - "kind": "property", - "name": "content_fields", - "serializedName": "content_fields", - "type": { - "$id": "1067", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "1068", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.content_fields" - }, - { - "$id": "1069", - "kind": "property", - "name": "vector_fields", - "serializedName": "vector_fields", - "type": { - "$id": "1070", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "1071", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.vector_fields" - }, - { - "$id": "1072", - "kind": "property", - "name": "title_field", - "serializedName": "title_field", - "type": { - "$id": "1073", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.title_field" - }, - { - "$id": "1074", - "kind": "property", - "name": "url_field", - "serializedName": "url_field", - "type": { - "$id": "1075", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.url_field" - }, - { - "$id": "1076", - "kind": "property", - "name": "filepath_field", - "serializedName": "filepath_field", - "type": { - "$id": "1077", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.filepath_field" - }, - { - "$id": "1078", - "kind": "property", - "name": "content_fields_separator", - "serializedName": "content_fields_separator", - "type": { - "$id": "1079", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.fields_mapping.anonymous.content_fields_separator" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters.anonymous.fields_mapping" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.MongoDBChatDataSource.parameters" - } - ] - } - } - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.data_sources" - }, - { - "$id": "1080", - "kind": "property", - "name": "user_security_context", - "serializedName": "user_security_context", - "type": { - "$id": "1081", - "kind": "model", - "name": "AzureUserSecurityContext", - "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext", - "usage": "Input,Json", - "description": "User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud.", - "decorators": [], - "properties": [ - { - "$id": "1082", - "kind": "property", - "name": "application_name", - "serializedName": "application_name", - "description": "The name of the application. Sensitive personal information should not be included in this field.", - "type": { - "$id": "1083", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext.application_name" - }, - { - "$id": "1084", - "kind": "property", - "name": "end_user_id", - "serializedName": "end_user_id", - "description": "This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field.", - "type": { - "$id": "1085", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext.end_user_id" - }, - { - "$id": "1086", - "kind": "property", - "name": "end_user_tenant_id", - "serializedName": "end_user_tenant_id", - "description": "The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multitenant.", - "type": { - "$id": "1087", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext.end_user_tenant_id" - }, - { - "$id": "1088", - "kind": "property", - "name": "source_ip", - "serializedName": "source_ip", - "description": "Captures the original client's IP address.", - "type": { - "$id": "1089", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureUserSecurityContext.source_ip" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionRequest.user_security_context" - } - ] - }, - { - "$ref": "504" - }, - { - "$ref": "508" - }, - { - "$ref": "514" - }, - { - "$ref": "524" - }, - { - "$ref": "534" - }, - { - "$ref": "540" - }, - { - "$ref": "544" - }, - { - "$ref": "548" - }, - { - "$ref": "552" - }, - { - "$ref": "561" - }, - { - "$ref": "568" - }, - { - "$ref": "583" - }, - { - "$ref": "588" - }, - { - "$ref": "594" - }, - { - "$ref": "601" - }, - { - "$ref": "606" - }, - { - "$ref": "617" - }, - { - "$ref": "662" - }, - { - "$ref": "665" - }, - { - "$ref": "675" - }, - { - "$ref": "682" - }, - { - "$ref": "686" - }, - { - "$ref": "690" - }, - { - "$ref": "694" - }, - { - "$ref": "699" - }, - { - "$ref": "705" - }, - { - "$ref": "724" - }, - { - "$ref": "735" - }, - { - "$ref": "741" - }, - { - "$ref": "745" - }, - { - "$ref": "759" - }, - { - "$ref": "764" - }, - { - "$ref": "773" - }, - { - "$ref": "777" - }, - { - "$ref": "782" - }, - { - "$ref": "801" - }, - { - "$ref": "802" - }, - { - "$ref": "806" - }, - { - "$ref": "812" - }, - { - "$ref": "816" - }, - { - "$ref": "822" - }, - { - "$ref": "830" - }, - { - "$ref": "836" - }, - { - "$ref": "842" - }, - { - "$ref": "856" - }, - { - "$ref": "880" - }, - { - "$ref": "884" - }, - { - "$ref": "894" - }, - { - "$ref": "902" - }, - { - "$ref": "908" - }, - { - "$ref": "912" - }, - { - "$ref": "917" - }, - { - "$ref": "939" - }, - { - "$ref": "954" - }, - { - "$ref": "959" - }, - { - "$ref": "979" - }, - { - "$ref": "996" - }, - { - "$ref": "1001" - }, - { - "$ref": "1021" - }, - { - "$ref": "1033" - }, - { - "$ref": "1038" - }, - { - "$ref": "1065" - }, - { - "$ref": "1081" - }, - { - "$id": "1090", - "kind": "model", - "name": "AzureCreateChatCompletionResponse", - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse", - "usage": "Output,Json", - "description": "The extended top-level chat completion response model for the Azure OpenAI service.\nThis model adds Responsible AI content filter annotations for prompt input.", - "decorators": [], - "properties": [ - { - "$id": "1091", - "kind": "property", - "name": "id", - "serializedName": "id", - "description": "A unique identifier for the chat completion.", - "type": { - "$id": "1092", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.id" - }, - { - "$id": "1093", - "kind": "property", - "name": "created", - "serializedName": "created", - "description": "The Unix timestamp (in seconds) of when the chat completion was created.", - "type": { - "$id": "1094", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "unixTimestamp", - "wireType": { - "$id": "1095", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.created" - }, - { - "$id": "1096", - "kind": "property", - "name": "model", - "serializedName": "model", - "description": "The model used for the chat completion.", - "type": { - "$id": "1097", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.model" - }, - { - "$id": "1098", - "kind": "property", - "name": "service_tier", - "serializedName": "service_tier", - "description": "The service tier used for processing the request.", - "type": { - "$id": "1099", - "kind": "nullable", - "type": { - "$ref": "212" - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.service_tier" - }, - { - "$id": "1100", - "kind": "property", - "name": "system_fingerprint", - "serializedName": "system_fingerprint", - "description": "This fingerprint represents the backend configuration that the model runs with.\n\nCan be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.", - "type": { - "$id": "1101", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.system_fingerprint" - }, - { - "$id": "1102", - "kind": "property", - "name": "object", - "serializedName": "object", - "description": "The object type, which is always `chat.completion`.", - "type": { - "$id": "1103", - "kind": "constant", - "valueType": { - "$ref": "218" - }, - "value": "chat.completion", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.object" - }, - { - "$id": "1104", - "kind": "property", - "name": "usage", - "serializedName": "usage", - "type": { - "$id": "1105", - "kind": "model", - "name": "CompletionUsage", - "crossLanguageDefinitionId": "OpenAI.CompletionUsage", - "usage": "Output,Json", - "description": "Usage statistics for the completion request.", - "decorators": [], - "properties": [ - { - "$id": "1106", - "kind": "property", - "name": "completion_tokens", - "serializedName": "completion_tokens", - "description": "Number of tokens in the generated completion.", - "type": { - "$id": "1107", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CompletionUsage.completion_tokens" - }, - { - "$id": "1108", - "kind": "property", - "name": "prompt_tokens", - "serializedName": "prompt_tokens", - "description": "Number of tokens in the prompt.", - "type": { - "$id": "1109", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CompletionUsage.prompt_tokens" - }, - { - "$id": "1110", - "kind": "property", - "name": "total_tokens", - "serializedName": "total_tokens", - "description": "Total number of tokens used in the request (prompt + completion).", - "type": { - "$id": "1111", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CompletionUsage.total_tokens" - }, - { - "$id": "1112", - "kind": "property", - "name": "completion_tokens_details", - "serializedName": "completion_tokens_details", - "description": "Breakdown of tokens used in a completion.", - "type": { - "$id": "1113", - "kind": "model", - "name": "CompletionUsageCompletionTokensDetails", - "crossLanguageDefinitionId": "OpenAI.CompletionUsage.completion_tokens_details.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1114", - "kind": "property", - "name": "accepted_prediction_tokens", - "serializedName": "accepted_prediction_tokens", - "description": "When using Predicted Outputs, the number of tokens in the\nprediction that appeared in the completion.", - "type": { - "$id": "1115", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CompletionUsage.completion_tokens_details.anonymous.accepted_prediction_tokens" - }, - { - "$id": "1116", - "kind": "property", - "name": "audio_tokens", - "serializedName": "audio_tokens", - "description": "Audio input tokens generated by the model.", - "type": { - "$id": "1117", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CompletionUsage.completion_tokens_details.anonymous.audio_tokens" - }, - { - "$id": "1118", - "kind": "property", - "name": "reasoning_tokens", - "serializedName": "reasoning_tokens", - "description": "Tokens generated by the model for reasoning.", - "type": { - "$id": "1119", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CompletionUsage.completion_tokens_details.anonymous.reasoning_tokens" - }, - { - "$id": "1120", - "kind": "property", - "name": "rejected_prediction_tokens", - "serializedName": "rejected_prediction_tokens", - "description": "When using Predicted Outputs, the number of tokens in the\nprediction that did not appear in the completion. However, like\nreasoning tokens, these tokens are still counted in the total\ncompletion tokens for purposes of billing, output, and context window\nlimits.", - "type": { - "$id": "1121", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CompletionUsage.completion_tokens_details.anonymous.rejected_prediction_tokens" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CompletionUsage.completion_tokens_details" - }, - { - "$id": "1122", - "kind": "property", - "name": "prompt_tokens_details", - "serializedName": "prompt_tokens_details", - "description": "Breakdown of tokens used in the prompt.", - "type": { - "$id": "1123", - "kind": "model", - "name": "CompletionUsagePromptTokensDetails", - "crossLanguageDefinitionId": "OpenAI.CompletionUsage.prompt_tokens_details.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1124", - "kind": "property", - "name": "audio_tokens", - "serializedName": "audio_tokens", - "description": "Audio input tokens present in the prompt.", - "type": { - "$id": "1125", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CompletionUsage.prompt_tokens_details.anonymous.audio_tokens" - }, - { - "$id": "1126", - "kind": "property", - "name": "cached_tokens", - "serializedName": "cached_tokens", - "description": "Cached tokens present in the prompt.", - "type": { - "$id": "1127", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CompletionUsage.prompt_tokens_details.anonymous.cached_tokens" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.CompletionUsage.prompt_tokens_details" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.usage" - }, - { - "$id": "1128", - "kind": "property", - "name": "choices", - "serializedName": "choices", - "type": { - "$id": "1129", - "kind": "array", - "name": "ArrayAzureCreateChatCompletionResponseChoice", - "valueType": { - "$id": "1130", - "kind": "model", - "name": "AzureCreateChatCompletionResponseChoice", - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponseChoice", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1131", - "kind": "property", - "name": "finish_reason", - "serializedName": "finish_reason", - "description": "The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,\n`length` if the maximum number of tokens specified in the request was reached,\n`content_filter` if content was omitted due to a flag from our content filters,\n`tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.", - "type": { - "$ref": "221" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponseChoice.finish_reason" - }, - { - "$id": "1132", - "kind": "property", - "name": "index", - "serializedName": "index", - "description": "The index of the choice in the list of choices.", - "type": { - "$id": "1133", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponseChoice.index" - }, - { - "$id": "1134", - "kind": "property", - "name": "message", - "serializedName": "message", - "type": { - "$id": "1135", - "kind": "model", - "name": "ChatCompletionResponseMessage", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage", - "usage": "Output,Json", - "description": "A chat completion message generated by the model.", - "decorators": [], - "properties": [ - { - "$id": "1136", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The contents of the message.", - "type": { - "$id": "1137", - "kind": "nullable", - "type": { - "$id": "1138", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.content" - }, - { - "$id": "1139", - "kind": "property", - "name": "refusal", - "serializedName": "refusal", - "description": "The refusal message generated by the model.", - "type": { - "$id": "1140", - "kind": "nullable", - "type": { - "$id": "1141", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.refusal" - }, - { - "$id": "1142", - "kind": "property", - "name": "tool_calls", - "serializedName": "tool_calls", - "type": { - "$id": "1143", - "kind": "array", - "name": "ChatCompletionMessageToolCalls", - "valueType": { - "$ref": "588" - }, - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCalls", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.tool_calls" - }, - { - "$id": "1144", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the author of this message.", - "type": { - "$id": "1145", - "kind": "constant", - "valueType": { - "$ref": "233" - }, - "value": "assistant", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.role" - }, - { - "$id": "1146", - "kind": "property", - "name": "function_call", - "serializedName": "function_call", - "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.", - "type": { - "$id": "1147", - "kind": "model", - "name": "ChatCompletionResponseMessageFunctionCall", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.function_call.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1148", - "kind": "property", - "name": "name", - "serializedName": "name", - "type": { - "$id": "1149", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.function_call.anonymous.name" - }, - { - "$id": "1150", - "kind": "property", - "name": "arguments", - "serializedName": "arguments", - "type": { - "$id": "1151", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.function_call.anonymous.arguments" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.function_call" - }, - { - "$id": "1152", - "kind": "property", - "name": "audio", - "serializedName": "audio", - "description": "If the audio output modality is requested, this object contains data\nabout the audio response from the model. [Learn more](/docs/guides/audio).", - "type": { - "$id": "1153", - "kind": "nullable", - "type": { - "$id": "1154", - "kind": "model", - "name": "ChatCompletionResponseMessageAudio", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.audio.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1155", - "kind": "property", - "name": "id", - "serializedName": "id", - "description": "Unique identifier for this audio response.", - "type": { - "$id": "1156", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.audio.anonymous.id" - }, - { - "$id": "1157", - "kind": "property", - "name": "expires_at", - "serializedName": "expires_at", - "description": "The Unix timestamp (in seconds) for when this audio response will\nno longer be accessible on the server for use in multi-turn\nconversations.", - "type": { - "$id": "1158", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "unixTimestamp", - "wireType": { - "$id": "1159", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.audio.anonymous.expires_at" - }, - { - "$id": "1160", - "kind": "property", - "name": "data", - "serializedName": "data", - "description": "Base64 encoded audio bytes generated by the model, in the format\nspecified in the request.", - "type": { - "$id": "1161", - "kind": "bytes", - "name": "bytes", - "encode": "base64", - "crossLanguageDefinitionId": "TypeSpec.bytes", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.audio.anonymous.data" - }, - { - "$id": "1162", - "kind": "property", - "name": "transcript", - "serializedName": "transcript", - "description": "Transcript of the audio generated by the model.", - "type": { - "$id": "1163", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.audio.anonymous.transcript" - } - ] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionResponseMessage.audio" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponseChoice.message" - }, - { - "$id": "1164", - "kind": "property", - "name": "logprobs", - "serializedName": "logprobs", - "description": "Log probability information for the choice.", - "type": { - "$id": "1165", - "kind": "nullable", - "type": { - "$id": "1166", - "kind": "model", - "name": "AzureCreateChatCompletionResponseChoiceLogprobs", - "crossLanguageDefinitionId": "OpenAI.AzureCreateChatCompletionResponseChoice.logprobs.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1167", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "A list of message content tokens with log probability information.", - "type": { - "$id": "1168", - "kind": "nullable", - "type": { - "$id": "1169", - "kind": "array", - "name": "ArrayChatCompletionTokenLogprob", - "valueType": { - "$id": "1170", - "kind": "model", - "name": "ChatCompletionTokenLogprob", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1171", - "kind": "property", - "name": "token", - "serializedName": "token", - "description": "The token.", - "type": { - "$id": "1172", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob.token" - }, - { - "$id": "1173", - "kind": "property", - "name": "logprob", - "serializedName": "logprob", - "description": "The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.", - "type": { - "$id": "1174", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob.logprob" - }, - { - "$id": "1175", - "kind": "property", - "name": "bytes", - "serializedName": "bytes", - "description": "A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.", - "type": { - "$id": "1176", - "kind": "nullable", - "type": { - "$id": "1177", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "1178", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob.bytes" - }, - { - "$id": "1179", - "kind": "property", - "name": "top_logprobs", - "serializedName": "top_logprobs", - "description": "List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned.", - "type": { - "$id": "1180", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "1181", - "kind": "model", - "name": "ChatCompletionTokenLogprobTopLogprob", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob.top_logprob.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1182", - "kind": "property", - "name": "token", - "serializedName": "token", - "description": "The token.", - "type": { - "$id": "1183", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob.top_logprob.anonymous.token" - }, - { - "$id": "1184", - "kind": "property", - "name": "logprob", - "serializedName": "logprob", - "description": "The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.", - "type": { - "$id": "1185", - "kind": "float32", - "name": "float32", - "crossLanguageDefinitionId": "TypeSpec.float32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob.top_logprob.anonymous.logprob" - }, - { - "$id": "1186", - "kind": "property", - "name": "bytes", - "serializedName": "bytes", - "description": "A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.", - "type": { - "$id": "1187", - "kind": "nullable", - "type": { - "$id": "1188", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "1189", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob.top_logprob.anonymous.bytes" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionTokenLogprob.top_logprobs" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - }, - "optional": false, - "readOnly": true, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AzureCreateChatCompletionResponseChoice.logprobs.anonymous.content" - }, - { - "$id": "1190", - "kind": "property", - "name": "refusal", - "serializedName": "refusal", - "description": "A list of message refusal tokens with log probability information.", - "type": { - "$id": "1191", - "kind": "nullable", - "type": { - "$id": "1192", - "kind": "array", - "name": "ArrayChatCompletionTokenLogprob", - "valueType": { - "$ref": "1170" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - } - }, - "optional": false, - "readOnly": true, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AzureCreateChatCompletionResponseChoice.logprobs.anonymous.refusal" - } - ] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponseChoice.logprobs" - }, - { - "$id": "1193", - "kind": "property", - "name": "content_filter_results", - "serializedName": "content_filter_results", - "description": "The Responsible AI content filter annotations associated with the choice.", - "type": { - "$id": "1194", - "kind": "model", - "name": "AzureContentFilterResultForChoice", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice", - "access": "public", - "usage": "Output,Json", - "description": "A content filter result for a single response item produced by a generative AI system.", - "decorators": [], - "properties": [ - { - "$id": "1195", - "kind": "property", - "name": "sexual", - "serializedName": "sexual", - "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse.", - "type": { - "$ref": "476" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.sexual" - }, - { - "$id": "1196", - "kind": "property", - "name": "hate", - "serializedName": "hate", - "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size.", - "type": { - "$ref": "476" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.hate" - }, - { - "$id": "1197", - "kind": "property", - "name": "violence", - "serializedName": "violence", - "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on.", - "type": { - "$ref": "476" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.violence" - }, - { - "$id": "1198", - "kind": "property", - "name": "self_harm", - "serializedName": "self_harm", - "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself.", - "type": { - "$ref": "476" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.self_harm" - }, - { - "$id": "1199", - "kind": "property", - "name": "profanity", - "serializedName": "profanity", - "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent.", - "type": { - "$ref": "484" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.profanity" - }, - { - "$id": "1200", - "kind": "property", - "name": "custom_blocklists", - "serializedName": "custom_blocklists", - "description": "A collection of binary filtering outcomes for configured custom blocklists.", - "type": { - "$ref": "490" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.custom_blocklists" - }, - { - "$id": "1201", - "kind": "property", - "name": "error", - "serializedName": "error", - "description": "If present, details about an error that prevented content filtering from completing its evaluation.", - "type": { - "$id": "1202", - "kind": "model", - "name": "AzureContentFilterResultForChoiceError", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.error.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1203", - "kind": "property", - "name": "code", - "serializedName": "code", - "description": "A distinct, machine-readable code associated with the error.", - "type": { - "$id": "1204", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.error.anonymous.code" - }, - { - "$id": "1205", - "kind": "property", - "name": "message", - "serializedName": "message", - "description": "A human-readable message associated with the error.", - "type": { - "$id": "1206", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.error.anonymous.message" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.error" - }, - { - "$id": "1207", - "kind": "property", - "name": "protected_material_text", - "serializedName": "protected_material_text", - "description": "A detection result that describes a match against text protected under copyright or other status.", - "type": { - "$ref": "484" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_text" - }, - { - "$id": "1208", - "kind": "property", - "name": "protected_material_code", - "serializedName": "protected_material_code", - "description": "A detection result that describes a match against licensed code or other protected source material.", - "type": { - "$id": "1209", - "kind": "model", - "name": "AzureContentFilterResultForChoiceProtectedMaterialCode", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1210", - "kind": "property", - "name": "filtered", - "serializedName": "filtered", - "description": "Whether the content detection resulted in a content filtering action.", - "type": { - "$id": "1211", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.anonymous.filtered" - }, - { - "$id": "1212", - "kind": "property", - "name": "detected", - "serializedName": "detected", - "description": "Whether the labeled content category was detected in the content.", - "type": { - "$id": "1213", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.anonymous.detected" - }, - { - "$id": "1214", - "kind": "property", - "name": "citation", - "serializedName": "citation", - "description": "If available, the citation details describing the associated license and its location.", - "type": { - "$id": "1215", - "kind": "model", - "name": "AzureContentFilterResultForChoiceProtectedMaterialCodeCitation", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.citation.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1216", - "kind": "property", - "name": "license", - "serializedName": "license", - "description": "The name or identifier of the license associated with the detection.", - "type": { - "$id": "1217", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.citation.anonymous.license" - }, - { - "$id": "1218", - "kind": "property", - "name": "URL", - "serializedName": "URL", - "description": "The URL associated with the license.", - "type": { - "$id": "1219", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.citation.anonymous.URL" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code.anonymous.citation" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.protected_material_code" - }, - { - "$id": "1220", - "kind": "property", - "name": "ungrounded_material", - "serializedName": "ungrounded_material", - "type": { - "$id": "1221", - "kind": "model", - "name": "AzureContentFilterCompletionTextSpanDetectionResult", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpanDetectionResult", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1222", - "kind": "property", - "name": "filtered", - "serializedName": "filtered", - "description": "Whether the content detection resulted in a content filtering action.", - "type": { - "$id": "1223", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpanDetectionResult.filtered" - }, - { - "$id": "1224", - "kind": "property", - "name": "detected", - "serializedName": "detected", - "description": "Whether the labeled content category was detected in the content.", - "type": { - "$id": "1225", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpanDetectionResult.detected" - }, - { - "$id": "1226", - "kind": "property", - "name": "details", - "serializedName": "details", - "description": "Detailed information about the detected completion text spans.", - "type": { - "$id": "1227", - "kind": "array", - "name": "ArrayAzureContentFilterCompletionTextSpan", - "valueType": { - "$id": "1228", - "kind": "model", - "name": "AzureContentFilterCompletionTextSpan", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpan", - "usage": "Output,Json", - "description": "A representation of a span of completion text as used by Azure OpenAI content filter results.", - "decorators": [], - "properties": [ - { - "$id": "1229", - "kind": "property", - "name": "completion_start_offset", - "serializedName": "completion_start_offset", - "description": "Offset of the UTF32 code point which begins the span.", - "type": { - "$id": "1230", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpan.completion_start_offset" - }, - { - "$id": "1231", - "kind": "property", - "name": "completion_end_offset", - "serializedName": "completion_end_offset", - "description": "Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans.", - "type": { - "$id": "1232", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpan.completion_end_offset" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterCompletionTextSpanDetectionResult.details" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForChoice.ungrounded_material" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponseChoice.content_filter_results" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.choices" - }, - { - "$id": "1233", - "kind": "property", - "name": "prompt_filter_results", - "serializedName": "prompt_filter_results", - "description": "The Responsible AI content filter annotations associated with prompt inputs into chat completions.", - "type": { - "$id": "1234", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "1235", - "kind": "model", - "name": "AzureCreateChatCompletionResponsePromptFilterResult", - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.prompt_filter_result.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1236", - "kind": "property", - "name": "prompt_index", - "serializedName": "prompt_index", - "description": "The index of the input prompt that this content filter result corresponds to.", - "type": { - "$id": "1237", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.prompt_filter_result.anonymous.prompt_index" - }, - { - "$id": "1238", - "kind": "property", - "name": "content_filter_results", - "serializedName": "content_filter_results", - "description": "The content filter results associated with the indexed input prompt.", - "type": { - "$id": "1239", - "kind": "model", - "name": "AzureContentFilterResultForPrompt", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt", - "usage": "Output,Json", - "description": "A content filter result associated with a single input prompt item into a generative AI system.", - "decorators": [], - "properties": [ - { - "$id": "1240", - "kind": "property", - "name": "prompt_index", - "serializedName": "prompt_index", - "description": "The index of the input prompt associated with the accompanying content filter result categories.", - "type": { - "$id": "1241", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.prompt_index" - }, - { - "$id": "1242", - "kind": "property", - "name": "content_filter_results", - "serializedName": "content_filter_results", - "description": "The content filter category details for the result.", - "type": { - "$id": "1243", - "kind": "model", - "name": "AzureContentFilterResultForPromptContentFilterResults", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1244", - "kind": "property", - "name": "sexual", - "serializedName": "sexual", - "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse.", - "type": { - "$ref": "476" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.sexual" - }, - { - "$id": "1245", - "kind": "property", - "name": "hate", - "serializedName": "hate", - "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size.", - "type": { - "$ref": "476" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.hate" - }, - { - "$id": "1246", - "kind": "property", - "name": "violence", - "serializedName": "violence", - "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on.", - "type": { - "$ref": "476" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.violence" - }, - { - "$id": "1247", - "kind": "property", - "name": "self_harm", - "serializedName": "self_harm", - "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself.", - "type": { - "$ref": "476" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.self_harm" - }, - { - "$id": "1248", - "kind": "property", - "name": "profanity", - "serializedName": "profanity", - "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent.", - "type": { - "$ref": "484" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.profanity" - }, - { - "$id": "1249", - "kind": "property", - "name": "custom_blocklists", - "serializedName": "custom_blocklists", - "description": "A collection of binary filtering outcomes for configured custom blocklists.", - "type": { - "$ref": "490" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.custom_blocklists" - }, - { - "$id": "1250", - "kind": "property", - "name": "error", - "serializedName": "error", - "description": "If present, details about an error that prevented content filtering from completing its evaluation.", - "type": { - "$ref": "1202" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.error" - }, - { - "$id": "1251", - "kind": "property", - "name": "jailbreak", - "serializedName": "jailbreak", - "description": "A detection result that describes user prompt injection attacks, where malicious users deliberately exploit\nsystem vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content\ngeneration or violations of system-imposed restrictions.", - "type": { - "$ref": "484" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.jailbreak" - }, - { - "$id": "1252", - "kind": "property", - "name": "indirect_attack", - "serializedName": "indirect_attack", - "description": "A detection result that describes attacks on systems powered by Generative AI models that can happen every time\nan application processes information that wasn’t directly authored by either the developer of the application or\nthe user.", - "type": { - "$ref": "484" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results.anonymous.indirect_attack" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterResultForPrompt.content_filter_results" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.prompt_filter_result.anonymous.content_filter_results" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureCreateChatCompletionResponse.prompt_filter_results" - } - ] - }, - { - "$ref": "1105" - }, - { - "$ref": "1113" - }, - { - "$ref": "1123" - }, - { - "$ref": "1130" - }, - { - "$ref": "1135" - }, - { - "$ref": "1147" - }, - { - "$ref": "1154" - }, - { - "$ref": "1166" - }, - { - "$ref": "1170" - }, - { - "$ref": "1181" - }, - { - "$ref": "1194" - }, - { - "$ref": "1202" - }, - { - "$ref": "1209" - }, - { - "$ref": "1215" - }, - { - "$ref": "1221" - }, - { - "$ref": "1228" - }, - { - "$ref": "1235" - }, - { - "$ref": "1239" - }, - { - "$ref": "1243" - }, - { - "$id": "1253", - "kind": "model", - "name": "AzureChatCompletionStreamResponseDelta", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatCompletionStreamResponseDelta", - "usage": "Output,Json", - "description": "The extended response model for a streaming chat response message on the Azure OpenAI service.\nThis model adds support for chat message context, used by the On Your Data feature for intent, citations, and other\ninformation related to retrieval-augmented generation performed.", - "decorators": [], - "properties": [ - { - "$id": "1254", - "kind": "property", - "name": "audio", - "serializedName": "audio", - "description": "Response audio associated with the streaming chat delta payload.", - "type": { - "$id": "1255", - "kind": "model", - "name": "ChatCompletionMessageAudioChunk", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageAudioChunk", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1256", - "kind": "property", - "name": "id", - "serializedName": "id", - "type": { - "$id": "1257", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageAudioChunk.id" - }, - { - "$id": "1258", - "kind": "property", - "name": "transcript", - "serializedName": "transcript", - "type": { - "$id": "1259", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageAudioChunk.transcript" - }, - { - "$id": "1260", - "kind": "property", - "name": "data", - "serializedName": "data", - "type": { - "$id": "1261", - "kind": "bytes", - "name": "bytes", - "encode": "base64", - "crossLanguageDefinitionId": "TypeSpec.bytes", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageAudioChunk.data" - }, - { - "$id": "1262", - "kind": "property", - "name": "expires_at", - "serializedName": "expires_at", - "type": { - "$id": "1263", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "unixTimestamp", - "wireType": { - "$id": "1264", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageAudioChunk.expires_at" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatCompletionStreamResponseDelta.audio" - }, - { - "$id": "1265", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The contents of the chunk message.", - "type": { - "$id": "1266", - "kind": "nullable", - "type": { - "$id": "1267", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatCompletionStreamResponseDelta.content" - }, - { - "$id": "1268", - "kind": "property", - "name": "function_call", - "serializedName": "function_call", - "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.", - "type": { - "$id": "1269", - "kind": "model", - "name": "AzureChatCompletionStreamResponseDeltaFunctionCall", - "crossLanguageDefinitionId": "OpenAI.AzureChatCompletionStreamResponseDelta.function_call.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1270", - "kind": "property", - "name": "name", - "serializedName": "name", - "type": { - "$id": "1271", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AzureChatCompletionStreamResponseDelta.function_call.anonymous.name" - }, - { - "$id": "1272", - "kind": "property", - "name": "arguments", - "serializedName": "arguments", - "type": { - "$id": "1273", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.AzureChatCompletionStreamResponseDelta.function_call.anonymous.arguments" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatCompletionStreamResponseDelta.function_call" - }, - { - "$id": "1274", - "kind": "property", - "name": "tool_calls", - "serializedName": "tool_calls", - "type": { - "$id": "1275", - "kind": "array", - "name": "ArrayChatCompletionMessageToolCallChunk", - "valueType": { - "$id": "1276", - "kind": "model", - "name": "ChatCompletionMessageToolCallChunk", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCallChunk", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1277", - "kind": "property", - "name": "index", - "serializedName": "index", - "type": { - "$id": "1278", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCallChunk.index" - }, - { - "$id": "1279", - "kind": "property", - "name": "id", - "serializedName": "id", - "description": "The ID of the tool call.", - "type": { - "$id": "1280", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCallChunk.id" - }, - { - "$id": "1281", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "The type of the tool. Currently, only `function` is supported.", - "type": { - "$id": "1282", - "kind": "constant", - "valueType": { - "$ref": "236" - }, - "value": "function", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCallChunk.type" - }, - { - "$id": "1283", - "kind": "property", - "name": "function", - "serializedName": "function", - "type": { - "$id": "1284", - "kind": "model", - "name": "ChatCompletionMessageToolCallChunkFunction", - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCallChunk.function.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1285", - "kind": "property", - "name": "name", - "serializedName": "name", - "description": "The name of the function to call.", - "type": { - "$id": "1286", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCallChunk.function.anonymous.name" - }, - { - "$id": "1287", - "kind": "property", - "name": "arguments", - "serializedName": "arguments", - "description": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.", - "type": { - "$id": "1288", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCallChunk.function.anonymous.arguments" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "OpenAI.ChatCompletionMessageToolCallChunk.function" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatCompletionStreamResponseDelta.tool_calls" - }, - { - "$id": "1289", - "kind": "property", - "name": "role", - "serializedName": "role", - "description": "The role of the author of this message.", - "type": { - "$ref": "239" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatCompletionStreamResponseDelta.role" - }, - { - "$id": "1290", - "kind": "property", - "name": "refusal", - "serializedName": "refusal", - "description": "The refusal message generated by the model.", - "type": { - "$id": "1291", - "kind": "nullable", - "type": { - "$id": "1292", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - } - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatCompletionStreamResponseDelta.refusal" - }, - { - "$id": "1293", - "kind": "property", - "name": "context", - "serializedName": "context", - "description": "The Azure-specific context information associated with the chat completion response message.", - "type": { - "$id": "1294", - "kind": "model", - "name": "AzureChatMessageContext", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext", - "access": "public", - "usage": "Output,Json", - "description": "An additional property, added to chat completion response messages, produced by the Azure OpenAI service when using\nextension behavior. This includes intent and citation information from the On Your Data feature.", - "decorators": [], - "properties": [ - { - "$id": "1295", - "kind": "property", - "name": "intent", - "serializedName": "intent", - "description": "The detected intent from the chat history, which is used to carry conversation context between interactions", - "type": { - "$id": "1296", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.intent" - }, - { - "$id": "1297", - "kind": "property", - "name": "citations", - "serializedName": "citations", - "description": "The citations produced by the data retrieval.", - "type": { - "$id": "1298", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "1299", - "kind": "model", - "name": "AzureChatMessageContextCitation", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1300", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The content of the citation.", - "type": { - "$id": "1301", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.content" - }, - { - "$id": "1302", - "kind": "property", - "name": "title", - "serializedName": "title", - "description": "The title for the citation.", - "type": { - "$id": "1303", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.title" - }, - { - "$id": "1304", - "kind": "property", - "name": "url", - "serializedName": "url", - "description": "The URL of the citation.", - "type": { - "$id": "1305", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.url" - }, - { - "$id": "1306", - "kind": "property", - "name": "filepath", - "serializedName": "filepath", - "description": "The file path for the citation.", - "type": { - "$id": "1307", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.filepath" - }, - { - "$id": "1308", - "kind": "property", - "name": "chunk_id", - "serializedName": "chunk_id", - "description": "The chunk ID for the citation.", - "type": { - "$id": "1309", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.chunk_id" - }, - { - "$id": "1310", - "kind": "property", - "name": "rerank_score", - "serializedName": "rerank_score", - "description": "The rerank score for the retrieval.", - "type": { - "$id": "1311", - "kind": "float64", - "name": "float64", - "crossLanguageDefinitionId": "TypeSpec.float64", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citation.anonymous.rerank_score" - } - ] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.citations" - }, - { - "$id": "1312", - "kind": "property", - "name": "all_retrieved_documents", - "serializedName": "all_retrieved_documents", - "description": "Summary information about documents retrieved by the data retrieval operation.", - "type": { - "$id": "1313", - "kind": "model", - "name": "AzureChatMessageContextAllRetrievedDocuments", - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1314", - "kind": "property", - "name": "content", - "serializedName": "content", - "description": "The content of the citation.", - "type": { - "$id": "1315", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.content" - }, - { - "$id": "1316", - "kind": "property", - "name": "title", - "serializedName": "title", - "description": "The title for the citation.", - "type": { - "$id": "1317", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.title" - }, - { - "$id": "1318", - "kind": "property", - "name": "url", - "serializedName": "url", - "description": "The URL of the citation.", - "type": { - "$id": "1319", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.url" - }, - { - "$id": "1320", - "kind": "property", - "name": "filepath", - "serializedName": "filepath", - "description": "The file path for the citation.", - "type": { - "$id": "1321", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.filepath" - }, - { - "$id": "1322", - "kind": "property", - "name": "chunk_id", - "serializedName": "chunk_id", - "description": "The chunk ID for the citation.", - "type": { - "$id": "1323", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.chunk_id" - }, - { - "$id": "1324", - "kind": "property", - "name": "rerank_score", - "serializedName": "rerank_score", - "description": "The rerank score for the retrieval.", - "type": { - "$id": "1325", - "kind": "float64", - "name": "float64", - "crossLanguageDefinitionId": "TypeSpec.float64", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.rerank_score" - }, - { - "$id": "1326", - "kind": "property", - "name": "search_queries", - "serializedName": "search_queries", - "description": "The search queries executed to retrieve documents.", - "type": { - "$id": "1327", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "1328", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.search_queries" - }, - { - "$id": "1329", - "kind": "property", - "name": "data_source_index", - "serializedName": "data_source_index", - "description": "The index of the data source used for retrieval.", - "type": { - "$id": "1330", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.data_source_index" - }, - { - "$id": "1331", - "kind": "property", - "name": "original_search_score", - "serializedName": "original_search_score", - "description": "The original search score for the retrieval.", - "type": { - "$id": "1332", - "kind": "float64", - "name": "float64", - "crossLanguageDefinitionId": "TypeSpec.float64", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.original_search_score" - }, - { - "$id": "1333", - "kind": "property", - "name": "filter_reason", - "serializedName": "filter_reason", - "description": "If applicable, an indication of why the document was filtered.", - "type": { - "$ref": "249" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents.anonymous.filter_reason" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatMessageContext.all_retrieved_documents" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureChatCompletionStreamResponseDelta.context" - } - ] - }, - { - "$ref": "1255" - }, - { - "$ref": "1269" - }, - { - "$ref": "1276" - }, - { - "$ref": "1284" - }, - { - "$ref": "1294" - }, - { - "$ref": "1299" - }, - { - "$ref": "1313" - }, - { - "$id": "1334", - "kind": "model", - "name": "AzureOpenAIChatErrorResponse", - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatErrorResponse", - "access": "public", - "usage": "Output,Json", - "description": "A structured representation of an error an Azure OpenAI request.", - "decorators": [], - "properties": [ - { - "$id": "1335", - "kind": "property", - "name": "error", - "serializedName": "error", - "type": { - "$id": "1336", - "kind": "model", - "name": "AzureOpenAIChatError", - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError", - "access": "public", - "usage": "Output,Json", - "description": "The structured representation of an error from an Azure OpenAI chat completion request.", - "decorators": [], - "properties": [ - { - "$id": "1337", - "kind": "property", - "name": "code", - "serializedName": "code", - "description": "The distinct, machine-generated identifier for the error.", - "type": { - "$id": "1338", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.code" - }, - { - "$id": "1339", - "kind": "property", - "name": "message", - "serializedName": "message", - "description": "A human-readable message associated with the error.", - "type": { - "$id": "1340", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.message" - }, - { - "$id": "1341", - "kind": "property", - "name": "param", - "serializedName": "param", - "description": "If applicable, the request input parameter associated with the error", - "type": { - "$id": "1342", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.param" - }, - { - "$id": "1343", - "kind": "property", - "name": "type", - "serializedName": "type", - "description": "If applicable, the input line number associated with the error.", - "type": { - "$id": "1344", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.type" - }, - { - "$id": "1345", - "kind": "property", - "name": "inner_error", - "serializedName": "inner_error", - "description": "If applicable, an upstream error that originated this error.", - "type": { - "$id": "1346", - "kind": "model", - "name": "AzureOpenAIChatErrorInnerError", - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error.anonymous", - "usage": "Output,Json", - "decorators": [], - "properties": [ - { - "$id": "1347", - "kind": "property", - "name": "code", - "serializedName": "code", - "description": "The code associated with the inner error.", - "type": { - "$id": "1348", - "kind": "constant", - "valueType": { - "$ref": "255" - }, - "value": "ResponsibleAIPolicyViolation", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error.anonymous.code" - }, - { - "$id": "1349", - "kind": "property", - "name": "revised_prompt", - "serializedName": "revised_prompt", - "description": "If applicable, the modified prompt used for generation.", - "type": { - "$id": "1350", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error.anonymous.revised_prompt" - }, - { - "$id": "1351", - "kind": "property", - "name": "content_filter_results", - "serializedName": "content_filter_results", - "description": "The content filter result details associated with the inner error.", - "type": { - "$ref": "1239" - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error.anonymous.content_filter_results" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatError.inner_error" - } - ] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIChatErrorResponse.error" - } - ] - }, - { - "$ref": "1336" - }, - { - "$ref": "1346" - }, - { - "$id": "1352", - "kind": "model", - "name": "AzureContentFilterBlocklistIdResult", - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistIdResult", - "access": "public", - "usage": "Output", - "description": "A content filter result item that associates an existing custom blocklist ID with a value indicating whether or not\nthe corresponding blocklist resulted in content being filtered.", - "decorators": [], - "properties": [ - { - "$id": "1353", - "kind": "property", - "name": "id", - "serializedName": "id", - "description": "The ID of the custom blocklist associated with the filtered status.", - "type": { - "$id": "1354", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistIdResult.id" - }, - { - "$id": "1355", - "kind": "property", - "name": "filtered", - "serializedName": "filtered", - "description": "Whether the associated blocklist resulted in the content being filtered.", - "type": { - "$id": "1356", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureContentFilterBlocklistIdResult.filtered" - } - ] - }, - { - "$id": "1357", - "kind": "model", - "name": "AzureOpenAIFile", - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile", - "access": "public", - "usage": "Output", - "decorators": [], - "properties": [ - { - "$id": "1358", - "kind": "property", - "name": "id", - "serializedName": "id", - "description": "The file identifier, which can be referenced in the API endpoints.", - "type": { - "$id": "1359", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.id" - }, - { - "$id": "1360", - "kind": "property", - "name": "bytes", - "serializedName": "bytes", - "description": "The size of the file, in bytes.", - "type": { - "$id": "1361", - "kind": "nullable", - "type": { - "$id": "1362", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - } - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.bytes" - }, - { - "$id": "1363", - "kind": "property", - "name": "created_at", - "serializedName": "created_at", - "description": "The Unix timestamp (in seconds) for when the file was created.", - "type": { - "$id": "1364", - "kind": "utcDateTime", - "name": "utcDateTime", - "encode": "unixTimestamp", - "wireType": { - "$id": "1365", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.utcDateTime", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.created_at" - }, - { - "$id": "1366", - "kind": "property", - "name": "filename", - "serializedName": "filename", - "description": "The name of the file.", - "type": { - "$id": "1367", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.filename" - }, - { - "$id": "1368", - "kind": "property", - "name": "object", - "serializedName": "object", - "description": "The object type, which is always `file`.", - "type": { - "$id": "1369", - "kind": "constant", - "valueType": { - "$ref": "290" - }, - "value": "file", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.object" - }, - { - "$id": "1370", - "kind": "property", - "name": "purpose", - "serializedName": "purpose", - "description": "The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results` and `vision`.", - "type": { - "$ref": "274" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.purpose" - }, - { - "$id": "1371", - "kind": "property", - "name": "status_details", - "serializedName": "status_details", - "description": "Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.", - "type": { - "$id": "1372", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.status_details" - }, - { - "$id": "1373", - "kind": "property", - "name": "status", - "serializedName": "status", - "type": { - "$ref": "293" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureOpenAIFile.status" - } - ] - }, - { - "$id": "1374", - "kind": "model", - "name": "AzureImage", - "crossLanguageDefinitionId": "AzureOpenAI.AzureImage", - "access": "public", - "usage": "Output", - "decorators": [], - "baseModel": { - "$ref": "448" - }, - "properties": [ - { - "$id": "1375", - "kind": "property", - "name": "prompt_filter_results", - "serializedName": "prompt_filter_results", - "type": { - "$ref": "473" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureImage.prompt_filter_results" - }, - { - "$id": "1376", - "kind": "property", - "name": "content_filter_results", - "serializedName": "content_filter_results", - "type": { - "$ref": "474" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "AzureOpenAI.AzureImage.content_filter_results" - } - ] - } - ], - "Clients": [ - { - "$id": "1377", - "Name": "AzureOpenAIClient", - "Operations": [], - "Protocol": { - "$id": "1378" - }, - "Parameters": [ - { - "$id": "1379", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", - "Type": { - "$id": "1380", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client" - } - ], - "Decorators": [] - }, - { - "$id": "1381", - "Name": "AzureChat", - "Operations": [ - { - "$id": "1382", - "Name": "createChatCompletion", - "ResourceName": "AzureChat", - "Accessibility": "public", - "Parameters": [ - { - "$id": "1383", - "Name": "deployment_id", - "NameInRequest": "deployment_id", - "Type": { - "$id": "1384", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "Location": "Path", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1385", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Description": "Body parameter's content type. Known values are application/json", - "Type": { - "$id": "1386", - "kind": "constant", - "valueType": { - "$id": "1387", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1388", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "1389", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1390", - "Name": "request", - "NameInRequest": "request", - "Type": { - "$ref": "501" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "1391", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "1334" - }, - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false, - "ContentTypes": [ - "application/json", - "application/json", - "application/json" - ] - } - ], - "HttpMethod": "POST", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}/openai", - "Path": "/{deployment_id}/chat/completions", - "RequestMediaTypes": [ - "application/json" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "AzureOpenAI.AzureChat.createChatCompletion", - "Decorators": [] - } - ], - "Protocol": { - "$id": "1392" - }, - "Parent": "AzureOpenAIClient", - "Parameters": [ - { - "$id": "1393", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", - "Type": { - "$id": "1394", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client" - } - ], - "Decorators": [] - }, - { - "$id": "1395", - "Name": "AzureImages", - "Operations": [ - { - "$id": "1396", - "Name": "createImage", - "ResourceName": "AzureImages", - "Accessibility": "public", - "Parameters": [ - { - "$id": "1397", - "Name": "deploymentId", - "NameInRequest": "deploymentId", - "Type": { - "$id": "1398", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "Location": "Path", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1399", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Description": "Body parameter's content type. Known values are application/json", - "Type": { - "$id": "1400", - "kind": "constant", - "valueType": { - "$id": "1401", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1402", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "1403", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1404", - "Name": "image", - "NameInRequest": "image", - "Type": { - "$ref": "425" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "1405", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "455" - }, - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false, - "ContentTypes": [ - "application/json", - "application/json" - ] - } - ], - "HttpMethod": "POST", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}/openai", - "Path": "/deployments/{deploymentId}/images/generations", - "RequestMediaTypes": [ - "application/json" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "AzureOpenAI.AzureImages.createImage", - "Decorators": [] - } - ], - "Protocol": { - "$id": "1406" - }, - "Parent": "AzureOpenAIClient", - "Parameters": [ - { - "$id": "1407", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", - "Type": { - "$id": "1408", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client" - } - ], - "Decorators": [] - }, - { - "$id": "1409", - "Name": "AzureMessages", - "Operations": [ - { - "$id": "1410", - "Name": "createMessage", - "ResourceName": "AzureMessages", - "Summary": "Create a message.", - "Accessibility": "public", - "Parameters": [ - { - "$id": "1411", - "Name": "thread_id", - "NameInRequest": "thread_id", - "Description": "The ID of the [thread](/docs/api-reference/threads) to create a message for.", - "Type": { - "$id": "1412", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "Location": "Path", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1413", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Description": "Body parameter's content type. Known values are application/json", - "Type": { - "$id": "1414", - "kind": "constant", - "valueType": { - "$id": "1415", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1416", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "1417", - "kind": "constant", - "valueType": { - "$id": "1418", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/json", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "1419", - "Name": "requestBody", - "NameInRequest": "requestBody", - "Type": { - "$ref": "309" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "1420", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "366" - }, - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false, - "ContentTypes": [ - "application/json" - ] - } - ], - "HttpMethod": "POST", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}/openai", - "Path": "/threads/{thread_id}/messages", - "RequestMediaTypes": [ - "application/json" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "AzureOpenAI.AzureMessages.createMessage", - "Decorators": [] - } - ], - "Protocol": { - "$id": "1421" - }, - "Parent": "AzureOpenAIClient", - "Parameters": [ - { - "$id": "1422", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://westus.api.cognitive.microsoft.com).", - "Type": { - "$id": "1423", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client" - } - ], - "Decorators": [] - } - ], - "Auth": { - "$id": "1424", - "ApiKey": { - "$id": "1425", - "Name": "api-key" - }, - "OAuth2": { - "$id": "1426", - "Scopes": [ - "https://cognitiveservices.azure.com/.default" - ] - } - } -} diff --git a/.plugin.azure/generator/src/Visitors/AdditionalPropertiesVisitor.cs b/.plugin.azure/generator/src/Visitors/AdditionalPropertiesVisitor.cs index 6dcd9f9ca..0ccfe711a 100644 --- a/.plugin.azure/generator/src/Visitors/AdditionalPropertiesVisitor.cs +++ b/.plugin.azure/generator/src/Visitors/AdditionalPropertiesVisitor.cs @@ -1,137 +1,139 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; using Microsoft.Generator.CSharp.ClientModel; using Microsoft.Generator.CSharp.ClientModel.Providers; using Microsoft.Generator.CSharp.Primitives; using Microsoft.Generator.CSharp.Providers; using Microsoft.Generator.CSharp.Snippets; using Microsoft.Generator.CSharp.Statements; +using System; +using System.Collections.Generic; +using System.Linq; using static Microsoft.Generator.CSharp.Snippets.Snippet; -namespace AzureOpenAILibraryPlugin +namespace AzureOpenAILibraryPlugin; + +/// +/// This visitor ensures that each emitted model has an internal "additional raw data" dictionary property included +/// and used during the serialization and deserialization process. +/// +public class AdditionalPropertiesVisitor : ScmLibraryVisitor { - public class AdditionalPropertiesVisitor : ScmLibraryVisitor - { - private const string RawDataPropertyName = "SerializedAdditionalRawData"; - private const string AdditionalPropertiesFieldName = "_additionalBinaryDataProperties"; - private const string WritePropertyNameMethodCall = "WritePropertyName(\""; - private const string IsSentinelValueMethodName = "IsSentinelValue"; - private const string JsonModelWriteCoreMethodName = "JsonModelWriteCore"; + private const string RawDataPropertyName = "SerializedAdditionalRawData"; + private const string AdditionalPropertiesFieldName = "_additionalBinaryDataProperties"; + private const string WritePropertyNameMethodCall = "WritePropertyName(\""; + private const string IsSentinelValueMethodName = "IsSentinelValue"; + private const string JsonModelWriteCoreMethodName = "JsonModelWriteCore"; - protected override TypeProvider Visit(TypeProvider type) + protected override TypeProvider Visit(TypeProvider type) + { + if (type is ModelProvider { BaseModelProvider: null }) { - if (type is ModelProvider { BaseModelProvider: null }) + // Add an internal AdditionalProperties property to all base models + var additionalPropertiesField = type.Fields.Single(f => f.Name == AdditionalPropertiesFieldName); + var properties = new List(type.Properties) { - // Add an internal AdditionalProperties property to all base models - var additionalPropertiesField = type.Fields.Single(f => f.Name == AdditionalPropertiesFieldName); - var properties = new List(type.Properties) - { - new PropertyProvider($"", MethodSignatureModifiers.Internal, - typeof(IDictionary), RawDataPropertyName, - new ExpressionPropertyBody( - additionalPropertiesField, - type.DeclarationModifiers.HasFlag(TypeSignatureModifiers.ReadOnly) ? null : additionalPropertiesField.Assign(Value)), - type) - }; - - type.Update(properties: properties); - } - return type; + new PropertyProvider($"", MethodSignatureModifiers.Internal, + typeof(IDictionary), RawDataPropertyName, + new ExpressionPropertyBody( + additionalPropertiesField, + type.DeclarationModifiers.HasFlag(TypeSignatureModifiers.ReadOnly) ? null : additionalPropertiesField.Assign(Value)), + type) + }; + + type.Update(properties: properties); } + return type; + } - protected override MethodProvider Visit(MethodProvider method) + protected override MethodProvider Visit(MethodProvider method) + { + if (method.Signature.Name != JsonModelWriteCoreMethodName) { - if (method.Signature.Name != JsonModelWriteCoreMethodName) - { - return method; - } + return method; + } - // If there are no body statements, return the method as is - if (method.BodyStatements == null) - { - return method; - } + // If there are no body statements, return the method as is + if (method.BodyStatements == null) + { + return method; + } - // If the body statements are not MethodBodyStatements, return the method as is - if (method.BodyStatements is not MethodBodyStatements statements) - { - return method; - } + // If the body statements are not MethodBodyStatements, return the method as is + if (method.BodyStatements is not MethodBodyStatements statements) + { + return method; + } - var updatedStatements = new List(); - var flattenedStatements = statements.Flatten().ToArray(); + var updatedStatements = new List(); + var flattenedStatements = statements.Flatten().ToArray(); - for (int line = 0; line < flattenedStatements.Length; line++) + for (int line = 0; line < flattenedStatements.Length; line++) + { + var statement = flattenedStatements[line]; + + if (statement is IfStatement ifStatement) { - var statement = flattenedStatements[line]; + var body = ifStatement.Body.ToDisplayString(); - if (statement is IfStatement ifStatement) + // If we already have an if statement that contains property writing, we need to add the condition to the existing if statement + if (body.Contains(WritePropertyNameMethodCall)) { - var body = ifStatement.Body.ToDisplayString(); + ifStatement.Condition = ifStatement.Condition.As().And(GetContainsKeyCondition(body)); + } - // If we already have an if statement that contains property writing, we need to add the condition to the existing if statement - if (body.Contains(WritePropertyNameMethodCall)) - { - ifStatement.Condition = ifStatement.Condition.As().And(GetContainsKeyCondition(body)); - } + // Handle writing AdditionalProperties + else if (ifStatement.Body.Flatten().First() is ForeachStatement foreachStatement) + { + foreachStatement.Body.Insert( + 0, + new IfStatement( + Static(new ModelSerializationExtensionsDefinition().Type).Invoke( + IsSentinelValueMethodName, + foreachStatement.ItemVariable.Property("Value"))) + { + Continue + }); + } - // Handle writing AdditionalProperties - else if (ifStatement.Body.Flatten().First() is ForeachStatement foreachStatement) - { - foreachStatement.Body.Insert( - 0, - new IfStatement( - Static(new ModelSerializationExtensionsDefinition().Type).Invoke( - IsSentinelValueMethodName, - foreachStatement.ItemVariable.Property("Value"))) - { - Continue - }); - } + updatedStatements.Add(ifStatement); + continue; + } - updatedStatements.Add(ifStatement); - continue; - } + var displayString = statement.ToDisplayString(); + if (displayString.Contains(WritePropertyNameMethodCall)) + { + var ifSt = new IfStatement(GetContainsKeyCondition(displayString)) { statement }; - var displayString = statement.ToDisplayString(); - if (displayString.Contains(WritePropertyNameMethodCall)) + // If this is a plain expression statement, we need to add the next statement as well which + // will either write the property value or start writing an array + if (statement is ExpressionStatement) { - var ifSt = new IfStatement(GetContainsKeyCondition(displayString)) { statement }; - - // If this is a plain expression statement, we need to add the next statement as well which - // will either write the property value or start writing an array - if (statement is ExpressionStatement) + ifSt.Add(flattenedStatements[++line]); + // Include array writing in the if statement + if (flattenedStatements[line + 1] is ForeachStatement) { + // Foreach + ifSt.Add(flattenedStatements[++line]); + // End array ifSt.Add(flattenedStatements[++line]); - // Include array writing in the if statement - if (flattenedStatements[line + 1] is ForeachStatement) - { - // Foreach - ifSt.Add(flattenedStatements[++line]); - // End array - ifSt.Add(flattenedStatements[++line]); - } } - updatedStatements.Add(ifSt); - } - else - { - updatedStatements.Add(statement); } + updatedStatements.Add(ifSt); + } + else + { + updatedStatements.Add(statement); } - - method.Update(bodyStatements: updatedStatements); - return method; } - private static ScopedApi GetContainsKeyCondition(string displayString) - { - var propertyName = displayString.Split('"')[1]; - return This.Property(AdditionalPropertiesFieldName) - .NullConditional() - .Invoke("ContainsKey", Literal(propertyName)).NotEqual(True); - } + method.Update(bodyStatements: updatedStatements); + return method; + } + + private static ScopedApi GetContainsKeyCondition(string displayString) + { + var propertyName = displayString.Split('"')[1]; + return This.Property(AdditionalPropertiesFieldName) + .NullConditional() + .Invoke("ContainsKey", Literal(propertyName)).NotEqual(True); } } diff --git a/.plugin.azure/generator/src/Visitors/DocEditVisitor.cs b/.plugin.azure/generator/src/Visitors/DocEditVisitor.cs index 94ca5ed60..8b55ab0b4 100644 --- a/.plugin.azure/generator/src/Visitors/DocEditVisitor.cs +++ b/.plugin.azure/generator/src/Visitors/DocEditVisitor.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; using Microsoft.Generator.CSharp.ClientModel; -using Microsoft.Generator.CSharp.ClientModel.Providers; -using Microsoft.Generator.CSharp.Primitives; using Microsoft.Generator.CSharp.Providers; using Microsoft.Generator.CSharp.Snippets; using Microsoft.Generator.CSharp.Statements; -using static Microsoft.Generator.CSharp.Snippets.Snippet; +using System; +using System.Collections.Generic; +using System.Linq; -namespace AzureOpenAILibraryPlugin +namespace AzureOpenAILibraryPlugin; + +/// +/// This visitor ensures consistent formatting of XML doc comments, including normalization of lines +/// that mitigate newline injection causing malformed comments. +/// +public class DocEditVisitor : ScmLibraryVisitor { - public class DocEditVisitor : ScmLibraryVisitor + protected override PropertyProvider? Visit(PropertyProvider property) { - protected override PropertyProvider? Visit(PropertyProvider property) + if (TryUpdateXmlDocs(property.XmlDocs)) { - if (TryUpdateXmlDocs(property.XmlDocs)) - { - property.Update(xmlDocs: property.XmlDocs); - } - return base.Visit(property); + property.Update(xmlDocs: property.XmlDocs); } + return base.Visit(property); + } - protected override TypeProvider Visit(TypeProvider type) + protected override TypeProvider Visit(TypeProvider type) + { + if (TryUpdateXmlDocs(type.XmlDocs)) { - if (TryUpdateXmlDocs(type.XmlDocs)) - { - type.Update(xmlDocs: type.XmlDocs); - } - return type; + type.Update(xmlDocs: type.XmlDocs); } + return type; + } - protected override MethodProvider? Visit(MethodProvider method) + protected override MethodProvider? Visit(MethodProvider method) + { + if (TryUpdateXmlDocs(method.XmlDocs)) { - if (TryUpdateXmlDocs(method.XmlDocs)) - { - method.Update(xmlDocProvider: method.XmlDocs); - } - return base.Visit(method); + method.Update(xmlDocProvider: method.XmlDocs); } + return base.Visit(method); + } - private static bool TryUpdateXmlDocs(XmlDocProvider? xmlDocs) + private static bool TryUpdateXmlDocs(XmlDocProvider? xmlDocs) + { + if (xmlDocs?.Summary?.Lines is IReadOnlyList existingSummaryLines + && existingSummaryLines.Count > 0) { - if (xmlDocs?.Summary?.Lines is IReadOnlyList existingSummaryLines - && existingSummaryLines.Count > 0) + List reprocessedSummaryLines = []; + foreach (var line in existingSummaryLines) + { + string[] linesInTheLine = line.ToString().Split('\n'); + reprocessedSummaryLines.AddRange(linesInTheLine.Select(lineInTheLine => (FormattableString)$"{lineInTheLine}")); + } + if (reprocessedSummaryLines.Count > existingSummaryLines.Count) { - List reprocessedSummaryLines = []; - foreach (var line in existingSummaryLines) - { - string[] linesInTheLine = line.ToString().Split('\n'); - reprocessedSummaryLines.AddRange(linesInTheLine.Select(lineInTheLine => (FormattableString)$"{lineInTheLine}")); - } - if (reprocessedSummaryLines.Count > existingSummaryLines.Count) - { - xmlDocs.Summary = new XmlDocSummaryStatement(reprocessedSummaryLines, [.. xmlDocs.Summary.InnerStatements]); - return true; - } + xmlDocs.Summary = new XmlDocSummaryStatement(reprocessedSummaryLines, [.. xmlDocs.Summary.InnerStatements]); + return true; } - return false; } + return false; } } diff --git a/.plugin.azure/generator/src/Visitors/InternalSettablePropertiesVisitor.cs b/.plugin.azure/generator/src/Visitors/InternalSettablePropertiesVisitor.cs index daa4357f3..01110441d 100644 --- a/.plugin.azure/generator/src/Visitors/InternalSettablePropertiesVisitor.cs +++ b/.plugin.azure/generator/src/Visitors/InternalSettablePropertiesVisitor.cs @@ -1,39 +1,30 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection.Metadata.Ecma335; -using System.Runtime.CompilerServices; -using System.Text.RegularExpressions; using Microsoft.Generator.CSharp.ClientModel; -using Microsoft.Generator.CSharp.ClientModel.Providers; using Microsoft.Generator.CSharp.Primitives; using Microsoft.Generator.CSharp.Providers; -using Microsoft.Generator.CSharp.Snippets; -using Microsoft.Generator.CSharp.Statements; -using static Microsoft.Generator.CSharp.Snippets.Snippet; -namespace AzureOpenAILibraryPlugin +namespace AzureOpenAILibraryPlugin; + +/// +/// This visitor ensures that all properties on internal types with "Internal" type prefix are settable. +/// +public class InternalSettablePropertiesVisitor : ScmLibraryVisitor { - public class InternalSettablePropertiesVisitor : ScmLibraryVisitor + protected override TypeProvider? Visit(TypeProvider type) { - protected override TypeProvider? Visit(TypeProvider type) + if (type.Name.Contains("Internal") && type.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)) { - if (type.Name.Contains("Internal") && type.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)) + foreach (PropertyProvider property in type.Properties) { - foreach (PropertyProvider property in type.Properties) + if (property.Body is AutoPropertyBody autoPropertyBody && !property.Body.HasSetter) { - if (property.Body is AutoPropertyBody autoPropertyBody && !property.Body.HasSetter) - { - PropertyBody updatedBody = new AutoPropertyBody( - HasSetter: true, - autoPropertyBody.SetterModifiers, - autoPropertyBody.InitializationExpression); - property.Update(body: updatedBody); - } + PropertyBody updatedBody = new AutoPropertyBody( + HasSetter: true, + autoPropertyBody.SetterModifiers, + autoPropertyBody.InitializationExpression); + property.Update(body: updatedBody); } } - return type; } + return type; } } diff --git a/.plugin.azure/generator/src/Visitors/ModelSerializationEmptySentinelVisitor.cs b/.plugin.azure/generator/src/Visitors/ModelSerializationEmptySentinelVisitor.cs index 3bcd525f9..05b0c21aa 100644 --- a/.plugin.azure/generator/src/Visitors/ModelSerializationEmptySentinelVisitor.cs +++ b/.plugin.azure/generator/src/Visitors/ModelSerializationEmptySentinelVisitor.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; using Microsoft.Generator.CSharp.ClientModel; -using Microsoft.Generator.CSharp.ClientModel.Providers; using Microsoft.Generator.CSharp.Primitives; using Microsoft.Generator.CSharp.Providers; using Microsoft.Generator.CSharp.Snippets; -using Microsoft.Generator.CSharp.Statements; +using System; +using System.Collections.Generic; using static Microsoft.Generator.CSharp.Snippets.Snippet; -namespace AzureOpenAILibraryPlugin +namespace AzureOpenAILibraryPlugin; + +/// +/// This visitor adds extensions for model serialization that use an empty sentinel value to serve as a suppression +/// flag for a named property on the additional binary data properties dictionary. +/// +public class ModelSerializationEmptySentinelVisitor : ScmLibraryVisitor { - public class ModelSerializationEmptySentinelVisitor : ScmLibraryVisitor - { - private const string ModelSerializationExtensionsTypeName = "ModelSerializationExtensions"; - private const string SentinelValueFieldName = "_sentinelValue"; - private const string IsSentinelValueMethodName = "IsSentinelValue"; + private const string ModelSerializationExtensionsTypeName = "ModelSerializationExtensions"; + private const string SentinelValueFieldName = "_sentinelValue"; + private const string IsSentinelValueMethodName = "IsSentinelValue"; - protected override TypeProvider Visit(TypeProvider type) + protected override TypeProvider Visit(TypeProvider type) + { + if (type.Name == ModelSerializationExtensionsTypeName) { - if (type.Name == ModelSerializationExtensionsTypeName) + // Add a static BinaryData field representing the sentinel value + var sentinelValueField = new FieldProvider( + FieldModifiers.Private | FieldModifiers.Static | FieldModifiers.ReadOnly, + typeof(BinaryData), + SentinelValueFieldName, + type, + $"", + BinaryDataSnippets.FromBytes(LiteralU8("\"__EMPTY__\"").Invoke("ToArray"))); + var fields = new List(type.Fields) { - // Add a static BinaryData field representing the sentinel value - var sentinelValueField = new FieldProvider( - FieldModifiers.Private | FieldModifiers.Static | FieldModifiers.ReadOnly, - typeof(BinaryData), - SentinelValueFieldName, - type, - $"", - BinaryDataSnippets.FromBytes(LiteralU8("\"__EMPTY__\"").Invoke("ToArray"))); - var fields = new List(type.Fields) - { - sentinelValueField - }; + sentinelValueField + }; - // Add the IsSentinelValue method - var valueParameter = new ParameterProvider("value", $"", typeof(BinaryData)); - var methods = new List(type.Methods) - { - new MethodProvider( - new MethodSignature( - IsSentinelValueMethodName, - $"", - MethodSignatureModifiers.Internal | MethodSignatureModifiers.Static, - typeof(bool), - $"", - [valueParameter]), - new[] - { - Declare("sentinelSpan", typeof(ReadOnlySpan), sentinelValueField.As().ToMemory().Property("Span"), out var sentinelVariable), - Declare("valueSpan", typeof(ReadOnlySpan), valueParameter.As().ToMemory().Property("Span"), out var valueVariable), - Return(sentinelVariable.Invoke("SequenceEqual", valueVariable)) - }, - type) - }; + // Add the IsSentinelValue method + var valueParameter = new ParameterProvider("value", $"", typeof(BinaryData)); + var methods = new List(type.Methods) + { + new MethodProvider( + new MethodSignature( + IsSentinelValueMethodName, + $"", + MethodSignatureModifiers.Internal | MethodSignatureModifiers.Static, + typeof(bool), + $"", + [valueParameter]), + new[] + { + Declare("sentinelSpan", typeof(ReadOnlySpan), sentinelValueField.As().ToMemory().Property("Span"), out var sentinelVariable), + Declare("valueSpan", typeof(ReadOnlySpan), valueParameter.As().ToMemory().Property("Span"), out var valueVariable), + Return(sentinelVariable.Invoke("SequenceEqual", valueVariable)) + }, + type) + }; - type.Update(fields: fields, methods: methods); - } - return type; + type.Update(fields: fields, methods: methods); } + return type; } } diff --git a/.plugin.azure/generator/src/Visitors/TypeRemovalVisitor.cs b/.plugin.azure/generator/src/Visitors/TypeRemovalVisitor.cs index 02bb68382..c06279902 100644 --- a/.plugin.azure/generator/src/Visitors/TypeRemovalVisitor.cs +++ b/.plugin.azure/generator/src/Visitors/TypeRemovalVisitor.cs @@ -1,60 +1,56 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using System.Text.RegularExpressions; using Microsoft.Generator.CSharp.ClientModel; -using Microsoft.Generator.CSharp.ClientModel.Providers; -using Microsoft.Generator.CSharp.Primitives; using Microsoft.Generator.CSharp.Providers; using Microsoft.Generator.CSharp.Snippets; -using Microsoft.Generator.CSharp.Statements; -using static Microsoft.Generator.CSharp.Snippets.Snippet; +using System.Linq; +using System.Text.RegularExpressions; -namespace AzureOpenAILibraryPlugin +namespace AzureOpenAILibraryPlugin; + +/// +/// This visitor suppresses the emission of types according to pattern matches in their names. +/// We do this to trim the set of generated files such that the library serves as an extension to +/// the underlying OpenAI library (rather than a standalone library in its own right). +/// +public class TypeRemovalVisitor : ScmLibraryVisitor { - public class TypeRemovalVisitor : ScmLibraryVisitor - { - private static readonly string[] PatternsToKeep = - [ - ".*BingSearchTool.*", - ".*DataSource.*", - ".*ContentFilter.*", - ".*OpenAI.*Error.*", - ".*Context.*", - ".*RetrievedDoc.*", - ".*ChatDocument.*", - ".*Citation.*", - "Argument", - "BinaryContentHelper", - "ChangeTracking.*", - "ClientPipelineExtensions", - "ClientUriBuilder", - "ErrorResult", - "ModelSerializationExtensions", - "Optional", - "PipelineRequestHeadersExtensions", - "TypeFormatters", - "Utf8JsonBinaryContent", - ]; - private static readonly string[] PatternsToStillDeleteAfterPatternsToKeep = - [ - "AzureOpenAIFile.*", - "BingSearchToolDefinition.cs", - ".*Elasticsearch*QueryType.*", - ".*FieldsMapping.*", - ".*ContentTextAnnotationsFileCitation.*" - ]; + private static readonly string[] PatternsToKeep = + [ + ".*BingSearchTool.*", + ".*DataSource.*", + ".*ContentFilter.*", + ".*OpenAI.*Error.*", + ".*Context.*", + ".*RetrievedDoc.*", + ".*ChatDocument.*", + ".*Citation.*", + "Argument", + "BinaryContentHelper", + "ChangeTracking.*", + "ClientPipelineExtensions", + "ClientUriBuilder", + "ErrorResult", + "ModelSerializationExtensions", + "Optional", + "PipelineRequestHeadersExtensions", + "TypeFormatters", + "Utf8JsonBinaryContent", + ]; + private static readonly string[] PatternsToStillDeleteAfterPatternsToKeep = + [ + "AzureOpenAIFile.*", + "BingSearchToolDefinition.cs", + ".*Elasticsearch*QueryType.*", + ".*FieldsMapping.*", + ".*ContentTextAnnotationsFileCitation.*" + ]; - protected override TypeProvider? Visit(TypeProvider type) + protected override TypeProvider? Visit(TypeProvider type) + { + if (PatternsToKeep.Any(patternToKeep => Regex.IsMatch(type.Name, patternToKeep) + && !PatternsToStillDeleteAfterPatternsToKeep.Any(patternToStillDelete => Regex.IsMatch(type.Name, patternToStillDelete)))) { - if (PatternsToKeep.Any(patternToKeep => Regex.IsMatch(type.Name, patternToKeep) - && !PatternsToStillDeleteAfterPatternsToKeep.Any(patternToStillDelete => Regex.IsMatch(type.Name, patternToStillDelete)))) - { - return type; - } - return null; + return type; } + return null; } } diff --git a/.plugin.azure/generator/src/Visitors/WriteableSardVisitor.cs b/.plugin.azure/generator/src/Visitors/WriteableSardVisitor.cs index 08efae949..b425e13f8 100644 --- a/.plugin.azure/generator/src/Visitors/WriteableSardVisitor.cs +++ b/.plugin.azure/generator/src/Visitors/WriteableSardVisitor.cs @@ -1,29 +1,24 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; using Microsoft.Generator.CSharp.ClientModel; -using Microsoft.Generator.CSharp.ClientModel.Providers; using Microsoft.Generator.CSharp.Primitives; using Microsoft.Generator.CSharp.Providers; -using Microsoft.Generator.CSharp.Snippets; -using Microsoft.Generator.CSharp.Statements; -using static Microsoft.Generator.CSharp.Snippets.Snippet; -namespace AzureOpenAILibraryPlugin +namespace AzureOpenAILibraryPlugin; + +/// +/// This visitor modifies the additional binary data properties field to be writeable (i.e. to exclude the +/// readonly modifier on the field). +/// +public class WriteableSardVisitor : ScmLibraryVisitor { - public class WriteableSardVisitor : ScmLibraryVisitor - { - private const string AdditionalPropertiesFieldName = "_additionalBinaryDataProperties"; + private const string AdditionalPropertiesFieldName = "_additionalBinaryDataProperties"; - protected override FieldProvider Visit(FieldProvider field) + protected override FieldProvider Visit(FieldProvider field) + { + // Make the backing additional properties field not be read only as long as the type is not readonly. + if (field.Name == AdditionalPropertiesFieldName && !field.EnclosingType.DeclarationModifiers.HasFlag(TypeSignatureModifiers.ReadOnly)) { - // Make the backing additional properties field not be read only as long as the type is not readonly. - if (field.Name == AdditionalPropertiesFieldName && !field.EnclosingType.DeclarationModifiers.HasFlag(TypeSignatureModifiers.ReadOnly)) - { - field.Modifiers &= ~FieldModifiers.ReadOnly; - } - return field; + field.Modifiers &= ~FieldModifiers.ReadOnly; } + return field; } }