diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AISearchIndexResource.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AISearchIndexResource.Serialization.cs index ea2f141a7445..31cd6ac9faf2 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AISearchIndexResource.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AISearchIndexResource.Serialization.cs @@ -34,10 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(AISearchIndexResource)} does not support writing '{format}' format."); } - writer.WritePropertyName("index_connection_id"u8); - writer.WriteStringValue(IndexConnectionId); - writer.WritePropertyName("index_name"u8); - writer.WriteStringValue(IndexName); + if (Optional.IsDefined(IndexConnectionId)) + { + writer.WritePropertyName("index_connection_id"u8); + writer.WriteStringValue(IndexConnectionId); + } + if (Optional.IsDefined(IndexName)) + { + writer.WritePropertyName("index_name"u8); + writer.WriteStringValue(IndexName); + } if (Optional.IsDefined(QueryType)) { writer.WritePropertyName("query_type"u8); diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AISearchIndexResource.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AISearchIndexResource.cs index e0861f9946af..d7cc0abde516 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AISearchIndexResource.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AISearchIndexResource.cs @@ -46,16 +46,8 @@ public partial class AISearchIndexResource private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// An index connection id in an IndexResource attached to this agent. - /// The name of an index in an IndexResource attached to this agent. - /// or is null. - public AISearchIndexResource(string indexConnectionId, string indexName) + public AISearchIndexResource() { - Argument.AssertNotNull(indexConnectionId, nameof(indexConnectionId)); - Argument.AssertNotNull(indexName, nameof(indexName)); - - IndexConnectionId = indexConnectionId; - IndexName = indexName; } /// Initializes a new instance of . @@ -76,11 +68,6 @@ internal AISearchIndexResource(string indexConnectionId, string indexName, Azure IndexAssetId = indexAssetId; _serializedAdditionalRawData = serializedAdditionalRawData; } - - /// Initializes a new instance of for deserialization. - internal AISearchIndexResource() - { - } /// Type of query in an AIIndexResource attached to this agent. public AzureAISearchQueryType? QueryType { get; set; } /// Number of documents to retrieve from search and present to the model. diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AzureAISearchResource.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AzureAISearchToolResource.Serialization.cs similarity index 70% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AzureAISearchResource.Serialization.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AzureAISearchToolResource.Serialization.cs index ee236005887d..4f10ee31798a 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AzureAISearchResource.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AzureAISearchToolResource.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Agents.Persistent { - public partial class AzureAISearchResource : IUtf8JsonSerializable, IJsonModel + public partial class AzureAISearchToolResource : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AzureAISearchResource)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AzureAISearchToolResource)} does not support writing '{format}' format."); } if (Optional.IsCollectionDefined(IndexList)) @@ -61,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AzureAISearchResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AzureAISearchToolResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AzureAISearchResource)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AzureAISearchToolResource)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzureAISearchResource(document.RootElement, options); + return DeserializeAzureAISearchToolResource(document.RootElement, options); } - internal static AzureAISearchResource DeserializeAzureAISearchResource(JsonElement element, ModelReaderWriterOptions options = null) + internal static AzureAISearchToolResource DeserializeAzureAISearchToolResource(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -106,46 +106,46 @@ internal static AzureAISearchResource DeserializeAzureAISearchResource(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new AzureAISearchResource(indexes ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new AzureAISearchToolResource(indexes ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureAIAgentsPersistentContext.Default); default: - throw new FormatException($"The model {nameof(AzureAISearchResource)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AzureAISearchToolResource)} does not support writing '{options.Format}' format."); } } - AzureAISearchResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AzureAISearchToolResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAzureAISearchResource(document.RootElement, options); + return DeserializeAzureAISearchToolResource(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AzureAISearchResource)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AzureAISearchToolResource)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; /// Deserializes the model from a raw response. /// The response to deserialize the model from. - internal static AzureAISearchResource FromResponse(Response response) + internal static AzureAISearchToolResource FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAzureAISearchResource(document.RootElement); + return DeserializeAzureAISearchToolResource(document.RootElement); } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AzureAISearchResource.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AzureAISearchToolResource.cs similarity index 89% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AzureAISearchResource.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AzureAISearchToolResource.cs index 1c8d009cbb4e..7e4a89dce0bd 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AzureAISearchResource.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/AzureAISearchToolResource.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Agents.Persistent { /// A set of index resources used by the `azure_ai_search` tool. - public partial class AzureAISearchResource + public partial class AzureAISearchToolResource { /// /// Keeps track of any properties unknown to the library. @@ -45,19 +45,19 @@ public partial class AzureAISearchResource /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public AzureAISearchResource() + /// Initializes a new instance of . + public AzureAISearchToolResource() { IndexList = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// The indices attached to this agent. There can be a maximum of 1 index /// resource attached to the agent. /// /// Keeps track of any properties unknown to the library. - internal AzureAISearchResource(IList indexList, IDictionary serializedAdditionalRawData) + internal AzureAISearchToolResource(IList indexList, IDictionary serializedAdditionalRawData) { IndexList = indexList; _serializedAdditionalRawData = serializedAdditionalRawData; diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchConfiguration.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchConfiguration.Serialization.cs deleted file mode 100644 index ac57ac91f74f..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchConfiguration.Serialization.cs +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Agents.Persistent -{ - public partial class BingCustomSearchConfiguration : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(BingCustomSearchConfiguration)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("connection_id"u8); - writer.WriteStringValue(ConnectionId); - writer.WritePropertyName("instance_name"u8); - writer.WriteStringValue(InstanceName); - if (Optional.IsDefined(Market)) - { - writer.WritePropertyName("market"u8); - writer.WriteStringValue(Market); - } - if (Optional.IsDefined(SetLang)) - { - writer.WritePropertyName("set_lang"u8); - writer.WriteStringValue(SetLang); - } - if (Optional.IsDefined(Count)) - { - writer.WritePropertyName("count"u8); - writer.WriteNumberValue(Count.Value); - } - if (Optional.IsDefined(Freshness)) - { - writer.WritePropertyName("freshness"u8); - writer.WriteStringValue(Freshness); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - BingCustomSearchConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BingCustomSearchConfiguration)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBingCustomSearchConfiguration(document.RootElement, options); - } - - internal static BingCustomSearchConfiguration DeserializeBingCustomSearchConfiguration(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string connectionId = default; - string instanceName = default; - string market = default; - string setLang = default; - long? count = default; - string freshness = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("connection_id"u8)) - { - connectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("instance_name"u8)) - { - instanceName = property.Value.GetString(); - continue; - } - if (property.NameEquals("market"u8)) - { - market = property.Value.GetString(); - continue; - } - if (property.NameEquals("set_lang"u8)) - { - setLang = property.Value.GetString(); - continue; - } - if (property.NameEquals("count"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - count = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("freshness"u8)) - { - freshness = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new BingCustomSearchConfiguration( - connectionId, - instanceName, - market, - setLang, - count, - freshness, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureAIAgentsPersistentContext.Default); - default: - throw new FormatException($"The model {nameof(BingCustomSearchConfiguration)} does not support writing '{options.Format}' format."); - } - } - - BingCustomSearchConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBingCustomSearchConfiguration(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(BingCustomSearchConfiguration)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static BingCustomSearchConfiguration FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBingCustomSearchConfiguration(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchConfiguration.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchConfiguration.cs deleted file mode 100644 index a157244c40fb..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchConfiguration.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Agents.Persistent -{ - /// A bing custom search configuration. - public partial class BingCustomSearchConfiguration - { - /// - /// 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" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Connection id for grounding with bing search. - /// Name of the custom configuration instance given to config. - /// or is null. - public BingCustomSearchConfiguration(string connectionId, string instanceName) - { - Argument.AssertNotNull(connectionId, nameof(connectionId)); - Argument.AssertNotNull(instanceName, nameof(instanceName)); - - ConnectionId = connectionId; - InstanceName = instanceName; - } - - /// Initializes a new instance of . - /// Connection id for grounding with bing search. - /// Name of the custom configuration instance given to config. - /// The market where the results come from. - /// The language to use for user interface strings when calling Bing API. - /// The number of search results to return in the bing api response. - /// Filter search results by a specific time range. Accepted values: https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters. - /// Keeps track of any properties unknown to the library. - internal BingCustomSearchConfiguration(string connectionId, string instanceName, string market, string setLang, long? count, string freshness, IDictionary serializedAdditionalRawData) - { - ConnectionId = connectionId; - InstanceName = instanceName; - Market = market; - SetLang = setLang; - Count = count; - Freshness = freshness; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal BingCustomSearchConfiguration() - { - } - - /// Connection id for grounding with bing search. - public string ConnectionId { get; set; } - /// Name of the custom configuration instance given to config. - public string InstanceName { get; set; } - /// The market where the results come from. - public string Market { get; set; } - /// The language to use for user interface strings when calling Bing API. - public string SetLang { get; set; } - /// The number of search results to return in the bing api response. - public long? Count { get; set; } - /// Filter search results by a specific time range. Accepted values: https://learn.microsoft.com/bing/search-apis/bing-web-search/reference/query-parameters. - public string Freshness { get; set; } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchConfigurationList.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchConfigurationList.Serialization.cs deleted file mode 100644 index 1f16b0532430..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchConfigurationList.Serialization.cs +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Agents.Persistent -{ - public partial class BingCustomSearchConfigurationList : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(BingCustomSearchConfigurationList)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("search_configurations"u8); - writer.WriteStartArray(); - foreach (var item in SearchConfigurations) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - BingCustomSearchConfigurationList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BingCustomSearchConfigurationList)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBingCustomSearchConfigurationList(document.RootElement, options); - } - - internal static BingCustomSearchConfigurationList DeserializeBingCustomSearchConfigurationList(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList searchConfigurations = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("search_configurations"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(BingCustomSearchConfiguration.DeserializeBingCustomSearchConfiguration(item, options)); - } - searchConfigurations = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new BingCustomSearchConfigurationList(searchConfigurations, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureAIAgentsPersistentContext.Default); - default: - throw new FormatException($"The model {nameof(BingCustomSearchConfigurationList)} does not support writing '{options.Format}' format."); - } - } - - BingCustomSearchConfigurationList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBingCustomSearchConfigurationList(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(BingCustomSearchConfigurationList)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static BingCustomSearchConfigurationList FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBingCustomSearchConfigurationList(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchConfigurationList.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchConfigurationList.cs deleted file mode 100644 index ba154aacae2b..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchConfigurationList.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.AI.Agents.Persistent -{ - /// A list of search configurations currently used by the `bing_custom_search` tool. - public partial class BingCustomSearchConfigurationList - { - /// - /// 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" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// - /// The connections attached to this tool. There can be a maximum of 1 connection - /// resource attached to the tool. - /// - /// is null. - public BingCustomSearchConfigurationList(IEnumerable searchConfigurations) - { - Argument.AssertNotNull(searchConfigurations, nameof(searchConfigurations)); - - SearchConfigurations = searchConfigurations.ToList(); - } - - /// Initializes a new instance of . - /// - /// The connections attached to this tool. There can be a maximum of 1 connection - /// resource attached to the tool. - /// - /// Keeps track of any properties unknown to the library. - internal BingCustomSearchConfigurationList(IList searchConfigurations, IDictionary serializedAdditionalRawData) - { - SearchConfigurations = searchConfigurations; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal BingCustomSearchConfigurationList() - { - } - - /// - /// The connections attached to this tool. There can be a maximum of 1 connection - /// resource attached to the tool. - /// - public IList SearchConfigurations { get; } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchToolDefinition.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchToolDefinition.Serialization.cs deleted file mode 100644 index 020abce9e0ea..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchToolDefinition.Serialization.cs +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Agents.Persistent -{ - public partial class BingCustomSearchToolDefinition : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(BingCustomSearchToolDefinition)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("bing_custom_search"u8); - writer.WriteObjectValue(BingCustomSearch, options); - } - - BingCustomSearchToolDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BingCustomSearchToolDefinition)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBingCustomSearchToolDefinition(document.RootElement, options); - } - - internal static BingCustomSearchToolDefinition DeserializeBingCustomSearchToolDefinition(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - BingCustomSearchConfigurationList bingCustomSearch = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("bing_custom_search"u8)) - { - bingCustomSearch = BingCustomSearchConfigurationList.DeserializeBingCustomSearchConfigurationList(property.Value, options); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new BingCustomSearchToolDefinition(type, serializedAdditionalRawData, bingCustomSearch); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureAIAgentsPersistentContext.Default); - default: - throw new FormatException($"The model {nameof(BingCustomSearchToolDefinition)} does not support writing '{options.Format}' format."); - } - } - - BingCustomSearchToolDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBingCustomSearchToolDefinition(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(BingCustomSearchToolDefinition)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new BingCustomSearchToolDefinition FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBingCustomSearchToolDefinition(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchToolDefinition.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchToolDefinition.cs deleted file mode 100644 index 3018f822f2a4..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/BingCustomSearchToolDefinition.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Agents.Persistent -{ - /// The input definition information for a Bing custom search tool as used to configure an agent. - public partial class BingCustomSearchToolDefinition : ToolDefinition - { - /// Initializes a new instance of . - /// The list of search configurations used by the bing custom search tool. - /// is null. - public BingCustomSearchToolDefinition(BingCustomSearchConfigurationList bingCustomSearch) - { - Argument.AssertNotNull(bingCustomSearch, nameof(bingCustomSearch)); - - Type = "bing_custom_search"; - BingCustomSearch = bingCustomSearch; - } - - /// Initializes a new instance of . - /// The object type. - /// Keeps track of any properties unknown to the library. - /// The list of search configurations used by the bing custom search tool. - internal BingCustomSearchToolDefinition(string type, IDictionary serializedAdditionalRawData, BingCustomSearchConfigurationList bingCustomSearch) : base(type, serializedAdditionalRawData) - { - BingCustomSearch = bingCustomSearch; - } - - /// Initializes a new instance of for deserialization. - internal BingCustomSearchToolDefinition() - { - } - - /// The list of search configurations used by the bing custom search tool. - public BingCustomSearchConfigurationList BingCustomSearch { get; set; } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateAgentRequest.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateAgentRequest.cs index 02993f45cecc..14c2a11fbd92 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateAgentRequest.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateAgentRequest.cs @@ -65,7 +65,7 @@ internal CreateAgentRequest(string model) /// /// The collection of tools to enable for the new agent. /// 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 . + /// The available derived classes include , , , , , , and . /// /// /// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter` @@ -115,7 +115,7 @@ internal CreateAgentRequest() /// /// The collection of tools to enable for the new agent. /// 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 . + /// The available derived classes include , , , , , , and . /// public IReadOnlyList Tools { get; } /// diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateRunRequest.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateRunRequest.cs index d6413572c7a9..68dabc3ba735 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateRunRequest.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateRunRequest.cs @@ -70,7 +70,7 @@ internal CreateRunRequest(string assistantId) /// /// The overridden list of enabled tools that the agent should use to run the thread. /// 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 . + /// The available derived classes include , , , , , , and . /// /// /// If `true`, returns a stream of events that happen during the Run as server-sent events, @@ -145,7 +145,7 @@ internal CreateRunRequest() /// /// The overridden list of enabled tools that the agent should use to run the thread. /// 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 . + /// The available derived classes include , , , , , , and . /// public IReadOnlyList OverrideTools { get; } /// diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateThreadAndRunRequest.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateThreadAndRunRequest.Serialization.cs index f08fc03e6b36..440b77ba6ae5 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateThreadAndRunRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateThreadAndRunRequest.Serialization.cs @@ -262,7 +262,7 @@ internal static CreateThreadAndRunRequest DeserializeCreateThreadAndRunRequest(J string model = default; string instructions = default; IReadOnlyList tools = default; - UpdateToolResourcesOptions toolResources = default; + ToolResources toolResources = default; bool? stream = default; float? temperature = default; float? topP = default; @@ -332,7 +332,7 @@ internal static CreateThreadAndRunRequest DeserializeCreateThreadAndRunRequest(J toolResources = null; continue; } - toolResources = UpdateToolResourcesOptions.DeserializeUpdateToolResourcesOptions(property.Value, options); + toolResources = ToolResources.DeserializeToolResources(property.Value, options); continue; } if (property.NameEquals("stream"u8)) diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateThreadAndRunRequest.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateThreadAndRunRequest.cs index 49848d9fc53c..1d5d8ebd9187 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateThreadAndRunRequest.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateThreadAndRunRequest.cs @@ -65,7 +65,7 @@ internal CreateThreadAndRunRequest(string assistantId) /// /// The overridden list of enabled tools the agent should use to run the thread. /// 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 . + /// The available derived classes include , , , , , , and . /// /// Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis. /// @@ -99,7 +99,7 @@ internal CreateThreadAndRunRequest(string assistantId) /// If `true` functions will run in parallel during tool use. /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// Keeps track of any properties unknown to the library. - internal CreateThreadAndRunRequest(string assistantId, PersistentAgentThreadCreationOptions thread, string overrideModelName, string overrideInstructions, IReadOnlyList overrideTools, UpdateToolResourcesOptions toolResources, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, Truncation truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, bool? parallelToolCalls, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) + internal CreateThreadAndRunRequest(string assistantId, PersistentAgentThreadCreationOptions thread, string overrideModelName, string overrideInstructions, IReadOnlyList overrideTools, ToolResources toolResources, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, Truncation truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, bool? parallelToolCalls, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) { AssistantId = assistantId; Thread = thread; @@ -136,11 +136,11 @@ internal CreateThreadAndRunRequest() /// /// The overridden list of enabled tools the agent should use to run the thread. /// 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 . + /// The available derived classes include , , , , , , and . /// public IReadOnlyList OverrideTools { get; } /// Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis. - public UpdateToolResourcesOptions ToolResources { get; } + public ToolResources ToolResources { get; } /// /// If `true`, returns a stream of events that happen during the Run as server-sent events, /// terminating when the Run enters a terminal state with a `data: [DONE]` message. diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MicrosoftFabricToolDefinition.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MicrosoftFabricToolDefinition.Serialization.cs deleted file mode 100644 index a10840a450ee..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MicrosoftFabricToolDefinition.Serialization.cs +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Agents.Persistent -{ - public partial class MicrosoftFabricToolDefinition : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(MicrosoftFabricToolDefinition)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("fabric_dataagent"u8); - writer.WriteObjectValue(FabricDataagent, options); - } - - MicrosoftFabricToolDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MicrosoftFabricToolDefinition)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMicrosoftFabricToolDefinition(document.RootElement, options); - } - - internal static MicrosoftFabricToolDefinition DeserializeMicrosoftFabricToolDefinition(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ToolConnectionList fabricDataagent = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("fabric_dataagent"u8)) - { - fabricDataagent = ToolConnectionList.DeserializeToolConnectionList(property.Value, options); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MicrosoftFabricToolDefinition(type, serializedAdditionalRawData, fabricDataagent); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureAIAgentsPersistentContext.Default); - default: - throw new FormatException($"The model {nameof(MicrosoftFabricToolDefinition)} does not support writing '{options.Format}' format."); - } - } - - MicrosoftFabricToolDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMicrosoftFabricToolDefinition(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MicrosoftFabricToolDefinition)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new MicrosoftFabricToolDefinition FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMicrosoftFabricToolDefinition(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MicrosoftFabricToolDefinition.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MicrosoftFabricToolDefinition.cs deleted file mode 100644 index 2cddbbe72198..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MicrosoftFabricToolDefinition.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Agents.Persistent -{ - /// The input definition information for a Microsoft Fabric tool as used to configure an agent. - public partial class MicrosoftFabricToolDefinition : ToolDefinition - { - /// Initializes a new instance of . - /// The list of connections used by the Microsoft Fabric tool. - /// is null. - public MicrosoftFabricToolDefinition(ToolConnectionList fabricDataagent) - { - Argument.AssertNotNull(fabricDataagent, nameof(fabricDataagent)); - - Type = "fabric_dataagent"; - FabricDataagent = fabricDataagent; - } - - /// Initializes a new instance of . - /// The object type. - /// Keeps track of any properties unknown to the library. - /// The list of connections used by the Microsoft Fabric tool. - internal MicrosoftFabricToolDefinition(string type, IDictionary serializedAdditionalRawData, ToolConnectionList fabricDataagent) : base(type, serializedAdditionalRawData) - { - FabricDataagent = fabricDataagent; - } - - /// Initializes a new instance of for deserialization. - internal MicrosoftFabricToolDefinition() - { - } - - /// The list of connections used by the Microsoft Fabric tool. - public ToolConnectionList FabricDataagent { get; set; } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgent.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgent.cs index 027c8084d20e..525d7fa2d10c 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgent.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgent.cs @@ -56,7 +56,7 @@ public partial class PersistentAgent /// /// The collection of tools enabled for the agent. /// 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 . + /// The available derived classes include , , , , , , and . /// /// /// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter` @@ -104,7 +104,7 @@ internal PersistentAgent(string id, DateTimeOffset createdAt, string name, strin /// /// The collection of tools enabled for the agent. /// 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 . + /// The available derived classes include , , , , , , and . /// /// /// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter` @@ -162,7 +162,7 @@ internal PersistentAgent() /// /// The collection of tools enabled for the agent. /// 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 . + /// The available derived classes include , , , , , , and . /// public IReadOnlyList Tools { get; } /// diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsAdministrationClient.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsAdministrationClient.cs index c8044893c160..470a61bf967e 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsAdministrationClient.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsAdministrationClient.cs @@ -417,7 +417,7 @@ internal virtual Response InternalDeleteAgent(string assistantId, RequestContext /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// The cancellation token to use. /// is null. - internal virtual async Task> CreateThreadAndRunAsync(string assistantId, PersistentAgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, IEnumerable overrideTools = null, UpdateToolResourcesOptions toolResources = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, Truncation truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + internal virtual async Task> CreateThreadAndRunAsync(string assistantId, PersistentAgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, IEnumerable overrideTools = null, ToolResources toolResources = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, Truncation truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(assistantId, nameof(assistantId)); @@ -483,7 +483,7 @@ internal virtual async Task> CreateThreadAndRunAsync(string /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. /// The cancellation token to use. /// is null. - internal virtual Response CreateThreadAndRun(string assistantId, PersistentAgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, IEnumerable overrideTools = null, UpdateToolResourcesOptions toolResources = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, Truncation truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + internal virtual Response CreateThreadAndRun(string assistantId, PersistentAgentThreadCreationOptions thread = null, string overrideModelName = null, string overrideInstructions = null, IEnumerable overrideTools = null, ToolResources toolResources = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, Truncation truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(assistantId, nameof(assistantId)); @@ -520,7 +520,7 @@ internal virtual Response CreateThreadAndRun(string assistantId, Pers /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -558,7 +558,7 @@ internal virtual async Task CreateThreadAndRunAsync(RequestContent con /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsAdministrationClientOptions.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsAdministrationClientOptions.cs index 41280307fd81..9cb1de8e0318 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsAdministrationClientOptions.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsAdministrationClientOptions.cs @@ -13,15 +13,15 @@ namespace Azure.AI.Agents.Persistent /// Client options for PersistentAgentsAdministrationClient. public partial class PersistentAgentsAdministrationClientOptions : ClientOptions { - private const ServiceVersion LatestVersion = ServiceVersion.V2025_05_15_Preview; + private const ServiceVersion LatestVersion = ServiceVersion.V1; /// The version of the service to use. public enum ServiceVersion { /// Service version "2025-05-01". V2025_05_01 = 1, - /// Service version "2025-05-15-preview". - V2025_05_15_Preview = 2, + /// Service version "v1". + V1 = 2, } internal string Version { get; } @@ -32,7 +32,7 @@ public PersistentAgentsAdministrationClientOptions(ServiceVersion version = Late Version = version switch { ServiceVersion.V2025_05_01 => "2025-05-01", - ServiceVersion.V2025_05_15_Preview => "2025-05-15-preview", + ServiceVersion.V1 => "v1", _ => throw new NotSupportedException() }; } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsModelFactory.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsModelFactory.cs index 725a519c9941..ec9be61f12bf 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsModelFactory.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsModelFactory.cs @@ -217,7 +217,7 @@ public static RunStepMessageCreationReference RunStepMessageCreationReference(st /// /// A list of tool call details for this run step. /// 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 . + /// The available derived classes include , , , , and . /// /// A new instance for mocking. public static RunStepToolCallDetails RunStepToolCallDetails(IEnumerable toolCalls = null) @@ -324,39 +324,6 @@ public static RunStepAzureAISearchToolCall RunStepAzureAISearchToolCall(string i return new RunStepAzureAISearchToolCall("azure_ai_search", id, serializedAdditionalRawData: null, azureAISearch); } - /// Initializes a new instance of . - /// The ID of the tool call. This ID must be referenced when you submit tool outputs. - /// Reserved for future use. - /// A new instance for mocking. - public static RunStepSharepointToolCall RunStepSharepointToolCall(string id = null, IReadOnlyDictionary sharePoint = null) - { - sharePoint ??= new Dictionary(); - - return new RunStepSharepointToolCall("sharepoint_grounding", id, serializedAdditionalRawData: null, sharePoint); - } - - /// Initializes a new instance of . - /// The ID of the tool call. This ID must be referenced when you submit tool outputs. - /// Reserved for future use. - /// A new instance for mocking. - public static RunStepMicrosoftFabricToolCall RunStepMicrosoftFabricToolCall(string id = null, IReadOnlyDictionary microsoftFabric = null) - { - microsoftFabric ??= new Dictionary(); - - return new RunStepMicrosoftFabricToolCall("fabric_dataagent", id, serializedAdditionalRawData: null, microsoftFabric); - } - - /// Initializes a new instance of . - /// The ID of the tool call. This ID must be referenced when you submit tool outputs. - /// Reserved for future use. - /// A new instance for mocking. - public static RunStepBingCustomSearchToolCall RunStepBingCustomSearchToolCall(string id = null, IReadOnlyDictionary bingCustomSearch = null) - { - bingCustomSearch ??= new Dictionary(); - - return new RunStepBingCustomSearchToolCall("bing_custom_search", id, serializedAdditionalRawData: null, bingCustomSearch); - } - /// Initializes a new instance of . /// The ID of the tool call. This ID must be referenced when you submit tool outputs. /// Reserved for future use. diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsNamedToolChoiceType.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsNamedToolChoiceType.cs index 5abd0fa864fd..98fc2b8551af 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsNamedToolChoiceType.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsNamedToolChoiceType.cs @@ -25,9 +25,6 @@ public PersistentAgentsNamedToolChoiceType(string value) private const string FunctionValue = "function"; private const string CodeInterpreterValue = "code_interpreter"; private const string FileSearchValue = "file_search"; - private const string BingGroundingValue = "bing_grounding"; - private const string MicrosoftFabricValue = "fabric_dataagent"; - private const string SharepointValue = "sharepoint_grounding"; private const string AzureAISearchValue = "azure_ai_search"; private const string BingCustomSearchValue = "bing_custom_search"; private const string ConnectedAgentValue = "connected_agent"; @@ -38,12 +35,6 @@ public PersistentAgentsNamedToolChoiceType(string value) public static PersistentAgentsNamedToolChoiceType CodeInterpreter { get; } = new PersistentAgentsNamedToolChoiceType(CodeInterpreterValue); /// Tool type `file_search`. public static PersistentAgentsNamedToolChoiceType FileSearch { get; } = new PersistentAgentsNamedToolChoiceType(FileSearchValue); - /// Tool type `bing_grounding`. - public static PersistentAgentsNamedToolChoiceType BingGrounding { get; } = new PersistentAgentsNamedToolChoiceType(BingGroundingValue); - /// Tool type `fabric_dataagent`. - public static PersistentAgentsNamedToolChoiceType MicrosoftFabric { get; } = new PersistentAgentsNamedToolChoiceType(MicrosoftFabricValue); - /// Tool type `sharepoint_grounding`. - public static PersistentAgentsNamedToolChoiceType Sharepoint { get; } = new PersistentAgentsNamedToolChoiceType(SharepointValue); /// Tool type `azure_ai_search`. public static PersistentAgentsNamedToolChoiceType AzureAISearch { get; } = new PersistentAgentsNamedToolChoiceType(AzureAISearchValue); /// Tool type `bing_custom_search`. diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepBingCustomSearchToolCall.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepBingCustomSearchToolCall.Serialization.cs deleted file mode 100644 index a9919d4bfecf..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepBingCustomSearchToolCall.Serialization.cs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Agents.Persistent -{ - public partial class RunStepBingCustomSearchToolCall : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepBingCustomSearchToolCall)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("bing_custom_search"u8); - writer.WriteStartObject(); - foreach (var item in BingCustomSearch) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - - RunStepBingCustomSearchToolCall IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepBingCustomSearchToolCall)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepBingCustomSearchToolCall(document.RootElement, options); - } - - internal static RunStepBingCustomSearchToolCall DeserializeRunStepBingCustomSearchToolCall(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyDictionary bingCustomSearch = default; - string type = default; - string id = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("bing_custom_search"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - bingCustomSearch = dictionary; - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunStepBingCustomSearchToolCall(type, id, serializedAdditionalRawData, bingCustomSearch); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureAIAgentsPersistentContext.Default); - default: - throw new FormatException($"The model {nameof(RunStepBingCustomSearchToolCall)} does not support writing '{options.Format}' format."); - } - } - - RunStepBingCustomSearchToolCall IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRunStepBingCustomSearchToolCall(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepBingCustomSearchToolCall)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new RunStepBingCustomSearchToolCall FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRunStepBingCustomSearchToolCall(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepBingCustomSearchToolCall.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepBingCustomSearchToolCall.cs deleted file mode 100644 index 7c628d9d04a6..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepBingCustomSearchToolCall.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Agents.Persistent -{ - /// - /// A record of a call to a bing custom search tool, issued by the model in evaluation of a defined tool, that represents - /// executed search with bing custom search. - /// - public partial class RunStepBingCustomSearchToolCall : RunStepToolCall - { - /// Initializes a new instance of . - /// The ID of the tool call. This ID must be referenced when you submit tool outputs. - /// Reserved for future use. - /// or is null. - internal RunStepBingCustomSearchToolCall(string id, IReadOnlyDictionary bingCustomSearch) : base(id) - { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(bingCustomSearch, nameof(bingCustomSearch)); - - Type = "bing_custom_search"; - BingCustomSearch = bingCustomSearch; - } - - /// Initializes a new instance of . - /// The object type. - /// The ID of the tool call. This ID must be referenced when you submit tool outputs. - /// Keeps track of any properties unknown to the library. - /// Reserved for future use. - internal RunStepBingCustomSearchToolCall(string type, string id, IDictionary serializedAdditionalRawData, IReadOnlyDictionary bingCustomSearch) : base(type, id, serializedAdditionalRawData) - { - BingCustomSearch = bingCustomSearch; - } - - /// Initializes a new instance of for deserialization. - internal RunStepBingCustomSearchToolCall() - { - } - - /// Reserved for future use. - public IReadOnlyDictionary BingCustomSearch { get; } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepMicrosoftFabricToolCall.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepMicrosoftFabricToolCall.Serialization.cs deleted file mode 100644 index 8bce669c0034..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepMicrosoftFabricToolCall.Serialization.cs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Agents.Persistent -{ - public partial class RunStepMicrosoftFabricToolCall : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepMicrosoftFabricToolCall)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("fabric_dataagent"u8); - writer.WriteStartObject(); - foreach (var item in MicrosoftFabric) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - - RunStepMicrosoftFabricToolCall IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepMicrosoftFabricToolCall)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepMicrosoftFabricToolCall(document.RootElement, options); - } - - internal static RunStepMicrosoftFabricToolCall DeserializeRunStepMicrosoftFabricToolCall(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyDictionary fabricDataagent = default; - string type = default; - string id = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("fabric_dataagent"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - fabricDataagent = dictionary; - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunStepMicrosoftFabricToolCall(type, id, serializedAdditionalRawData, fabricDataagent); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureAIAgentsPersistentContext.Default); - default: - throw new FormatException($"The model {nameof(RunStepMicrosoftFabricToolCall)} does not support writing '{options.Format}' format."); - } - } - - RunStepMicrosoftFabricToolCall IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRunStepMicrosoftFabricToolCall(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepMicrosoftFabricToolCall)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new RunStepMicrosoftFabricToolCall FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRunStepMicrosoftFabricToolCall(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepMicrosoftFabricToolCall.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepMicrosoftFabricToolCall.cs deleted file mode 100644 index a78260a4ae24..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepMicrosoftFabricToolCall.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Agents.Persistent -{ - /// - /// A record of a call to a Microsoft Fabric tool, issued by the model in evaluation of a defined tool, that represents - /// executed Microsoft Fabric operations. - /// - public partial class RunStepMicrosoftFabricToolCall : RunStepToolCall - { - /// Initializes a new instance of . - /// The ID of the tool call. This ID must be referenced when you submit tool outputs. - /// Reserved for future use. - /// or is null. - internal RunStepMicrosoftFabricToolCall(string id, IReadOnlyDictionary microsoftFabric) : base(id) - { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(microsoftFabric, nameof(microsoftFabric)); - - Type = "fabric_dataagent"; - MicrosoftFabric = microsoftFabric; - } - - /// Initializes a new instance of . - /// The object type. - /// The ID of the tool call. This ID must be referenced when you submit tool outputs. - /// Keeps track of any properties unknown to the library. - /// Reserved for future use. - internal RunStepMicrosoftFabricToolCall(string type, string id, IDictionary serializedAdditionalRawData, IReadOnlyDictionary microsoftFabric) : base(type, id, serializedAdditionalRawData) - { - MicrosoftFabric = microsoftFabric; - } - - /// Initializes a new instance of for deserialization. - internal RunStepMicrosoftFabricToolCall() - { - } - - /// Reserved for future use. - public IReadOnlyDictionary MicrosoftFabric { get; } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepSharepointToolCall.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepSharepointToolCall.Serialization.cs deleted file mode 100644 index aa1aaf4b6af4..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepSharepointToolCall.Serialization.cs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Agents.Persistent -{ - public partial class RunStepSharepointToolCall : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepSharepointToolCall)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("sharepoint_grounding"u8); - writer.WriteStartObject(); - foreach (var item in SharePoint) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - - RunStepSharepointToolCall IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepSharepointToolCall)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepSharepointToolCall(document.RootElement, options); - } - - internal static RunStepSharepointToolCall DeserializeRunStepSharepointToolCall(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyDictionary sharepointGrounding = default; - string type = default; - string id = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sharepoint_grounding"u8)) - { - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - sharepointGrounding = dictionary; - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunStepSharepointToolCall(type, id, serializedAdditionalRawData, sharepointGrounding); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureAIAgentsPersistentContext.Default); - default: - throw new FormatException($"The model {nameof(RunStepSharepointToolCall)} does not support writing '{options.Format}' format."); - } - } - - RunStepSharepointToolCall IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRunStepSharepointToolCall(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepSharepointToolCall)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new RunStepSharepointToolCall FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRunStepSharepointToolCall(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepSharepointToolCall.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepSharepointToolCall.cs deleted file mode 100644 index 43a2c6932b4b..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepSharepointToolCall.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Agents.Persistent -{ - /// - /// A record of a call to a SharePoint tool, issued by the model in evaluation of a defined tool, that represents - /// executed SharePoint actions. - /// - public partial class RunStepSharepointToolCall : RunStepToolCall - { - /// Initializes a new instance of . - /// The ID of the tool call. This ID must be referenced when you submit tool outputs. - /// Reserved for future use. - /// or is null. - internal RunStepSharepointToolCall(string id, IReadOnlyDictionary sharePoint) : base(id) - { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(sharePoint, nameof(sharePoint)); - - Type = "sharepoint_grounding"; - SharePoint = sharePoint; - } - - /// Initializes a new instance of . - /// The object type. - /// The ID of the tool call. This ID must be referenced when you submit tool outputs. - /// Keeps track of any properties unknown to the library. - /// Reserved for future use. - internal RunStepSharepointToolCall(string type, string id, IDictionary serializedAdditionalRawData, IReadOnlyDictionary sharePoint) : base(type, id, serializedAdditionalRawData) - { - SharePoint = sharePoint; - } - - /// Initializes a new instance of for deserialization. - internal RunStepSharepointToolCall() - { - } - - /// Reserved for future use. - public IReadOnlyDictionary SharePoint { get; } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepToolCall.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepToolCall.Serialization.cs index 75934e58dfca..a691ba0270f9 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepToolCall.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepToolCall.Serialization.cs @@ -80,14 +80,11 @@ internal static RunStepToolCall DeserializeRunStepToolCall(JsonElement element, switch (discriminator.GetString()) { case "azure_ai_search": return RunStepAzureAISearchToolCall.DeserializeRunStepAzureAISearchToolCall(element, options); - case "bing_custom_search": return RunStepBingCustomSearchToolCall.DeserializeRunStepBingCustomSearchToolCall(element, options); case "bing_grounding": return RunStepBingGroundingToolCall.DeserializeRunStepBingGroundingToolCall(element, options); case "code_interpreter": return RunStepCodeInterpreterToolCall.DeserializeRunStepCodeInterpreterToolCall(element, options); - case "fabric_dataagent": return RunStepMicrosoftFabricToolCall.DeserializeRunStepMicrosoftFabricToolCall(element, options); case "file_search": return RunStepFileSearchToolCall.DeserializeRunStepFileSearchToolCall(element, options); case "function": return RunStepFunctionToolCall.DeserializeRunStepFunctionToolCall(element, options); case "openapi": return RunStepOpenAPIToolCall.DeserializeRunStepOpenAPIToolCall(element, options); - case "sharepoint_grounding": return RunStepSharepointToolCall.DeserializeRunStepSharepointToolCall(element, options); } } return UnknownRunStepToolCall.DeserializeUnknownRunStepToolCall(element, options); diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepToolCall.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepToolCall.cs index 2baae9a8d283..f8e3e27b1338 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepToolCall.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepToolCall.cs @@ -13,7 +13,7 @@ namespace Azure.AI.Agents.Persistent /// /// An abstract representation of a detailed tool call as recorded within a run step for an existing run. /// 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 . + /// The available derived classes include , , , , and . /// public abstract partial class RunStepToolCall { diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepToolCallDetails.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepToolCallDetails.cs index efea73eed8eb..08bfe0d6e0d5 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepToolCallDetails.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepToolCallDetails.cs @@ -18,7 +18,7 @@ public partial class RunStepToolCallDetails : RunStepDetails /// /// A list of tool call details for this run step. /// 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 . + /// The available derived classes include , , , , and . /// /// is null. internal RunStepToolCallDetails(IEnumerable toolCalls) @@ -35,7 +35,7 @@ internal RunStepToolCallDetails(IEnumerable toolCalls) /// /// A list of tool call details for this run step. /// 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 . + /// The available derived classes include , , , , and . /// internal RunStepToolCallDetails(RunStepType type, IDictionary serializedAdditionalRawData, IReadOnlyList toolCalls) : base(type, serializedAdditionalRawData) { @@ -50,7 +50,7 @@ internal RunStepToolCallDetails() /// /// A list of tool call details for this run step. /// 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 . + /// The available derived classes include , , , , and . /// public IReadOnlyList ToolCalls { get; } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/SharepointToolDefinition.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/SharepointToolDefinition.Serialization.cs deleted file mode 100644 index 6a039775a53f..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/SharepointToolDefinition.Serialization.cs +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Agents.Persistent -{ - public partial class SharepointToolDefinition : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(SharepointToolDefinition)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("sharepoint_grounding"u8); - writer.WriteObjectValue(SharepointGrounding, options); - } - - SharepointToolDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(SharepointToolDefinition)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSharepointToolDefinition(document.RootElement, options); - } - - internal static SharepointToolDefinition DeserializeSharepointToolDefinition(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ToolConnectionList sharepointGrounding = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sharepoint_grounding"u8)) - { - sharepointGrounding = ToolConnectionList.DeserializeToolConnectionList(property.Value, options); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new SharepointToolDefinition(type, serializedAdditionalRawData, sharepointGrounding); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureAIAgentsPersistentContext.Default); - default: - throw new FormatException($"The model {nameof(SharepointToolDefinition)} does not support writing '{options.Format}' format."); - } - } - - SharepointToolDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeSharepointToolDefinition(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(SharepointToolDefinition)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new SharepointToolDefinition FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeSharepointToolDefinition(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/SharepointToolDefinition.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/SharepointToolDefinition.cs deleted file mode 100644 index d537d9561dc5..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/SharepointToolDefinition.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Agents.Persistent -{ - /// The input definition information for a sharepoint tool as used to configure an agent. - public partial class SharepointToolDefinition : ToolDefinition - { - /// Initializes a new instance of . - /// The list of connections used by the SharePoint tool. - /// is null. - public SharepointToolDefinition(ToolConnectionList sharepointGrounding) - { - Argument.AssertNotNull(sharepointGrounding, nameof(sharepointGrounding)); - - Type = "sharepoint_grounding"; - SharepointGrounding = sharepointGrounding; - } - - /// Initializes a new instance of . - /// The object type. - /// Keeps track of any properties unknown to the library. - /// The list of connections used by the SharePoint tool. - internal SharepointToolDefinition(string type, IDictionary serializedAdditionalRawData, ToolConnectionList sharepointGrounding) : base(type, serializedAdditionalRawData) - { - SharepointGrounding = sharepointGrounding; - } - - /// Initializes a new instance of for deserialization. - internal SharepointToolDefinition() - { - } - - /// The list of connections used by the SharePoint tool. - public ToolConnectionList SharepointGrounding { get; set; } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadRun.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadRun.Serialization.cs index c4a4245b9c3a..5b64907ce6f0 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadRun.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadRun.Serialization.cs @@ -316,7 +316,7 @@ internal static ThreadRun DeserializeThreadRun(JsonElement element, ModelReaderW BinaryData toolChoice = default; BinaryData responseFormat = default; IReadOnlyDictionary metadata = default; - UpdateToolResourcesOptions toolResources = default; + ToolResources toolResources = default; bool parallelToolCalls = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -529,7 +529,7 @@ internal static ThreadRun DeserializeThreadRun(JsonElement element, ModelReaderW toolResources = null; continue; } - toolResources = UpdateToolResourcesOptions.DeserializeUpdateToolResourcesOptions(property.Value, options); + toolResources = ToolResources.DeserializeToolResources(property.Value, options); continue; } if (property.NameEquals("parallel_tool_calls"u8)) diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadRun.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadRun.cs index 195dfe8c9d4d..7c927e9a8cdf 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadRun.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadRun.cs @@ -57,7 +57,7 @@ public partial class ThreadRun /// /// The overridden enabled tools used for this agent thread run. /// 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 . + /// The available derived classes include , , , , , , and . /// /// The Unix timestamp, in seconds, representing when this object was created. /// The Unix timestamp, in seconds, representing when this item expires. @@ -126,7 +126,7 @@ internal ThreadRun(string id, string threadId, string assistantId, RunStatus sta /// /// The overridden enabled tools used for this agent thread run. /// 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 . + /// The available derived classes include , , , , , , and . /// /// The Unix timestamp, in seconds, representing when this object was created. /// The Unix timestamp, in seconds, representing when this item expires. @@ -147,7 +147,7 @@ internal ThreadRun(string id, string threadId, string assistantId, RunStatus sta /// Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis. /// Determines if tools can be executed in parallel within the run. /// Keeps track of any properties unknown to the library. - internal ThreadRun(string id, string @object, string threadId, string assistantId, RunStatus status, RequiredAction requiredAction, RunError lastError, string model, string instructions, IReadOnlyList tools, DateTimeOffset createdAt, DateTimeOffset? expiresAt, DateTimeOffset? startedAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, IncompleteRunDetails incompleteDetails, RunCompletionUsage usage, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, Truncation truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, UpdateToolResourcesOptions toolResources, bool parallelToolCalls, IDictionary serializedAdditionalRawData) + internal ThreadRun(string id, string @object, string threadId, string assistantId, RunStatus status, RequiredAction requiredAction, RunError lastError, string model, string instructions, IReadOnlyList tools, DateTimeOffset createdAt, DateTimeOffset? expiresAt, DateTimeOffset? startedAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, IncompleteRunDetails incompleteDetails, RunCompletionUsage usage, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, Truncation truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, ToolResources toolResources, bool parallelToolCalls, IDictionary serializedAdditionalRawData) { Id = id; Object = @object; @@ -209,7 +209,7 @@ internal ThreadRun() /// /// The overridden enabled tools used for this agent thread run. /// 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 . + /// The available derived classes include , , , , , , and . /// public IReadOnlyList Tools { get; } /// The Unix timestamp, in seconds, representing when this object was created. @@ -334,7 +334,7 @@ internal ThreadRun() /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. public IReadOnlyDictionary Metadata { get; } /// Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis. - public UpdateToolResourcesOptions ToolResources { get; } + public ToolResources ToolResources { get; } /// Determines if tools can be executed in parallel within the run. public bool ParallelToolCalls { get; } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolConnection.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolConnection.Serialization.cs deleted file mode 100644 index 76ae573eabcc..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolConnection.Serialization.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Agents.Persistent -{ - public partial class ToolConnection : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(ToolConnection)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("connection_id"u8); - writer.WriteStringValue(ConnectionId); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - ToolConnection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ToolConnection)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeToolConnection(document.RootElement, options); - } - - internal static ToolConnection DeserializeToolConnection(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string connectionId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("connection_id"u8)) - { - connectionId = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ToolConnection(connectionId, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureAIAgentsPersistentContext.Default); - default: - throw new FormatException($"The model {nameof(ToolConnection)} does not support writing '{options.Format}' format."); - } - } - - ToolConnection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeToolConnection(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ToolConnection)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ToolConnection FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeToolConnection(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolConnection.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolConnection.cs deleted file mode 100644 index cc6f72bb901c..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolConnection.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Agents.Persistent -{ - /// A connection resource. - public partial class ToolConnection - { - /// - /// 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" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// A connection in a ToolConnectionList attached to this tool. - /// is null. - public ToolConnection(string connectionId) - { - Argument.AssertNotNull(connectionId, nameof(connectionId)); - - ConnectionId = connectionId; - } - - /// Initializes a new instance of . - /// A connection in a ToolConnectionList attached to this tool. - /// Keeps track of any properties unknown to the library. - internal ToolConnection(string connectionId, IDictionary serializedAdditionalRawData) - { - ConnectionId = connectionId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ToolConnection() - { - } - - /// A connection in a ToolConnectionList attached to this tool. - public string ConnectionId { get; set; } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolConnectionList.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolConnectionList.Serialization.cs deleted file mode 100644 index 0d4ac6da1f05..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolConnectionList.Serialization.cs +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Agents.Persistent -{ - public partial class ToolConnectionList : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(ToolConnectionList)} does not support writing '{format}' format."); - } - - if (Optional.IsCollectionDefined(ConnectionList)) - { - writer.WritePropertyName("connections"u8); - writer.WriteStartArray(); - foreach (var item in ConnectionList) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - ToolConnectionList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ToolConnectionList)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeToolConnectionList(document.RootElement, options); - } - - internal static ToolConnectionList DeserializeToolConnectionList(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList connections = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("connections"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ToolConnection.DeserializeToolConnection(item, options)); - } - connections = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ToolConnectionList(connections ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureAIAgentsPersistentContext.Default); - default: - throw new FormatException($"The model {nameof(ToolConnectionList)} does not support writing '{options.Format}' format."); - } - } - - ToolConnectionList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeToolConnectionList(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ToolConnectionList)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static ToolConnectionList FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeToolConnectionList(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolConnectionList.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolConnectionList.cs deleted file mode 100644 index a6dfc67c583d..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolConnectionList.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Agents.Persistent -{ - /// A set of connection resources currently used by either the `bing_grounding`, `fabric_dataagent`, or `sharepoint_grounding` tools. - public partial class ToolConnectionList - { - /// - /// 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" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ToolConnectionList() - { - ConnectionList = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// - /// The connections attached to this tool. There can be a maximum of 1 connection - /// resource attached to the tool. - /// - /// Keeps track of any properties unknown to the library. - internal ToolConnectionList(IList connectionList, IDictionary serializedAdditionalRawData) - { - ConnectionList = connectionList; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// - /// The connections attached to this tool. There can be a maximum of 1 connection - /// resource attached to the tool. - /// - public IList ConnectionList { get; } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolDefinition.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolDefinition.Serialization.cs index 6532e2849db9..30a08ddf2a8d 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolDefinition.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolDefinition.Serialization.cs @@ -79,15 +79,12 @@ internal static ToolDefinition DeserializeToolDefinition(JsonElement element, Mo { case "azure_ai_search": return AzureAISearchToolDefinition.DeserializeAzureAISearchToolDefinition(element, options); case "azure_function": return AzureFunctionToolDefinition.DeserializeAzureFunctionToolDefinition(element, options); - case "bing_custom_search": return BingCustomSearchToolDefinition.DeserializeBingCustomSearchToolDefinition(element, options); case "bing_grounding": return BingGroundingToolDefinition.DeserializeBingGroundingToolDefinition(element, options); case "code_interpreter": return CodeInterpreterToolDefinition.DeserializeCodeInterpreterToolDefinition(element, options); case "connected_agent": return ConnectedAgentToolDefinition.DeserializeConnectedAgentToolDefinition(element, options); - case "fabric_dataagent": return MicrosoftFabricToolDefinition.DeserializeMicrosoftFabricToolDefinition(element, options); case "file_search": return FileSearchToolDefinition.DeserializeFileSearchToolDefinition(element, options); case "function": return FunctionToolDefinition.DeserializeFunctionToolDefinition(element, options); case "openapi": return OpenApiToolDefinition.DeserializeOpenApiToolDefinition(element, options); - case "sharepoint_grounding": return SharepointToolDefinition.DeserializeSharepointToolDefinition(element, options); } } return UnknownToolDefinition.DeserializeUnknownToolDefinition(element, options); diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolDefinition.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolDefinition.cs index a632f3baa004..4d5d6347f9f6 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolDefinition.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolDefinition.cs @@ -13,7 +13,7 @@ namespace Azure.AI.Agents.Persistent /// /// An abstract representation of an input tool definition that an agent can use. /// 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 . + /// The available derived classes include , , , , , , and . /// public abstract partial class ToolDefinition { diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolResources.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolResources.Serialization.cs index 8ea877d7f294..0750da4cdee9 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolResources.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolResources.Serialization.cs @@ -88,7 +88,7 @@ internal static ToolResources DeserializeToolResources(JsonElement element, Mode } CodeInterpreterToolResource codeInterpreter = default; FileSearchToolResource fileSearch = default; - AzureAISearchResource azureAiSearch = default; + AzureAISearchToolResource azureAiSearch = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -117,7 +117,7 @@ internal static ToolResources DeserializeToolResources(JsonElement element, Mode { continue; } - azureAiSearch = AzureAISearchResource.DeserializeAzureAISearchResource(property.Value, options); + azureAiSearch = AzureAISearchToolResource.DeserializeAzureAISearchToolResource(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolResources.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolResources.cs index b4932dbc99d5..4e6fa850ae9b 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolResources.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ToolResources.cs @@ -59,7 +59,7 @@ public ToolResources() /// Resources to be used by the `file_search` tool consisting of vector store IDs. /// Resources to be used by the `azure_ai_search` tool consisting of index IDs and names. /// Keeps track of any properties unknown to the library. - internal ToolResources(CodeInterpreterToolResource codeInterpreter, FileSearchToolResource fileSearch, AzureAISearchResource azureAISearch, IDictionary serializedAdditionalRawData) + internal ToolResources(CodeInterpreterToolResource codeInterpreter, FileSearchToolResource fileSearch, AzureAISearchToolResource azureAISearch, IDictionary serializedAdditionalRawData) { CodeInterpreter = codeInterpreter; FileSearch = fileSearch; @@ -72,6 +72,6 @@ internal ToolResources(CodeInterpreterToolResource codeInterpreter, FileSearchTo /// Resources to be used by the `file_search` tool consisting of vector store IDs. public FileSearchToolResource FileSearch { get; set; } /// Resources to be used by the `azure_ai_search` tool consisting of index IDs and names. - public AzureAISearchResource AzureAISearch { get; set; } + public AzureAISearchToolResource AzureAISearch { get; set; } } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateAgentRequest.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateAgentRequest.cs index 7b84d42ae316..4d769e19309a 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateAgentRequest.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateAgentRequest.cs @@ -60,7 +60,7 @@ internal UpdateAgentRequest() /// /// The modified collection of tools to enable for the agent. /// 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 . + /// The available derived classes include , , , , , , and . /// /// /// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, @@ -105,7 +105,7 @@ internal UpdateAgentRequest(string model, string name, string description, strin /// /// The modified collection of tools to enable for the agent. /// 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 . + /// The available derived classes include , , , , , , and . /// public IReadOnlyList Tools { get; } /// diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateCodeInterpreterToolResourceOptions.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateCodeInterpreterToolResourceOptions.Serialization.cs deleted file mode 100644 index 5e4fae6a5921..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateCodeInterpreterToolResourceOptions.Serialization.cs +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Agents.Persistent -{ - public partial class UpdateCodeInterpreterToolResourceOptions : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(UpdateCodeInterpreterToolResourceOptions)} does not support writing '{format}' format."); - } - - if (Optional.IsCollectionDefined(FileIds)) - { - writer.WritePropertyName("file_ids"u8); - writer.WriteStartArray(); - foreach (var item in FileIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - UpdateCodeInterpreterToolResourceOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(UpdateCodeInterpreterToolResourceOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeUpdateCodeInterpreterToolResourceOptions(document.RootElement, options); - } - - internal static UpdateCodeInterpreterToolResourceOptions DeserializeUpdateCodeInterpreterToolResourceOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList fileIds = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("file_ids"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - fileIds = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UpdateCodeInterpreterToolResourceOptions(fileIds ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureAIAgentsPersistentContext.Default); - default: - throw new FormatException($"The model {nameof(UpdateCodeInterpreterToolResourceOptions)} does not support writing '{options.Format}' format."); - } - } - - UpdateCodeInterpreterToolResourceOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeUpdateCodeInterpreterToolResourceOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(UpdateCodeInterpreterToolResourceOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static UpdateCodeInterpreterToolResourceOptions FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeUpdateCodeInterpreterToolResourceOptions(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateCodeInterpreterToolResourceOptions.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateCodeInterpreterToolResourceOptions.cs deleted file mode 100644 index 1f9bea0cb5c5..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateCodeInterpreterToolResourceOptions.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Agents.Persistent -{ - /// Request object to update `code_interpreted` tool resources. - public partial class UpdateCodeInterpreterToolResourceOptions - { - /// - /// 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" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public UpdateCodeInterpreterToolResourceOptions() - { - FileIds = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// A list of file IDs to override the current list of the agent. - /// Keeps track of any properties unknown to the library. - internal UpdateCodeInterpreterToolResourceOptions(IList fileIds, IDictionary serializedAdditionalRawData) - { - FileIds = fileIds; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// A list of file IDs to override the current list of the agent. - public IList FileIds { get; } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateFileSearchToolResourceOptions.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateFileSearchToolResourceOptions.Serialization.cs deleted file mode 100644 index 1f76fc928e42..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateFileSearchToolResourceOptions.Serialization.cs +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Agents.Persistent -{ - public partial class UpdateFileSearchToolResourceOptions : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(UpdateFileSearchToolResourceOptions)} does not support writing '{format}' format."); - } - - if (Optional.IsCollectionDefined(VectorStoreIds)) - { - writer.WritePropertyName("vector_store_ids"u8); - writer.WriteStartArray(); - foreach (var item in VectorStoreIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - UpdateFileSearchToolResourceOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(UpdateFileSearchToolResourceOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeUpdateFileSearchToolResourceOptions(document.RootElement, options); - } - - internal static UpdateFileSearchToolResourceOptions DeserializeUpdateFileSearchToolResourceOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList vectorStoreIds = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("vector_store_ids"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - vectorStoreIds = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UpdateFileSearchToolResourceOptions(vectorStoreIds ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureAIAgentsPersistentContext.Default); - default: - throw new FormatException($"The model {nameof(UpdateFileSearchToolResourceOptions)} does not support writing '{options.Format}' format."); - } - } - - UpdateFileSearchToolResourceOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeUpdateFileSearchToolResourceOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(UpdateFileSearchToolResourceOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static UpdateFileSearchToolResourceOptions FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeUpdateFileSearchToolResourceOptions(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateFileSearchToolResourceOptions.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateFileSearchToolResourceOptions.cs deleted file mode 100644 index 70ef70317495..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateFileSearchToolResourceOptions.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Agents.Persistent -{ - /// Request object to update `file_search` tool resources. - public partial class UpdateFileSearchToolResourceOptions - { - /// - /// 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" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public UpdateFileSearchToolResourceOptions() - { - VectorStoreIds = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// A list of vector store IDs to override the current list of the agent. - /// Keeps track of any properties unknown to the library. - internal UpdateFileSearchToolResourceOptions(IList vectorStoreIds, IDictionary serializedAdditionalRawData) - { - VectorStoreIds = vectorStoreIds; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// A list of vector store IDs to override the current list of the agent. - public IList VectorStoreIds { get; } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateToolResourcesOptions.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateToolResourcesOptions.Serialization.cs deleted file mode 100644 index a51b16bbd7ab..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateToolResourcesOptions.Serialization.cs +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Agents.Persistent -{ - public partial class UpdateToolResourcesOptions : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - 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; - if (format != "J") - { - throw new FormatException($"The model {nameof(UpdateToolResourcesOptions)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(CodeInterpreter)) - { - writer.WritePropertyName("code_interpreter"u8); - writer.WriteObjectValue(CodeInterpreter, options); - } - if (Optional.IsDefined(FileSearch)) - { - writer.WritePropertyName("file_search"u8); - writer.WriteObjectValue(FileSearch, options); - } - if (Optional.IsDefined(AzureAISearch)) - { - writer.WritePropertyName("azure_ai_search"u8); - writer.WriteObjectValue(AzureAISearch, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - UpdateToolResourcesOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(UpdateToolResourcesOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeUpdateToolResourcesOptions(document.RootElement, options); - } - - internal static UpdateToolResourcesOptions DeserializeUpdateToolResourcesOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - UpdateCodeInterpreterToolResourceOptions codeInterpreter = default; - UpdateFileSearchToolResourceOptions fileSearch = default; - AzureAISearchResource azureAiSearch = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code_interpreter"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - codeInterpreter = UpdateCodeInterpreterToolResourceOptions.DeserializeUpdateCodeInterpreterToolResourceOptions(property.Value, options); - continue; - } - if (property.NameEquals("file_search"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fileSearch = UpdateFileSearchToolResourceOptions.DeserializeUpdateFileSearchToolResourceOptions(property.Value, options); - continue; - } - if (property.NameEquals("azure_ai_search"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - azureAiSearch = AzureAISearchResource.DeserializeAzureAISearchResource(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UpdateToolResourcesOptions(codeInterpreter, fileSearch, azureAiSearch, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureAIAgentsPersistentContext.Default); - default: - throw new FormatException($"The model {nameof(UpdateToolResourcesOptions)} does not support writing '{options.Format}' format."); - } - } - - UpdateToolResourcesOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeUpdateToolResourcesOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(UpdateToolResourcesOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static UpdateToolResourcesOptions FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeUpdateToolResourcesOptions(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateToolResourcesOptions.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateToolResourcesOptions.cs deleted file mode 100644 index ff39241299ab..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UpdateToolResourcesOptions.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Agents.Persistent -{ - /// - /// Request object. A set of resources that are used by the agent's tools. The resources are specific to the type of tool. - /// For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of - /// vector store IDs. - /// - public partial class UpdateToolResourcesOptions - { - /// - /// 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" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public UpdateToolResourcesOptions() - { - } - - /// Initializes a new instance of . - /// - /// Overrides the list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files - /// associated with the tool. - /// - /// Overrides the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent. - /// Overrides the resources to be used by the `azure_ai_search` tool consisting of index IDs and names. - /// Keeps track of any properties unknown to the library. - internal UpdateToolResourcesOptions(UpdateCodeInterpreterToolResourceOptions codeInterpreter, UpdateFileSearchToolResourceOptions fileSearch, AzureAISearchResource azureAISearch, IDictionary serializedAdditionalRawData) - { - CodeInterpreter = codeInterpreter; - FileSearch = fileSearch; - AzureAISearch = azureAISearch; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// - /// Overrides the list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files - /// associated with the tool. - /// - public UpdateCodeInterpreterToolResourceOptions CodeInterpreter { get; set; } - /// Overrides the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent. - public UpdateFileSearchToolResourceOptions FileSearch { get; set; } - /// Overrides the resources to be used by the `azure_ai_search` tool consisting of index IDs and names. - public AzureAISearchResource AzureAISearch { get; set; } - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/tsp-location.yaml b/sdk/ai/Azure.AI.Agents.Persistent/tsp-location.yaml index ee5bc984ef94..b86465f188fb 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/tsp-location.yaml +++ b/sdk/ai/Azure.AI.Agents.Persistent/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/ai/Azure.AI.Agents -commit: ebd14347e0d9dd5c0f84e01260968c9e60453823 +commit: 7e048d5f2b29f07b13a012a1380b168db05e453a repo: Azure/azure-rest-api-specs additionalDirectories: