diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateRunRequest.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateRunRequest.Serialization.cs index 8a2136f8d8c2..f0983c132abf 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateRunRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateRunRequest.Serialization.cs @@ -280,7 +280,7 @@ internal static CreateRunRequest DeserializeCreateRunRequest(JsonElement element float? topP = default; int? maxPromptTokens = default; int? maxCompletionTokens = default; - TruncationObject truncationStrategy = default; + Truncation truncationStrategy = default; BinaryData toolChoice = default; BinaryData responseFormat = default; bool? parallelToolCalls = default; @@ -408,7 +408,7 @@ internal static CreateRunRequest DeserializeCreateRunRequest(JsonElement element truncationStrategy = null; continue; } - truncationStrategy = TruncationObject.DeserializeTruncationObject(property.Value, options); + truncationStrategy = Truncation.DeserializeTruncation(property.Value, options); continue; } if (property.NameEquals("tool_choice"u8)) 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 fdf105469ef5..f284b65a774e 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateRunRequest.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateRunRequest.cs @@ -103,7 +103,7 @@ internal CreateRunRequest(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 CreateRunRequest(string assistantId, string overrideModelName, string overrideInstructions, string additionalInstructions, IReadOnlyList additionalMessages, IReadOnlyList overrideTools, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, bool? parallelToolCalls, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) + internal CreateRunRequest(string assistantId, string overrideModelName, string overrideInstructions, string additionalInstructions, IReadOnlyList additionalMessages, IReadOnlyList overrideTools, bool? stream, float? temperature, float? topP, int? maxPromptTokens, int? maxCompletionTokens, Truncation truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, bool? parallelToolCalls, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) { AssistantId = assistantId; OverrideModelName = overrideModelName; @@ -179,7 +179,7 @@ internal CreateRunRequest() /// public int? MaxCompletionTokens { get; } /// The strategy to use for dropping messages as the context windows moves forward. - public TruncationObject TruncationStrategy { get; } + public Truncation TruncationStrategy { get; } /// /// Controls whether or not and which tool is called by the model. /// 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 69bfd7f86a39..f08fc03e6b36 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 @@ -268,7 +268,7 @@ internal static CreateThreadAndRunRequest DeserializeCreateThreadAndRunRequest(J float? topP = default; int? maxPromptTokens = default; int? maxCompletionTokens = default; - TruncationObject truncationStrategy = default; + Truncation truncationStrategy = default; BinaryData toolChoice = default; BinaryData responseFormat = default; bool? parallelToolCalls = default; @@ -391,7 +391,7 @@ internal static CreateThreadAndRunRequest DeserializeCreateThreadAndRunRequest(J truncationStrategy = null; continue; } - truncationStrategy = TruncationObject.DeserializeTruncationObject(property.Value, options); + truncationStrategy = Truncation.DeserializeTruncation(property.Value, options); continue; } if (property.NameEquals("tool_choice"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 d66b814e348e..ebf177810083 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateThreadAndRunRequest.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateThreadAndRunRequest.cs @@ -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, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, bool? parallelToolCalls, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) + 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) { AssistantId = assistantId; Thread = thread; @@ -172,7 +172,7 @@ internal CreateThreadAndRunRequest() /// public int? MaxCompletionTokens { get; } /// The strategy to use for dropping messages as the context windows moves forward. - public TruncationObject TruncationStrategy { get; } + public Truncation TruncationStrategy { get; } /// /// Controls whether or not and which tool is called by the model. /// diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreFileBatchRequest.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreFileBatchRequest.Serialization.cs index 838803df5253..4616f165d476 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreFileBatchRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreFileBatchRequest.Serialization.cs @@ -98,7 +98,7 @@ internal static CreateVectorStoreFileBatchRequest DeserializeCreateVectorStoreFi } IReadOnlyList fileIds = default; IReadOnlyList dataSources = default; - VectorStoreChunkingStrategyRequest chunkingStrategy = default; + VectorStoreChunkingStrategy chunkingStrategy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -137,7 +137,7 @@ internal static CreateVectorStoreFileBatchRequest DeserializeCreateVectorStoreFi { continue; } - chunkingStrategy = VectorStoreChunkingStrategyRequest.DeserializeVectorStoreChunkingStrategyRequest(property.Value, options); + chunkingStrategy = VectorStoreChunkingStrategy.DeserializeVectorStoreChunkingStrategy(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreFileBatchRequest.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreFileBatchRequest.cs index 5169668b712d..026fb12f3536 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreFileBatchRequest.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreFileBatchRequest.cs @@ -57,11 +57,11 @@ internal CreateVectorStoreFileBatchRequest() /// List of Azure assets. /// /// The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. - /// 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 . + /// 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 . /// /// Keeps track of any properties unknown to the library. - internal CreateVectorStoreFileBatchRequest(IReadOnlyList fileIds, IReadOnlyList dataSources, VectorStoreChunkingStrategyRequest chunkingStrategy, IDictionary serializedAdditionalRawData) + internal CreateVectorStoreFileBatchRequest(IReadOnlyList fileIds, IReadOnlyList dataSources, VectorStoreChunkingStrategy chunkingStrategy, IDictionary serializedAdditionalRawData) { FileIds = fileIds; DataSources = dataSources; @@ -75,9 +75,9 @@ internal CreateVectorStoreFileBatchRequest(IReadOnlyList fileIds, IReadO public IReadOnlyList DataSources { get; } /// /// The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. - /// 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 . + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . /// - public VectorStoreChunkingStrategyRequest ChunkingStrategy { get; } + public VectorStoreChunkingStrategy ChunkingStrategy { get; } } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreFileRequest.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreFileRequest.Serialization.cs index 5ddc12d049dc..b96b62940145 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreFileRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreFileRequest.Serialization.cs @@ -88,7 +88,7 @@ internal static CreateVectorStoreFileRequest DeserializeCreateVectorStoreFileReq } string fileId = default; VectorStoreDataSource dataSource = default; - VectorStoreChunkingStrategyRequest chunkingStrategy = default; + VectorStoreChunkingStrategy chunkingStrategy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -113,7 +113,7 @@ internal static CreateVectorStoreFileRequest DeserializeCreateVectorStoreFileReq { continue; } - chunkingStrategy = VectorStoreChunkingStrategyRequest.DeserializeVectorStoreChunkingStrategyRequest(property.Value, options); + chunkingStrategy = VectorStoreChunkingStrategy.DeserializeVectorStoreChunkingStrategy(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreFileRequest.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreFileRequest.cs index 07cc19c8816f..91b1bf2a072b 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreFileRequest.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreFileRequest.cs @@ -55,11 +55,11 @@ internal CreateVectorStoreFileRequest() /// Azure asset ID. /// /// The chunking strategy used to chunk the file. If not set, uses the auto strategy. - /// 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 . + /// 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 . /// /// Keeps track of any properties unknown to the library. - internal CreateVectorStoreFileRequest(string fileId, VectorStoreDataSource dataSource, VectorStoreChunkingStrategyRequest chunkingStrategy, IDictionary serializedAdditionalRawData) + internal CreateVectorStoreFileRequest(string fileId, VectorStoreDataSource dataSource, VectorStoreChunkingStrategy chunkingStrategy, IDictionary serializedAdditionalRawData) { FileId = fileId; DataSource = dataSource; @@ -73,9 +73,9 @@ internal CreateVectorStoreFileRequest(string fileId, VectorStoreDataSource dataS public VectorStoreDataSource DataSource { get; } /// /// The chunking strategy used to chunk the file. If not set, uses the auto strategy. - /// 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 . + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . /// - public VectorStoreChunkingStrategyRequest ChunkingStrategy { get; } + public VectorStoreChunkingStrategy ChunkingStrategy { get; } } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreRequest.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreRequest.Serialization.cs index 1a34a0e92fa7..71cb1206af54 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreRequest.Serialization.cs @@ -123,7 +123,7 @@ internal static CreateVectorStoreRequest DeserializeCreateVectorStoreRequest(Jso string name = default; VectorStoreConfiguration configuration = default; VectorStoreExpirationPolicy expiresAfter = default; - VectorStoreChunkingStrategyRequest chunkingStrategy = default; + VectorStoreChunkingStrategy chunkingStrategy = default; IReadOnlyDictionary metadata = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -172,7 +172,7 @@ internal static CreateVectorStoreRequest DeserializeCreateVectorStoreRequest(Jso { continue; } - chunkingStrategy = VectorStoreChunkingStrategyRequest.DeserializeVectorStoreChunkingStrategyRequest(property.Value, options); + chunkingStrategy = VectorStoreChunkingStrategy.DeserializeVectorStoreChunkingStrategy(property.Value, options); continue; } if (property.NameEquals("metadata"u8)) diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreRequest.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreRequest.cs index 9b5331a0baf7..24d32824ccfc 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreRequest.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/CreateVectorStoreRequest.cs @@ -59,12 +59,12 @@ internal CreateVectorStoreRequest() /// Details on when this vector store expires. /// /// The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. Only applicable if file_ids is non-empty. - /// 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 . + /// 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 . /// /// 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 CreateVectorStoreRequest(IReadOnlyList fileIds, string name, VectorStoreConfiguration storeConfiguration, VectorStoreExpirationPolicy expiresAfter, VectorStoreChunkingStrategyRequest chunkingStrategy, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) + internal CreateVectorStoreRequest(IReadOnlyList fileIds, string name, VectorStoreConfiguration storeConfiguration, VectorStoreExpirationPolicy expiresAfter, VectorStoreChunkingStrategy chunkingStrategy, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) { FileIds = fileIds; Name = name; @@ -85,10 +85,10 @@ internal CreateVectorStoreRequest(IReadOnlyList fileIds, string name, Ve public VectorStoreExpirationPolicy ExpiresAfter { get; } /// /// The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. Only applicable if file_ids is non-empty. - /// 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 . + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . /// - public VectorStoreChunkingStrategyRequest ChunkingStrategy { get; } + public VectorStoreChunkingStrategy ChunkingStrategy { get; } /// 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; } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalMessageTextDetails.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalMessageTextDetails.cs index 42a61cb4b25d..b27c8e4bb86b 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalMessageTextDetails.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalMessageTextDetails.cs @@ -51,7 +51,7 @@ internal partial class InternalMessageTextDetails /// /// A list of annotations associated with this text. /// 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 . /// /// or is null. internal InternalMessageTextDetails(string text, IEnumerable annotations) @@ -68,7 +68,7 @@ internal InternalMessageTextDetails(string text, IEnumerable /// A list of annotations associated with this text. /// 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 . /// /// Keeps track of any properties unknown to the library. internal InternalMessageTextDetails(string text, IReadOnlyList annotations, IDictionary serializedAdditionalRawData) @@ -88,7 +88,7 @@ internal InternalMessageTextDetails() /// /// A list of annotations associated with this text. /// 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 Annotations { get; } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreDeletionStatus.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreDeletionStatus.Serialization.cs similarity index 64% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreDeletionStatus.Serialization.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreDeletionStatus.Serialization.cs index a18c39f46c29..a1ef0911cbed 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreDeletionStatus.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreDeletionStatus.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Agents.Persistent { - public partial class VectorStoreDeletionStatus : IUtf8JsonSerializable, IJsonModel + internal partial class InternalVectorStoreDeletionStatus : 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, ModelRea /// 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(VectorStoreDeletionStatus)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(InternalVectorStoreDeletionStatus)} does not support writing '{format}' format."); } writer.WritePropertyName("id"u8); @@ -57,19 +57,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - VectorStoreDeletionStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalVectorStoreDeletionStatus 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(VectorStoreDeletionStatus)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(InternalVectorStoreDeletionStatus)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeVectorStoreDeletionStatus(document.RootElement, options); + return DeserializeInternalVectorStoreDeletionStatus(document.RootElement, options); } - internal static VectorStoreDeletionStatus DeserializeVectorStoreDeletionStatus(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalVectorStoreDeletionStatus DeserializeInternalVectorStoreDeletionStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -79,7 +79,7 @@ internal static VectorStoreDeletionStatus DeserializeVectorStoreDeletionStatus(J } string id = default; bool deleted = default; - VectorStoreDeletionStatusObject @object = default; + InternalVectorStoreDeletionStatusObject @object = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -96,7 +96,7 @@ internal static VectorStoreDeletionStatus DeserializeVectorStoreDeletionStatus(J } if (property.NameEquals("object"u8)) { - @object = new VectorStoreDeletionStatusObject(property.Value.GetString()); + @object = new InternalVectorStoreDeletionStatusObject(property.Value.GetString()); continue; } if (options.Format != "W") @@ -105,46 +105,46 @@ internal static VectorStoreDeletionStatus DeserializeVectorStoreDeletionStatus(J } } serializedAdditionalRawData = rawDataDictionary; - return new VectorStoreDeletionStatus(id, deleted, @object, serializedAdditionalRawData); + return new InternalVectorStoreDeletionStatus(id, deleted, @object, 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(VectorStoreDeletionStatus)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(InternalVectorStoreDeletionStatus)} does not support writing '{options.Format}' format."); } } - VectorStoreDeletionStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + InternalVectorStoreDeletionStatus 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 DeserializeVectorStoreDeletionStatus(document.RootElement, options); + return DeserializeInternalVectorStoreDeletionStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(VectorStoreDeletionStatus)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(InternalVectorStoreDeletionStatus)} 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 VectorStoreDeletionStatus FromResponse(Response response) + internal static InternalVectorStoreDeletionStatus FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeVectorStoreDeletionStatus(document.RootElement); + return DeserializeInternalVectorStoreDeletionStatus(document.RootElement); } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreDeletionStatus.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreDeletionStatus.cs similarity index 77% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreDeletionStatus.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreDeletionStatus.cs index 1d5223d621f2..875a243b25ff 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreDeletionStatus.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreDeletionStatus.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Agents.Persistent { /// Response object for deleting a vector store. - public partial class VectorStoreDeletionStatus + internal partial class InternalVectorStoreDeletionStatus { /// /// Keeps track of any properties unknown to the library. @@ -45,11 +45,11 @@ public partial class VectorStoreDeletionStatus /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The ID of the resource specified for deletion. /// A value indicating whether deletion was successful. /// is null. - internal VectorStoreDeletionStatus(string id, bool deleted) + internal InternalVectorStoreDeletionStatus(string id, bool deleted) { Argument.AssertNotNull(id, nameof(id)); @@ -57,12 +57,12 @@ internal VectorStoreDeletionStatus(string id, bool deleted) Deleted = deleted; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The ID of the resource specified for deletion. /// A value indicating whether deletion was successful. /// The object type, which is always 'vector_store.deleted'. /// Keeps track of any properties unknown to the library. - internal VectorStoreDeletionStatus(string id, bool deleted, VectorStoreDeletionStatusObject @object, IDictionary serializedAdditionalRawData) + internal InternalVectorStoreDeletionStatus(string id, bool deleted, InternalVectorStoreDeletionStatusObject @object, IDictionary serializedAdditionalRawData) { Id = id; Deleted = deleted; @@ -70,8 +70,8 @@ internal VectorStoreDeletionStatus(string id, bool deleted, VectorStoreDeletionS _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal VectorStoreDeletionStatus() + /// Initializes a new instance of for deserialization. + internal InternalVectorStoreDeletionStatus() { } @@ -80,6 +80,6 @@ internal VectorStoreDeletionStatus() /// A value indicating whether deletion was successful. public bool Deleted { get; } /// The object type, which is always 'vector_store.deleted'. - public VectorStoreDeletionStatusObject Object { get; } = VectorStoreDeletionStatusObject.VectorStoreDeleted; + public InternalVectorStoreDeletionStatusObject Object { get; } = InternalVectorStoreDeletionStatusObject.VectorStoreDeleted; } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreDeletionStatusObject.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreDeletionStatusObject.cs new file mode 100644 index 000000000000..1762fecc069b --- /dev/null +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreDeletionStatusObject.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Agents.Persistent +{ + /// The InternalVectorStoreDeletionStatus_object. + internal readonly partial struct InternalVectorStoreDeletionStatusObject : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public InternalVectorStoreDeletionStatusObject(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string VectorStoreDeletedValue = "vector_store.deleted"; + + /// vector_store.deleted. + public static InternalVectorStoreDeletionStatusObject VectorStoreDeleted { get; } = new InternalVectorStoreDeletionStatusObject(VectorStoreDeletedValue); + /// Determines if two values are the same. + public static bool operator ==(InternalVectorStoreDeletionStatusObject left, InternalVectorStoreDeletionStatusObject right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(InternalVectorStoreDeletionStatusObject left, InternalVectorStoreDeletionStatusObject right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator InternalVectorStoreDeletionStatusObject(string value) => new InternalVectorStoreDeletionStatusObject(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is InternalVectorStoreDeletionStatusObject other && Equals(other); + /// + public bool Equals(InternalVectorStoreDeletionStatusObject other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreFileDeletionStatus.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreFileDeletionStatus.Serialization.cs similarity index 63% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreFileDeletionStatus.Serialization.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreFileDeletionStatus.Serialization.cs index d5ae97055d76..1cc4a58d063a 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreFileDeletionStatus.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreFileDeletionStatus.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Agents.Persistent { - public partial class VectorStoreFileDeletionStatus : IUtf8JsonSerializable, IJsonModel + internal partial class InternalVectorStoreFileDeletionStatus : 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, Mode /// 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(VectorStoreFileDeletionStatus)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(InternalVectorStoreFileDeletionStatus)} does not support writing '{format}' format."); } writer.WritePropertyName("id"u8); @@ -57,19 +57,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - VectorStoreFileDeletionStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + InternalVectorStoreFileDeletionStatus 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(VectorStoreFileDeletionStatus)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(InternalVectorStoreFileDeletionStatus)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeVectorStoreFileDeletionStatus(document.RootElement, options); + return DeserializeInternalVectorStoreFileDeletionStatus(document.RootElement, options); } - internal static VectorStoreFileDeletionStatus DeserializeVectorStoreFileDeletionStatus(JsonElement element, ModelReaderWriterOptions options = null) + internal static InternalVectorStoreFileDeletionStatus DeserializeInternalVectorStoreFileDeletionStatus(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -79,7 +79,7 @@ internal static VectorStoreFileDeletionStatus DeserializeVectorStoreFileDeletion } string id = default; bool deleted = default; - VectorStoreFileDeletionStatusObject @object = default; + InternalVectorStoreFileDeletionStatusObject @object = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -96,7 +96,7 @@ internal static VectorStoreFileDeletionStatus DeserializeVectorStoreFileDeletion } if (property.NameEquals("object"u8)) { - @object = new VectorStoreFileDeletionStatusObject(property.Value.GetString()); + @object = new InternalVectorStoreFileDeletionStatusObject(property.Value.GetString()); continue; } if (options.Format != "W") @@ -105,46 +105,46 @@ internal static VectorStoreFileDeletionStatus DeserializeVectorStoreFileDeletion } } serializedAdditionalRawData = rawDataDictionary; - return new VectorStoreFileDeletionStatus(id, deleted, @object, serializedAdditionalRawData); + return new InternalVectorStoreFileDeletionStatus(id, deleted, @object, 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(VectorStoreFileDeletionStatus)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(InternalVectorStoreFileDeletionStatus)} does not support writing '{options.Format}' format."); } } - VectorStoreFileDeletionStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + InternalVectorStoreFileDeletionStatus 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 DeserializeVectorStoreFileDeletionStatus(document.RootElement, options); + return DeserializeInternalVectorStoreFileDeletionStatus(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(VectorStoreFileDeletionStatus)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(InternalVectorStoreFileDeletionStatus)} 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 VectorStoreFileDeletionStatus FromResponse(Response response) + internal static InternalVectorStoreFileDeletionStatus FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeVectorStoreFileDeletionStatus(document.RootElement); + return DeserializeInternalVectorStoreFileDeletionStatus(document.RootElement); } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreFileDeletionStatus.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreFileDeletionStatus.cs similarity index 76% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreFileDeletionStatus.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreFileDeletionStatus.cs index e5e888a81132..fb0cfd6b1556 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreFileDeletionStatus.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreFileDeletionStatus.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Agents.Persistent { /// Response object for deleting a vector store file relationship. - public partial class VectorStoreFileDeletionStatus + internal partial class InternalVectorStoreFileDeletionStatus { /// /// Keeps track of any properties unknown to the library. @@ -45,11 +45,11 @@ public partial class VectorStoreFileDeletionStatus /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The ID of the resource specified for deletion. /// A value indicating whether deletion was successful. /// is null. - internal VectorStoreFileDeletionStatus(string id, bool deleted) + internal InternalVectorStoreFileDeletionStatus(string id, bool deleted) { Argument.AssertNotNull(id, nameof(id)); @@ -57,12 +57,12 @@ internal VectorStoreFileDeletionStatus(string id, bool deleted) Deleted = deleted; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The ID of the resource specified for deletion. /// A value indicating whether deletion was successful. /// The object type, which is always 'vector_store.deleted'. /// Keeps track of any properties unknown to the library. - internal VectorStoreFileDeletionStatus(string id, bool deleted, VectorStoreFileDeletionStatusObject @object, IDictionary serializedAdditionalRawData) + internal InternalVectorStoreFileDeletionStatus(string id, bool deleted, InternalVectorStoreFileDeletionStatusObject @object, IDictionary serializedAdditionalRawData) { Id = id; Deleted = deleted; @@ -70,8 +70,8 @@ internal VectorStoreFileDeletionStatus(string id, bool deleted, VectorStoreFileD _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal VectorStoreFileDeletionStatus() + /// Initializes a new instance of for deserialization. + internal InternalVectorStoreFileDeletionStatus() { } @@ -80,6 +80,6 @@ internal VectorStoreFileDeletionStatus() /// A value indicating whether deletion was successful. public bool Deleted { get; } /// The object type, which is always 'vector_store.deleted'. - public VectorStoreFileDeletionStatusObject Object { get; } = VectorStoreFileDeletionStatusObject.VectorStoreFileDeleted; + public InternalVectorStoreFileDeletionStatusObject Object { get; } = InternalVectorStoreFileDeletionStatusObject.VectorStoreFileDeleted; } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreFileDeletionStatusObject.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreFileDeletionStatusObject.cs new file mode 100644 index 000000000000..cea78530d4a9 --- /dev/null +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/InternalVectorStoreFileDeletionStatusObject.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Agents.Persistent +{ + /// The InternalVectorStoreFileDeletionStatus_object. + internal readonly partial struct InternalVectorStoreFileDeletionStatusObject : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public InternalVectorStoreFileDeletionStatusObject(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string VectorStoreFileDeletedValue = "vector_store.file.deleted"; + + /// vector_store.file.deleted. + public static InternalVectorStoreFileDeletionStatusObject VectorStoreFileDeleted { get; } = new InternalVectorStoreFileDeletionStatusObject(VectorStoreFileDeletedValue); + /// Determines if two values are the same. + public static bool operator ==(InternalVectorStoreFileDeletionStatusObject left, InternalVectorStoreFileDeletionStatusObject right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(InternalVectorStoreFileDeletionStatusObject left, InternalVectorStoreFileDeletionStatusObject right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator InternalVectorStoreFileDeletionStatusObject(string value) => new InternalVectorStoreFileDeletionStatusObject(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is InternalVectorStoreFileDeletionStatusObject other && Equals(other); + /// + public bool Equals(InternalVectorStoreFileDeletionStatusObject other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextAnnotation.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextAnnotation.Serialization.cs index c2910ff41242..7b4bc14bc59a 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextAnnotation.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextAnnotation.Serialization.cs @@ -81,7 +81,7 @@ internal static MessageDeltaTextAnnotation DeserializeMessageDeltaTextAnnotation { case "file_citation": return MessageDeltaTextFileCitationAnnotation.DeserializeMessageDeltaTextFileCitationAnnotation(element, options); case "file_path": return MessageDeltaTextFilePathAnnotation.DeserializeMessageDeltaTextFilePathAnnotation(element, options); - case "url_citation": return MessageDeltaTextUrlCitationAnnotation.DeserializeMessageDeltaTextUrlCitationAnnotation(element, options); + case "url_citation": return MessageDeltaTextUriCitationAnnotation.DeserializeMessageDeltaTextUriCitationAnnotation(element, options); } } return UnknownMessageDeltaTextAnnotation.DeserializeUnknownMessageDeltaTextAnnotation(element, options); diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextAnnotation.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextAnnotation.cs index fcef4cd14062..830bb7c79df3 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextAnnotation.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextAnnotation.cs @@ -13,7 +13,7 @@ namespace Azure.AI.Agents.Persistent /// /// The abstract base representation of a streamed text content part's text annotation. /// 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 MessageDeltaTextAnnotation { diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextContentObject.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextContentObject.cs index 2b202bd13261..67211f3d5930 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextContentObject.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextContentObject.cs @@ -56,7 +56,7 @@ internal MessageDeltaTextContentObject() /// /// Annotations for the text. /// 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 . /// /// Keeps track of any properties unknown to the library. internal MessageDeltaTextContentObject(string value, IReadOnlyList annotations, IDictionary serializedAdditionalRawData) @@ -71,7 +71,7 @@ internal MessageDeltaTextContentObject(string value, IReadOnlyList /// Annotations for the text. /// 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 Annotations { get; } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUrlCitationAnnotation.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUriCitationAnnotation.Serialization.cs similarity index 76% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUrlCitationAnnotation.Serialization.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUriCitationAnnotation.Serialization.cs index 16af03bb792f..ed9897ff643e 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUrlCitationAnnotation.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUriCitationAnnotation.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Agents.Persistent { - public partial class MessageDeltaTextUrlCitationAnnotation : IUtf8JsonSerializable, IJsonModel + public partial class MessageDeltaTextUriCitationAnnotation : 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,15 +28,15 @@ void IJsonModel.Write(Utf8JsonWriter writ /// 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MessageDeltaTextUrlCitationAnnotation)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MessageDeltaTextUriCitationAnnotation)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); writer.WritePropertyName("url_citation"u8); - writer.WriteObjectValue(UrlCitation, options); + writer.WriteObjectValue(UriCitation, options); if (Optional.IsDefined(StartIndex)) { writer.WritePropertyName("start_index"u8); @@ -49,19 +49,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - MessageDeltaTextUrlCitationAnnotation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MessageDeltaTextUriCitationAnnotation 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(MessageDeltaTextUrlCitationAnnotation)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MessageDeltaTextUriCitationAnnotation)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageDeltaTextUrlCitationAnnotation(document.RootElement, options); + return DeserializeMessageDeltaTextUriCitationAnnotation(document.RootElement, options); } - internal static MessageDeltaTextUrlCitationAnnotation DeserializeMessageDeltaTextUrlCitationAnnotation(JsonElement element, ModelReaderWriterOptions options = null) + internal static MessageDeltaTextUriCitationAnnotation DeserializeMessageDeltaTextUriCitationAnnotation(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -69,7 +69,7 @@ internal static MessageDeltaTextUrlCitationAnnotation DeserializeMessageDeltaTex { return null; } - MessageDeltaTextUrlCitationDetails urlCitation = default; + MessageDeltaTextUriCitationDetails urlCitation = default; int? startIndex = default; int? endIndex = default; int index = default; @@ -80,7 +80,7 @@ internal static MessageDeltaTextUrlCitationAnnotation DeserializeMessageDeltaTex { if (property.NameEquals("url_citation"u8)) { - urlCitation = MessageDeltaTextUrlCitationDetails.DeserializeMessageDeltaTextUrlCitationDetails(property.Value, options); + urlCitation = MessageDeltaTextUriCitationDetails.DeserializeMessageDeltaTextUriCitationDetails(property.Value, options); continue; } if (property.NameEquals("start_index"u8)) @@ -117,7 +117,7 @@ internal static MessageDeltaTextUrlCitationAnnotation DeserializeMessageDeltaTex } } serializedAdditionalRawData = rawDataDictionary; - return new MessageDeltaTextUrlCitationAnnotation( + return new MessageDeltaTextUriCitationAnnotation( index, type, serializedAdditionalRawData, @@ -126,43 +126,43 @@ internal static MessageDeltaTextUrlCitationAnnotation DeserializeMessageDeltaTex endIndex); } - 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(MessageDeltaTextUrlCitationAnnotation)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MessageDeltaTextUriCitationAnnotation)} does not support writing '{options.Format}' format."); } } - MessageDeltaTextUrlCitationAnnotation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MessageDeltaTextUriCitationAnnotation 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 DeserializeMessageDeltaTextUrlCitationAnnotation(document.RootElement, options); + return DeserializeMessageDeltaTextUriCitationAnnotation(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MessageDeltaTextUrlCitationAnnotation)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MessageDeltaTextUriCitationAnnotation)} 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 new MessageDeltaTextUrlCitationAnnotation FromResponse(Response response) + internal static new MessageDeltaTextUriCitationAnnotation FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMessageDeltaTextUrlCitationAnnotation(document.RootElement); + return DeserializeMessageDeltaTextUriCitationAnnotation(document.RootElement); } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUrlCitationAnnotation.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUriCitationAnnotation.cs similarity index 68% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUrlCitationAnnotation.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUriCitationAnnotation.cs index 6a4c7d0f7248..636d8b59e746 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUrlCitationAnnotation.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUriCitationAnnotation.cs @@ -11,41 +11,41 @@ namespace Azure.AI.Agents.Persistent { /// A citation within the message that points to a specific URL associated with the message. Generated when the agent uses tools such as 'bing_grounding' to search the Internet. - public partial class MessageDeltaTextUrlCitationAnnotation : MessageDeltaTextAnnotation + public partial class MessageDeltaTextUriCitationAnnotation : MessageDeltaTextAnnotation { - /// Initializes a new instance of . + /// Initializes a new instance of . /// The index of the annotation within a text content part. - /// The details of the URL citation. - /// is null. - internal MessageDeltaTextUrlCitationAnnotation(int index, MessageDeltaTextUrlCitationDetails urlCitation) : base(index) + /// The details of the URL citation. + /// is null. + internal MessageDeltaTextUriCitationAnnotation(int index, MessageDeltaTextUriCitationDetails uriCitation) : base(index) { - Argument.AssertNotNull(urlCitation, nameof(urlCitation)); + Argument.AssertNotNull(uriCitation, nameof(uriCitation)); Type = "url_citation"; - UrlCitation = urlCitation; + UriCitation = uriCitation; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The index of the annotation within a text content part. /// The type of the text content annotation. /// Keeps track of any properties unknown to the library. - /// The details of the URL citation. + /// The details of the URL citation. /// The first text index associated with this text annotation. /// The last text index associated with this text annotation. - internal MessageDeltaTextUrlCitationAnnotation(int index, string type, IDictionary serializedAdditionalRawData, MessageDeltaTextUrlCitationDetails urlCitation, int? startIndex, int? endIndex) : base(index, type, serializedAdditionalRawData) + internal MessageDeltaTextUriCitationAnnotation(int index, string type, IDictionary serializedAdditionalRawData, MessageDeltaTextUriCitationDetails uriCitation, int? startIndex, int? endIndex) : base(index, type, serializedAdditionalRawData) { - UrlCitation = urlCitation; + UriCitation = uriCitation; StartIndex = startIndex; EndIndex = endIndex; } - /// Initializes a new instance of for deserialization. - internal MessageDeltaTextUrlCitationAnnotation() + /// Initializes a new instance of for deserialization. + internal MessageDeltaTextUriCitationAnnotation() { } /// The details of the URL citation. - public MessageDeltaTextUrlCitationDetails UrlCitation { get; } + public MessageDeltaTextUriCitationDetails UriCitation { get; } /// The first text index associated with this text annotation. public int? StartIndex { get; } /// The last text index associated with this text annotation. diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUrlCitationDetails.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUriCitationDetails.Serialization.cs similarity index 76% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUrlCitationDetails.Serialization.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUriCitationDetails.Serialization.cs index 6bed7c83f399..c195e80cab5d 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUrlCitationDetails.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUriCitationDetails.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Agents.Persistent { - public partial class MessageDeltaTextUrlCitationDetails : IUtf8JsonSerializable, IJsonModel + public partial class MessageDeltaTextUriCitationDetails : 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,14 +28,14 @@ void IJsonModel.Write(Utf8JsonWriter 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MessageDeltaTextUrlCitationDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MessageDeltaTextUriCitationDetails)} does not support writing '{format}' format."); } writer.WritePropertyName("url"u8); - writer.WriteStringValue(Url); + writer.WriteStringValue(Uri); if (Optional.IsDefined(Title)) { writer.WritePropertyName("title"u8); @@ -58,19 +58,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MessageDeltaTextUrlCitationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MessageDeltaTextUriCitationDetails 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(MessageDeltaTextUrlCitationDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MessageDeltaTextUriCitationDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageDeltaTextUrlCitationDetails(document.RootElement, options); + return DeserializeMessageDeltaTextUriCitationDetails(document.RootElement, options); } - internal static MessageDeltaTextUrlCitationDetails DeserializeMessageDeltaTextUrlCitationDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static MessageDeltaTextUriCitationDetails DeserializeMessageDeltaTextUriCitationDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -100,46 +100,46 @@ internal static MessageDeltaTextUrlCitationDetails DeserializeMessageDeltaTextUr } } serializedAdditionalRawData = rawDataDictionary; - return new MessageDeltaTextUrlCitationDetails(url, title, serializedAdditionalRawData); + return new MessageDeltaTextUriCitationDetails(url, title, 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(MessageDeltaTextUrlCitationDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MessageDeltaTextUriCitationDetails)} does not support writing '{options.Format}' format."); } } - MessageDeltaTextUrlCitationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MessageDeltaTextUriCitationDetails 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 DeserializeMessageDeltaTextUrlCitationDetails(document.RootElement, options); + return DeserializeMessageDeltaTextUriCitationDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MessageDeltaTextUrlCitationDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MessageDeltaTextUriCitationDetails)} 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 MessageDeltaTextUrlCitationDetails FromResponse(Response response) + internal static MessageDeltaTextUriCitationDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMessageDeltaTextUrlCitationDetails(document.RootElement); + return DeserializeMessageDeltaTextUriCitationDetails(document.RootElement); } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUrlCitationDetails.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUriCitationDetails.cs similarity index 78% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUrlCitationDetails.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUriCitationDetails.cs index 2a84a9ab4d74..2e92ac2f8693 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUrlCitationDetails.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageDeltaTextUriCitationDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Agents.Persistent { /// A representation of a URL citation, as used in text thread message content. - public partial class MessageDeltaTextUrlCitationDetails + public partial class MessageDeltaTextUriCitationDetails { /// /// Keeps track of any properties unknown to the library. @@ -45,34 +45,34 @@ public partial class MessageDeltaTextUrlCitationDetails /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The URL associated with this citation. - /// is null. - internal MessageDeltaTextUrlCitationDetails(string url) + /// Initializes a new instance of . + /// The URL associated with this citation. + /// is null. + internal MessageDeltaTextUriCitationDetails(string uri) { - Argument.AssertNotNull(url, nameof(url)); + Argument.AssertNotNull(uri, nameof(uri)); - Url = url; + Uri = uri; } - /// Initializes a new instance of . - /// The URL associated with this citation. + /// Initializes a new instance of . + /// The URL associated with this citation. /// The title of the URL. /// Keeps track of any properties unknown to the library. - internal MessageDeltaTextUrlCitationDetails(string url, string title, IDictionary serializedAdditionalRawData) + internal MessageDeltaTextUriCitationDetails(string uri, string title, IDictionary serializedAdditionalRawData) { - Url = url; + Uri = uri; Title = title; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal MessageDeltaTextUrlCitationDetails() + /// Initializes a new instance of for deserialization. + internal MessageDeltaTextUriCitationDetails() { } /// The URL associated with this citation. - public string Url { get; } + public string Uri { get; } /// The title of the URL. public string Title { get; } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageImageUrlParam.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageImageUriParam.Serialization.cs similarity index 78% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageImageUrlParam.Serialization.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageImageUriParam.Serialization.cs index 30b60c1ae086..f4cc1b8e5c0e 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageImageUrlParam.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageImageUriParam.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Agents.Persistent { - public partial class MessageImageUrlParam : IUtf8JsonSerializable, IJsonModel + public partial class MessageImageUriParam : 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,14 +28,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MessageImageUrlParam)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MessageImageUriParam)} does not support writing '{format}' format."); } writer.WritePropertyName("url"u8); - writer.WriteStringValue(Url); + writer.WriteStringValue(Uri); if (Optional.IsDefined(Detail)) { writer.WritePropertyName("detail"u8); @@ -58,19 +58,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MessageImageUrlParam IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MessageImageUriParam 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(MessageImageUrlParam)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MessageImageUriParam)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageImageUrlParam(document.RootElement, options); + return DeserializeMessageImageUriParam(document.RootElement, options); } - internal static MessageImageUrlParam DeserializeMessageImageUrlParam(JsonElement element, ModelReaderWriterOptions options = null) + internal static MessageImageUriParam DeserializeMessageImageUriParam(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -104,46 +104,46 @@ internal static MessageImageUrlParam DeserializeMessageImageUrlParam(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new MessageImageUrlParam(url, detail, serializedAdditionalRawData); + return new MessageImageUriParam(url, detail, 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(MessageImageUrlParam)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MessageImageUriParam)} does not support writing '{options.Format}' format."); } } - MessageImageUrlParam IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MessageImageUriParam 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 DeserializeMessageImageUrlParam(document.RootElement, options); + return DeserializeMessageImageUriParam(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MessageImageUrlParam)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MessageImageUriParam)} 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 MessageImageUrlParam FromResponse(Response response) + internal static MessageImageUriParam FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMessageImageUrlParam(document.RootElement); + return DeserializeMessageImageUriParam(document.RootElement); } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageImageUrlParam.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageImageUriParam.cs similarity index 81% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageImageUrlParam.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageImageUriParam.cs index cccd2a2cfd8d..f556ffcd2335 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageImageUrlParam.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageImageUriParam.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Agents.Persistent { /// Defines how an external image URL is referenced when creating an image-URL block. - public partial class MessageImageUrlParam + public partial class MessageImageUriParam { /// /// Keeps track of any properties unknown to the library. @@ -45,34 +45,34 @@ public partial class MessageImageUrlParam /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The publicly accessible URL of the external image. - /// is null. - public MessageImageUrlParam(string url) + /// Initializes a new instance of . + /// The publicly accessible URL of the external image. + /// is null. + public MessageImageUriParam(string uri) { - Argument.AssertNotNull(url, nameof(url)); + Argument.AssertNotNull(uri, nameof(uri)); - Url = url; + Uri = uri; } - /// Initializes a new instance of . - /// The publicly accessible URL of the external image. + /// Initializes a new instance of . + /// The publicly accessible URL of the external image. /// Optional detail level for the image (auto, low, or high). Defaults to 'auto' if not specified. /// Keeps track of any properties unknown to the library. - internal MessageImageUrlParam(string url, ImageDetailLevel? detail, IDictionary serializedAdditionalRawData) + internal MessageImageUriParam(string uri, ImageDetailLevel? detail, IDictionary serializedAdditionalRawData) { - Url = url; + Uri = uri; Detail = detail; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal MessageImageUrlParam() + /// Initializes a new instance of for deserialization. + internal MessageImageUriParam() { } /// The publicly accessible URL of the external image. - public string Url { get; } + public string Uri { get; } /// Optional detail level for the image (auto, low, or high). Defaults to 'auto' if not specified. public ImageDetailLevel? Detail { get; set; } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputContentBlock.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputContentBlock.Serialization.cs index 2fbe7508bd26..712951e310b1 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputContentBlock.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputContentBlock.Serialization.cs @@ -78,7 +78,7 @@ internal static MessageInputContentBlock DeserializeMessageInputContentBlock(Jso switch (discriminator.GetString()) { case "image_file": return MessageInputImageFileBlock.DeserializeMessageInputImageFileBlock(element, options); - case "image_url": return MessageInputImageUrlBlock.DeserializeMessageInputImageUrlBlock(element, options); + case "image_url": return MessageInputImageUriBlock.DeserializeMessageInputImageUriBlock(element, options); case "text": return MessageInputTextBlock.DeserializeMessageInputTextBlock(element, options); } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputContentBlock.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputContentBlock.cs index 463760040420..16351489e8e1 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputContentBlock.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputContentBlock.cs @@ -13,7 +13,7 @@ namespace Azure.AI.Agents.Persistent /// /// Defines a single content block when creating a message. The 'type' field determines whether it is text, an image file, or an external image URL, etc. /// 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 MessageInputContentBlock { diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputImageUrlBlock.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputImageUriBlock.Serialization.cs similarity index 71% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputImageUrlBlock.Serialization.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputImageUriBlock.Serialization.cs index f246b3a61cf3..f86084121000 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputImageUrlBlock.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputImageUriBlock.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Agents.Persistent { - public partial class MessageInputImageUrlBlock : IUtf8JsonSerializable, IJsonModel + public partial class MessageInputImageUriBlock : 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, ModelRea /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MessageInputImageUrlBlock)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MessageInputImageUriBlock)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -39,19 +39,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(ImageUrl, options); } - MessageInputImageUrlBlock IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MessageInputImageUriBlock 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(MessageInputImageUrlBlock)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MessageInputImageUriBlock)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageInputImageUrlBlock(document.RootElement, options); + return DeserializeMessageInputImageUriBlock(document.RootElement, options); } - internal static MessageInputImageUrlBlock DeserializeMessageInputImageUrlBlock(JsonElement element, ModelReaderWriterOptions options = null) + internal static MessageInputImageUriBlock DeserializeMessageInputImageUriBlock(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -59,7 +59,7 @@ internal static MessageInputImageUrlBlock DeserializeMessageInputImageUrlBlock(J { return null; } - MessageImageUrlParam imageUrl = default; + MessageImageUriParam imageUrl = default; MessageBlockType type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -67,7 +67,7 @@ internal static MessageInputImageUrlBlock DeserializeMessageInputImageUrlBlock(J { if (property.NameEquals("image_url"u8)) { - imageUrl = MessageImageUrlParam.DeserializeMessageImageUrlParam(property.Value, options); + imageUrl = MessageImageUriParam.DeserializeMessageImageUriParam(property.Value, options); continue; } if (property.NameEquals("type"u8)) @@ -81,46 +81,46 @@ internal static MessageInputImageUrlBlock DeserializeMessageInputImageUrlBlock(J } } serializedAdditionalRawData = rawDataDictionary; - return new MessageInputImageUrlBlock(type, serializedAdditionalRawData, imageUrl); + return new MessageInputImageUriBlock(type, serializedAdditionalRawData, imageUrl); } - 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(MessageInputImageUrlBlock)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MessageInputImageUriBlock)} does not support writing '{options.Format}' format."); } } - MessageInputImageUrlBlock IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MessageInputImageUriBlock 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 DeserializeMessageInputImageUrlBlock(document.RootElement, options); + return DeserializeMessageInputImageUriBlock(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MessageInputImageUrlBlock)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MessageInputImageUriBlock)} 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 new MessageInputImageUrlBlock FromResponse(Response response) + internal static new MessageInputImageUriBlock FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMessageInputImageUrlBlock(document.RootElement); + return DeserializeMessageInputImageUriBlock(document.RootElement); } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputImageUrlBlock.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputImageUriBlock.cs similarity index 76% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputImageUrlBlock.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputImageUriBlock.cs index 26dc7c9e35c7..dd9b2bd8ca59 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputImageUrlBlock.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageInputImageUriBlock.cs @@ -11,12 +11,12 @@ namespace Azure.AI.Agents.Persistent { /// An image-URL block in a new message, referencing an external image by URL. - public partial class MessageInputImageUrlBlock : MessageInputContentBlock + public partial class MessageInputImageUriBlock : MessageInputContentBlock { - /// Initializes a new instance of . + /// Initializes a new instance of . /// Information about the external image URL, including the URL and optional detail level. /// is null. - public MessageInputImageUrlBlock(MessageImageUrlParam imageUrl) + public MessageInputImageUriBlock(MessageImageUriParam imageUrl) { Argument.AssertNotNull(imageUrl, nameof(imageUrl)); @@ -24,21 +24,21 @@ public MessageInputImageUrlBlock(MessageImageUrlParam imageUrl) ImageUrl = imageUrl; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Specifies which kind of content block this is (text, image_file, image_url, etc.). /// Keeps track of any properties unknown to the library. /// Information about the external image URL, including the URL and optional detail level. - internal MessageInputImageUrlBlock(MessageBlockType type, IDictionary serializedAdditionalRawData, MessageImageUrlParam imageUrl) : base(type, serializedAdditionalRawData) + internal MessageInputImageUriBlock(MessageBlockType type, IDictionary serializedAdditionalRawData, MessageImageUriParam imageUrl) : base(type, serializedAdditionalRawData) { ImageUrl = imageUrl; } - /// Initializes a new instance of for deserialization. - internal MessageInputImageUrlBlock() + /// Initializes a new instance of for deserialization. + internal MessageInputImageUriBlock() { } /// Information about the external image URL, including the URL and optional detail level. - public MessageImageUrlParam ImageUrl { get; } + public MessageImageUriParam ImageUrl { get; } } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextAnnotation.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextAnnotation.Serialization.cs index ca4ca56d2565..790b293a759e 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextAnnotation.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextAnnotation.Serialization.cs @@ -81,7 +81,7 @@ internal static MessageTextAnnotation DeserializeMessageTextAnnotation(JsonEleme { case "file_citation": return MessageTextFileCitationAnnotation.DeserializeMessageTextFileCitationAnnotation(element, options); case "file_path": return MessageTextFilePathAnnotation.DeserializeMessageTextFilePathAnnotation(element, options); - case "url_citation": return MessageTextUrlCitationAnnotation.DeserializeMessageTextUrlCitationAnnotation(element, options); + case "url_citation": return MessageTextUriCitationAnnotation.DeserializeMessageTextUriCitationAnnotation(element, options); } } return UnknownMessageTextAnnotation.DeserializeUnknownMessageTextAnnotation(element, options); diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextAnnotation.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextAnnotation.cs index 94824f160c89..360471476b8b 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextAnnotation.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextAnnotation.cs @@ -13,7 +13,7 @@ namespace Azure.AI.Agents.Persistent /// /// An abstract representation of an annotation to text thread message content. /// 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 MessageTextAnnotation { diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUrlCitationAnnotation.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUriCitationAnnotation.Serialization.cs similarity index 76% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUrlCitationAnnotation.Serialization.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUriCitationAnnotation.Serialization.cs index f185225e6435..31e2634ff2f9 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUrlCitationAnnotation.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUriCitationAnnotation.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Agents.Persistent { - public partial class MessageTextUrlCitationAnnotation : IUtf8JsonSerializable, IJsonModel + public partial class MessageTextUriCitationAnnotation : 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,15 +28,15 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(MessageTextUrlCitationAnnotation)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MessageTextUriCitationAnnotation)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); writer.WritePropertyName("url_citation"u8); - writer.WriteObjectValue(UrlCitation, options); + writer.WriteObjectValue(UriCitation, options); if (Optional.IsDefined(StartIndex)) { writer.WritePropertyName("start_index"u8); @@ -49,19 +49,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - MessageTextUrlCitationAnnotation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MessageTextUriCitationAnnotation 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(MessageTextUrlCitationAnnotation)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MessageTextUriCitationAnnotation)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageTextUrlCitationAnnotation(document.RootElement, options); + return DeserializeMessageTextUriCitationAnnotation(document.RootElement, options); } - internal static MessageTextUrlCitationAnnotation DeserializeMessageTextUrlCitationAnnotation(JsonElement element, ModelReaderWriterOptions options = null) + internal static MessageTextUriCitationAnnotation DeserializeMessageTextUriCitationAnnotation(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -69,7 +69,7 @@ internal static MessageTextUrlCitationAnnotation DeserializeMessageTextUrlCitati { return null; } - MessageTextUrlCitationDetails urlCitation = default; + MessageTextUriCitationDetails urlCitation = default; int? startIndex = default; int? endIndex = default; string type = default; @@ -80,7 +80,7 @@ internal static MessageTextUrlCitationAnnotation DeserializeMessageTextUrlCitati { if (property.NameEquals("url_citation"u8)) { - urlCitation = MessageTextUrlCitationDetails.DeserializeMessageTextUrlCitationDetails(property.Value, options); + urlCitation = MessageTextUriCitationDetails.DeserializeMessageTextUriCitationDetails(property.Value, options); continue; } if (property.NameEquals("start_index"u8)) @@ -117,7 +117,7 @@ internal static MessageTextUrlCitationAnnotation DeserializeMessageTextUrlCitati } } serializedAdditionalRawData = rawDataDictionary; - return new MessageTextUrlCitationAnnotation( + return new MessageTextUriCitationAnnotation( type, text, serializedAdditionalRawData, @@ -126,43 +126,43 @@ internal static MessageTextUrlCitationAnnotation DeserializeMessageTextUrlCitati endIndex); } - 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(MessageTextUrlCitationAnnotation)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MessageTextUriCitationAnnotation)} does not support writing '{options.Format}' format."); } } - MessageTextUrlCitationAnnotation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MessageTextUriCitationAnnotation 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 DeserializeMessageTextUrlCitationAnnotation(document.RootElement, options); + return DeserializeMessageTextUriCitationAnnotation(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MessageTextUrlCitationAnnotation)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MessageTextUriCitationAnnotation)} 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 new MessageTextUrlCitationAnnotation FromResponse(Response response) + internal static new MessageTextUriCitationAnnotation FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMessageTextUrlCitationAnnotation(document.RootElement); + return DeserializeMessageTextUriCitationAnnotation(document.RootElement); } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUrlCitationAnnotation.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUriCitationAnnotation.cs similarity index 68% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUrlCitationAnnotation.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUriCitationAnnotation.cs index a7180d4fd780..5c44bda00f1d 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUrlCitationAnnotation.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUriCitationAnnotation.cs @@ -11,42 +11,42 @@ namespace Azure.AI.Agents.Persistent { /// A citation within the message that points to a specific URL associated with the message. Generated when the agent uses tools such as 'bing_grounding' to search the Internet. - public partial class MessageTextUrlCitationAnnotation : MessageTextAnnotation + public partial class MessageTextUriCitationAnnotation : MessageTextAnnotation { - /// Initializes a new instance of . + /// Initializes a new instance of . /// The textual content associated with this text annotation item. - /// The details of the URL citation. - /// or is null. - internal MessageTextUrlCitationAnnotation(string text, MessageTextUrlCitationDetails urlCitation) : base(text) + /// The details of the URL citation. + /// or is null. + internal MessageTextUriCitationAnnotation(string text, MessageTextUriCitationDetails uriCitation) : base(text) { Argument.AssertNotNull(text, nameof(text)); - Argument.AssertNotNull(urlCitation, nameof(urlCitation)); + Argument.AssertNotNull(uriCitation, nameof(uriCitation)); Type = "url_citation"; - UrlCitation = urlCitation; + UriCitation = uriCitation; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The object type. /// The textual content associated with this text annotation item. /// Keeps track of any properties unknown to the library. - /// The details of the URL citation. + /// The details of the URL citation. /// The first text index associated with this text annotation. /// The last text index associated with this text annotation. - internal MessageTextUrlCitationAnnotation(string type, string text, IDictionary serializedAdditionalRawData, MessageTextUrlCitationDetails urlCitation, int? startIndex, int? endIndex) : base(type, text, serializedAdditionalRawData) + internal MessageTextUriCitationAnnotation(string type, string text, IDictionary serializedAdditionalRawData, MessageTextUriCitationDetails uriCitation, int? startIndex, int? endIndex) : base(type, text, serializedAdditionalRawData) { - UrlCitation = urlCitation; + UriCitation = uriCitation; StartIndex = startIndex; EndIndex = endIndex; } - /// Initializes a new instance of for deserialization. - internal MessageTextUrlCitationAnnotation() + /// Initializes a new instance of for deserialization. + internal MessageTextUriCitationAnnotation() { } /// The details of the URL citation. - public MessageTextUrlCitationDetails UrlCitation { get; } + public MessageTextUriCitationDetails UriCitation { get; } /// The first text index associated with this text annotation. public int? StartIndex { get; } /// The last text index associated with this text annotation. diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUrlCitationDetails.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUriCitationDetails.Serialization.cs similarity index 77% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUrlCitationDetails.Serialization.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUriCitationDetails.Serialization.cs index 96916c93c0aa..e8df60d3d14b 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUrlCitationDetails.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUriCitationDetails.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Agents.Persistent { - public partial class MessageTextUrlCitationDetails : IUtf8JsonSerializable, IJsonModel + public partial class MessageTextUriCitationDetails : 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,14 +28,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// 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(MessageTextUrlCitationDetails)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MessageTextUriCitationDetails)} does not support writing '{format}' format."); } writer.WritePropertyName("url"u8); - writer.WriteStringValue(Url); + writer.WriteStringValue(Uri); if (Optional.IsDefined(Title)) { writer.WritePropertyName("title"u8); @@ -58,19 +58,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - MessageTextUrlCitationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MessageTextUriCitationDetails 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(MessageTextUrlCitationDetails)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MessageTextUriCitationDetails)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageTextUrlCitationDetails(document.RootElement, options); + return DeserializeMessageTextUriCitationDetails(document.RootElement, options); } - internal static MessageTextUrlCitationDetails DeserializeMessageTextUrlCitationDetails(JsonElement element, ModelReaderWriterOptions options = null) + internal static MessageTextUriCitationDetails DeserializeMessageTextUriCitationDetails(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -100,46 +100,46 @@ internal static MessageTextUrlCitationDetails DeserializeMessageTextUrlCitationD } } serializedAdditionalRawData = rawDataDictionary; - return new MessageTextUrlCitationDetails(url, title, serializedAdditionalRawData); + return new MessageTextUriCitationDetails(url, title, 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(MessageTextUrlCitationDetails)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MessageTextUriCitationDetails)} does not support writing '{options.Format}' format."); } } - MessageTextUrlCitationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MessageTextUriCitationDetails 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 DeserializeMessageTextUrlCitationDetails(document.RootElement, options); + return DeserializeMessageTextUriCitationDetails(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(MessageTextUrlCitationDetails)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MessageTextUriCitationDetails)} 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 MessageTextUrlCitationDetails FromResponse(Response response) + internal static MessageTextUriCitationDetails FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeMessageTextUrlCitationDetails(document.RootElement); + return DeserializeMessageTextUriCitationDetails(document.RootElement); } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUrlCitationDetails.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUriCitationDetails.cs similarity index 79% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUrlCitationDetails.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUriCitationDetails.cs index e2ebb94dbc42..68ffed9cca37 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUrlCitationDetails.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/MessageTextUriCitationDetails.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Agents.Persistent { /// A representation of a URL citation, as used in text thread message content. - public partial class MessageTextUrlCitationDetails + public partial class MessageTextUriCitationDetails { /// /// Keeps track of any properties unknown to the library. @@ -45,34 +45,34 @@ public partial class MessageTextUrlCitationDetails /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The URL associated with this citation. - /// is null. - internal MessageTextUrlCitationDetails(string url) + /// Initializes a new instance of . + /// The URL associated with this citation. + /// is null. + internal MessageTextUriCitationDetails(string uri) { - Argument.AssertNotNull(url, nameof(url)); + Argument.AssertNotNull(uri, nameof(uri)); - Url = url; + Uri = uri; } - /// Initializes a new instance of . - /// The URL associated with this citation. + /// Initializes a new instance of . + /// The URL associated with this citation. /// The title of the URL. /// Keeps track of any properties unknown to the library. - internal MessageTextUrlCitationDetails(string url, string title, IDictionary serializedAdditionalRawData) + internal MessageTextUriCitationDetails(string uri, string title, IDictionary serializedAdditionalRawData) { - Url = url; + Uri = uri; Title = title; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal MessageTextUrlCitationDetails() + /// Initializes a new instance of for deserialization. + internal MessageTextUriCitationDetails() { } /// The URL associated with this citation. - public string Url { get; } + public string Uri { get; } /// The title of the URL. public string Title { get; } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentStreamEvent.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentStreamEvent.cs index 436afac3cea6..833656dfbdbf 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentStreamEvent.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentStreamEvent.cs @@ -50,10 +50,10 @@ public PersistentAgentStreamEvent(string value) private const string ThreadRunCancellingValue = "thread.run.cancelling"; private const string ThreadRunCancelledValue = "thread.run.cancelled"; private const string ThreadRunExpiredValue = "thread.run.expired"; - private const string ThreadRunStepCreatedValue = "thread.run.step.created"; - private const string ThreadRunStepInProgressValue = "thread.run.step.in_progress"; - private const string ThreadRunStepDeltaValue = "thread.run.step.delta"; - private const string ThreadRunStepCompletedValue = "thread.run.step.completed"; + private const string CreatedValue = "thread.run.step.created"; + private const string InProgressValue = "thread.run.step.in_progress"; + private const string DeltaValue = "thread.run.step.delta"; + private const string CompletedValue = "thread.run.step.completed"; private const string ThreadRunStepFailedValue = "thread.run.step.failed"; private const string ThreadRunStepCancelledValue = "thread.run.step.cancelled"; private const string ThreadRunStepExpiredValue = "thread.run.step.expired"; @@ -88,13 +88,13 @@ public PersistentAgentStreamEvent(string value) /// Event sent when a run is expired. The data of this event is of type ThreadRun. public static PersistentAgentStreamEvent ThreadRunExpired { get; } = new PersistentAgentStreamEvent(ThreadRunExpiredValue); /// Event sent when a new thread run step is created. The data of this event is of type RunStep. - public static PersistentAgentStreamEvent ThreadRunStepCreated { get; } = new PersistentAgentStreamEvent(ThreadRunStepCreatedValue); + public static PersistentAgentStreamEvent Created { get; } = new PersistentAgentStreamEvent(CreatedValue); /// Event sent when a run step moves to `in_progress` status. The data of this event is of type RunStep. - public static PersistentAgentStreamEvent ThreadRunStepInProgress { get; } = new PersistentAgentStreamEvent(ThreadRunStepInProgressValue); + public static PersistentAgentStreamEvent InProgress { get; } = new PersistentAgentStreamEvent(InProgressValue); /// Event sent when a run step is being streamed. The data of this event is of type RunStepDeltaChunk. - public static PersistentAgentStreamEvent ThreadRunStepDelta { get; } = new PersistentAgentStreamEvent(ThreadRunStepDeltaValue); + public static PersistentAgentStreamEvent Delta { get; } = new PersistentAgentStreamEvent(DeltaValue); /// Event sent when a run step is completed. The data of this event is of type RunStep. - public static PersistentAgentStreamEvent ThreadRunStepCompleted { get; } = new PersistentAgentStreamEvent(ThreadRunStepCompletedValue); + public static PersistentAgentStreamEvent Completed { get; } = new PersistentAgentStreamEvent(CompletedValue); /// Event sent when a run step fails. The data of this event is of type RunStep. public static PersistentAgentStreamEvent ThreadRunStepFailed { get; } = new PersistentAgentStreamEvent(ThreadRunStepFailedValue); /// Event sent when a run step is cancelled. The data of this event is of type RunStep. diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsAdministration.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsAdministration.cs index 92faf2b07d16..ecd4e8b3ee86 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsAdministration.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsAdministration.cs @@ -653,7 +653,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, TruncationObject 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, 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) { Argument.AssertNotNull(assistantId, nameof(assistantId)); @@ -719,7 +719,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, TruncationObject 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, 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) { Argument.AssertNotNull(assistantId, nameof(assistantId)); @@ -756,7 +756,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. /// /// /// @@ -794,7 +794,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/FunctionName.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsFunctionName.Serialization.cs similarity index 64% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/FunctionName.Serialization.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsFunctionName.Serialization.cs index ee8438c084c5..4028b14d4a75 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/FunctionName.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsFunctionName.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Agents.Persistent { - public partial class FunctionName : IUtf8JsonSerializable, IJsonModel + public partial class PersistentAgentsFunctionName : 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, ModelReaderWriterOpti /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(FunctionName)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(PersistentAgentsFunctionName)} does not support writing '{format}' format."); } writer.WritePropertyName("name"u8); @@ -53,19 +53,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - FunctionName IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + PersistentAgentsFunctionName 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(FunctionName)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(PersistentAgentsFunctionName)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeFunctionName(document.RootElement, options); + return DeserializePersistentAgentsFunctionName(document.RootElement, options); } - internal static FunctionName DeserializeFunctionName(JsonElement element, ModelReaderWriterOptions options = null) + internal static PersistentAgentsFunctionName DeserializePersistentAgentsFunctionName(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -89,46 +89,46 @@ internal static FunctionName DeserializeFunctionName(JsonElement element, ModelR } } serializedAdditionalRawData = rawDataDictionary; - return new FunctionName(name, serializedAdditionalRawData); + return new PersistentAgentsFunctionName(name, 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(FunctionName)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(PersistentAgentsFunctionName)} does not support writing '{options.Format}' format."); } } - FunctionName IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + PersistentAgentsFunctionName 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 DeserializeFunctionName(document.RootElement, options); + return DeserializePersistentAgentsFunctionName(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(FunctionName)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(PersistentAgentsFunctionName)} 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 FunctionName FromResponse(Response response) + internal static PersistentAgentsFunctionName FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeFunctionName(document.RootElement); + return DeserializePersistentAgentsFunctionName(document.RootElement); } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/FunctionName.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsFunctionName.cs similarity index 79% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/FunctionName.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsFunctionName.cs index 32c48b9df3ab..1fbfcafaea32 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/FunctionName.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsFunctionName.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Agents.Persistent { /// The function name that will be used, if using the `function` tool. - public partial class FunctionName + public partial class PersistentAgentsFunctionName { /// /// Keeps track of any properties unknown to the library. @@ -45,27 +45,27 @@ public partial class FunctionName /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the function to call. /// is null. - public FunctionName(string name) + public PersistentAgentsFunctionName(string name) { Argument.AssertNotNull(name, nameof(name)); Name = name; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The name of the function to call. /// Keeps track of any properties unknown to the library. - internal FunctionName(string name, IDictionary serializedAdditionalRawData) + internal PersistentAgentsFunctionName(string name, IDictionary serializedAdditionalRawData) { Name = name; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal FunctionName() + /// Initializes a new instance of for deserialization. + internal PersistentAgentsFunctionName() { } 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 81b0ed0a6be4..88c9416b5efa 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsModelFactory.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsModelFactory.cs @@ -81,21 +81,21 @@ public static MessageImageFileParam MessageImageFileParam(string fileId = null, return new MessageImageFileParam(fileId, detail, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Information about the external image URL, including the URL and optional detail level. - /// A new instance for mocking. - public static MessageInputImageUrlBlock MessageInputImageUrlBlock(MessageImageUrlParam imageUrl = null) + /// A new instance for mocking. + public static MessageInputImageUriBlock MessageInputImageUriBlock(MessageImageUriParam imageUrl = null) { - return new MessageInputImageUrlBlock(MessageBlockType.ImageUrl, serializedAdditionalRawData: null, imageUrl); + return new MessageInputImageUriBlock(MessageBlockType.ImageUrl, serializedAdditionalRawData: null, imageUrl); } - /// Initializes a new instance of . - /// The publicly accessible URL of the external image. + /// Initializes a new instance of . + /// The publicly accessible URL of the external image. /// Optional detail level for the image (auto, low, or high). Defaults to 'auto' if not specified. - /// A new instance for mocking. - public static MessageImageUrlParam MessageImageUrlParam(string url = null, ImageDetailLevel? detail = null) + /// A new instance for mocking. + public static MessageImageUriParam MessageImageUriParam(string uri = null, ImageDetailLevel? detail = null) { - return new MessageImageUrlParam(url, detail, serializedAdditionalRawData: null); + return new MessageImageUriParam(uri, detail, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -134,6 +134,50 @@ public static RunCompletionUsage RunCompletionUsage(long completionTokens = defa return new RunCompletionUsage(completionTokens, promptTokens, totalTokens, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The identifier, which can be referenced in API endpoints. + /// The object type, which is always 'thread.message'. + /// The Unix timestamp, in seconds, representing when this object was created. + /// The ID of the thread that this message belongs to. + /// The status of the message. + /// On an incomplete message, details about why the message is incomplete. + /// The Unix timestamp (in seconds) for when the message was completed. + /// The Unix timestamp (in seconds) for when the message was marked as incomplete. + /// The role associated with the agent thread message. + /// + /// The list of content items associated with the agent thread message. + /// 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 . + /// + /// If applicable, the ID of the agent that authored this message. + /// If applicable, the ID of the run associated with the authoring of this message. + /// A list of files attached to the message, and the tools they were added to. + /// 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. + /// A new instance for mocking. + public static PersistentThreadMessage PersistentThreadMessage(string id = null, PersistentThreadMessageObject @object = default, DateTimeOffset createdAt = default, string threadId = null, MessageStatus status = default, MessageIncompleteDetails incompleteDetails = null, DateTimeOffset? completedAt = null, DateTimeOffset? incompleteAt = null, MessageRole role = default, IEnumerable contentItems = null, string assistantId = null, string runId = null, IEnumerable attachments = null, IReadOnlyDictionary metadata = null) + { + contentItems ??= new List(); + attachments ??= new List(); + metadata ??= new Dictionary(); + + return new PersistentThreadMessage( + id, + @object, + createdAt, + threadId, + status, + incompleteDetails, + completedAt, + incompleteAt, + role, + contentItems?.ToList(), + assistantId, + runId, + attachments?.ToList(), + metadata, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The provided reason describing why the message was marked as incomplete. /// A new instance for mocking. @@ -151,30 +195,30 @@ public static MessageTextAnnotation MessageTextAnnotation(string type = null, st return new UnknownMessageTextAnnotation(type, text, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The textual content associated with this text annotation item. - /// The details of the URL citation. + /// The details of the URL citation. /// The first text index associated with this text annotation. /// The last text index associated with this text annotation. - /// A new instance for mocking. - public static MessageTextUrlCitationAnnotation MessageTextUrlCitationAnnotation(string text = null, MessageTextUrlCitationDetails urlCitation = null, int? startIndex = null, int? endIndex = null) + /// A new instance for mocking. + public static MessageTextUriCitationAnnotation MessageTextUriCitationAnnotation(string text = null, MessageTextUriCitationDetails uriCitation = null, int? startIndex = null, int? endIndex = null) { - return new MessageTextUrlCitationAnnotation( + return new MessageTextUriCitationAnnotation( "url_citation", text, serializedAdditionalRawData: null, - urlCitation, + uriCitation, startIndex, endIndex); } - /// Initializes a new instance of . - /// The URL associated with this citation. + /// Initializes a new instance of . + /// The URL associated with this citation. /// The title of the URL. - /// A new instance for mocking. - public static MessageTextUrlCitationDetails MessageTextUrlCitationDetails(string url = null, string title = null) + /// A new instance for mocking. + public static MessageTextUriCitationDetails MessageTextUriCitationDetails(string uri = null, string title = null) { - return new MessageTextUrlCitationDetails(url, title, serializedAdditionalRawData: null); + return new MessageTextUriCitationDetails(uri, title, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -367,7 +411,7 @@ public static RunStepCompletionUsage RunStepCompletionUsage(long completionToken return new RunStepCompletionUsage(completionTokens, promptTokens, totalTokens, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The identifier, which can be referenced in API endpoints. /// The object type, which is always `vector_store`. /// The Unix timestamp (in seconds) for when the vector store was created. @@ -379,12 +423,12 @@ public static RunStepCompletionUsage RunStepCompletionUsage(long completionToken /// The Unix timestamp (in seconds) for when the vector store will expire. /// The Unix timestamp (in seconds) for when the vector store was last active. /// 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. - /// A new instance for mocking. - public static VectorStore VectorStore(string id = null, VectorStoreObject @object = default, DateTimeOffset createdAt = default, string name = null, int usageBytes = default, VectorStoreFileCount fileCounts = null, VectorStoreStatus status = default, VectorStoreExpirationPolicy expiresAfter = null, DateTimeOffset? expiresAt = null, DateTimeOffset? lastActiveAt = null, IReadOnlyDictionary metadata = null) + /// A new instance for mocking. + public static PersistentAgentsVectorStore PersistentAgentsVectorStore(string id = null, PersistentAgentsVectorStoreObject @object = default, DateTimeOffset createdAt = default, string name = null, int usageBytes = default, VectorStoreFileCount fileCounts = null, VectorStoreStatus status = default, VectorStoreExpirationPolicy expiresAfter = null, DateTimeOffset? expiresAt = null, DateTimeOffset? lastActiveAt = null, IReadOnlyDictionary metadata = null) { metadata ??= new Dictionary(); - return new VectorStore( + return new PersistentAgentsVectorStore( id, @object, createdAt, @@ -425,16 +469,6 @@ public static VectorStoreStaticChunkingStrategyRequest VectorStoreStaticChunking return new VectorStoreStaticChunkingStrategyRequest(VectorStoreChunkingStrategyRequestType.Static, serializedAdditionalRawData: null, @static); } - /// Initializes a new instance of . - /// The ID of the resource specified for deletion. - /// A value indicating whether deletion was successful. - /// The object type, which is always 'vector_store.deleted'. - /// A new instance for mocking. - public static VectorStoreDeletionStatus VectorStoreDeletionStatus(string id = null, bool deleted = default, VectorStoreDeletionStatusObject @object = default) - { - return new VectorStoreDeletionStatus(id, deleted, @object, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The identifier, which can be referenced in API endpoints. /// The object type, which is always `vector_store.file`. @@ -483,16 +517,6 @@ public static VectorStoreStaticChunkingStrategyResponse VectorStoreStaticChunkin return new VectorStoreStaticChunkingStrategyResponse(VectorStoreChunkingStrategyResponseType.Static, serializedAdditionalRawData: null, @static); } - /// Initializes a new instance of . - /// The ID of the resource specified for deletion. - /// A value indicating whether deletion was successful. - /// The object type, which is always 'vector_store.deleted'. - /// A new instance for mocking. - public static VectorStoreFileDeletionStatus VectorStoreFileDeletionStatus(string id = null, bool deleted = default, VectorStoreFileDeletionStatusObject @object = default) - { - return new VectorStoreFileDeletionStatus(id, deleted, @object, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The identifier, which can be referenced in API endpoints. /// The object type, which is always `vector_store.file_batch`. @@ -578,7 +602,7 @@ public static MessageDeltaTextContent MessageDeltaTextContent(int index = defaul /// /// Annotations for the text. /// 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 MessageDeltaTextContentObject MessageDeltaTextContentObject(string value = null, IEnumerable annotations = null) @@ -597,30 +621,30 @@ public static MessageDeltaTextAnnotation MessageDeltaTextAnnotation(int index = return new UnknownMessageDeltaTextAnnotation(index, type, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The index of the annotation within a text content part. - /// The details of the URL citation. + /// The details of the URL citation. /// The first text index associated with this text annotation. /// The last text index associated with this text annotation. - /// A new instance for mocking. - public static MessageDeltaTextUrlCitationAnnotation MessageDeltaTextUrlCitationAnnotation(int index = default, MessageDeltaTextUrlCitationDetails urlCitation = null, int? startIndex = null, int? endIndex = null) + /// A new instance for mocking. + public static MessageDeltaTextUriCitationAnnotation MessageDeltaTextUriCitationAnnotation(int index = default, MessageDeltaTextUriCitationDetails uriCitation = null, int? startIndex = null, int? endIndex = null) { - return new MessageDeltaTextUrlCitationAnnotation( + return new MessageDeltaTextUriCitationAnnotation( index, "url_citation", serializedAdditionalRawData: null, - urlCitation, + uriCitation, startIndex, endIndex); } - /// Initializes a new instance of . - /// The URL associated with this citation. + /// Initializes a new instance of . + /// The URL associated with this citation. /// The title of the URL. - /// A new instance for mocking. - public static MessageDeltaTextUrlCitationDetails MessageDeltaTextUrlCitationDetails(string url = null, string title = null) + /// A new instance for mocking. + public static MessageDeltaTextUriCitationDetails MessageDeltaTextUriCitationDetails(string uri = null, string title = null) { - return new MessageDeltaTextUrlCitationDetails(url, title, serializedAdditionalRawData: null); + return new MessageDeltaTextUriCitationDetails(uri, title, serializedAdditionalRawData: null); } /// Initializes a new instance of . diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsNamedToolChoice.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsNamedToolChoice.Serialization.cs index f0b5651d60da..9c5b419356ee 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsNamedToolChoice.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsNamedToolChoice.Serialization.cs @@ -79,7 +79,7 @@ internal static PersistentAgentsNamedToolChoice DeserializePersistentAgentsNamed return null; } PersistentAgentsNamedToolChoiceType type = default; - FunctionName function = default; + PersistentAgentsFunctionName function = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -95,7 +95,7 @@ internal static PersistentAgentsNamedToolChoice DeserializePersistentAgentsNamed { continue; } - function = FunctionName.DeserializeFunctionName(property.Value, options); + function = PersistentAgentsFunctionName.DeserializePersistentAgentsFunctionName(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsNamedToolChoice.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsNamedToolChoice.cs index c79eac952589..9b2e58d38d38 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsNamedToolChoice.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsNamedToolChoice.cs @@ -56,7 +56,7 @@ public PersistentAgentsNamedToolChoice(PersistentAgentsNamedToolChoiceType type) /// the type of tool. If type is `function`, the function name must be set. /// The name of the function to call. /// Keeps track of any properties unknown to the library. - internal PersistentAgentsNamedToolChoice(PersistentAgentsNamedToolChoiceType type, FunctionName function, IDictionary serializedAdditionalRawData) + internal PersistentAgentsNamedToolChoice(PersistentAgentsNamedToolChoiceType type, PersistentAgentsFunctionName function, IDictionary serializedAdditionalRawData) { Type = type; Function = function; @@ -71,6 +71,6 @@ internal PersistentAgentsNamedToolChoice() /// the type of tool. If type is `function`, the function name must be set. public PersistentAgentsNamedToolChoiceType Type { get; set; } /// The name of the function to call. - public FunctionName Function { get; set; } + public PersistentAgentsFunctionName Function { get; set; } } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStore.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsVectorStore.Serialization.cs similarity index 80% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStore.Serialization.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsVectorStore.Serialization.cs index 3f84085b7336..05ee04e969d0 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStore.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsVectorStore.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Agents.Persistent { - public partial class VectorStore : IUtf8JsonSerializable, IJsonModel + public partial class PersistentAgentsVectorStore : 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, ModelReaderWriterOptio /// 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(VectorStore)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(PersistentAgentsVectorStore)} does not support writing '{format}' format."); } writer.WritePropertyName("id"u8); @@ -106,19 +106,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - VectorStore IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + PersistentAgentsVectorStore 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(VectorStore)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(PersistentAgentsVectorStore)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeVectorStore(document.RootElement, options); + return DeserializePersistentAgentsVectorStore(document.RootElement, options); } - internal static VectorStore DeserializeVectorStore(JsonElement element, ModelReaderWriterOptions options = null) + internal static PersistentAgentsVectorStore DeserializePersistentAgentsVectorStore(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -127,7 +127,7 @@ internal static VectorStore DeserializeVectorStore(JsonElement element, ModelRea return null; } string id = default; - VectorStoreObject @object = default; + PersistentAgentsVectorStoreObject @object = default; DateTimeOffset createdAt = default; string name = default; int usageBytes = default; @@ -148,7 +148,7 @@ internal static VectorStore DeserializeVectorStore(JsonElement element, ModelRea } if (property.NameEquals("object"u8)) { - @object = new VectorStoreObject(property.Value.GetString()); + @object = new PersistentAgentsVectorStoreObject(property.Value.GetString()); continue; } if (property.NameEquals("created_at"u8)) @@ -226,7 +226,7 @@ internal static VectorStore DeserializeVectorStore(JsonElement element, ModelRea } } serializedAdditionalRawData = rawDataDictionary; - return new VectorStore( + return new PersistentAgentsVectorStore( id, @object, createdAt, @@ -241,43 +241,43 @@ internal static VectorStore DeserializeVectorStore(JsonElement element, ModelRea 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(VectorStore)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(PersistentAgentsVectorStore)} does not support writing '{options.Format}' format."); } } - VectorStore IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + PersistentAgentsVectorStore 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 DeserializeVectorStore(document.RootElement, options); + return DeserializePersistentAgentsVectorStore(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(VectorStore)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(PersistentAgentsVectorStore)} 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 VectorStore FromResponse(Response response) + internal static PersistentAgentsVectorStore FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeVectorStore(document.RootElement); + return DeserializePersistentAgentsVectorStore(document.RootElement); } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStore.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsVectorStore.cs similarity index 85% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStore.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsVectorStore.cs index 3df0c5b747f1..d762c8ee4db0 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStore.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsVectorStore.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Agents.Persistent { /// A vector store is a collection of processed files can be used by the `file_search` tool. - public partial class VectorStore + public partial class PersistentAgentsVectorStore { /// /// Keeps track of any properties unknown to the library. @@ -45,7 +45,7 @@ public partial class VectorStore /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The identifier, which can be referenced in API endpoints. /// The Unix timestamp (in seconds) for when the vector store was created. /// The name of the vector store. @@ -55,7 +55,7 @@ public partial class VectorStore /// The Unix timestamp (in seconds) for when the vector store was last active. /// 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. /// , or is null. - internal VectorStore(string id, DateTimeOffset createdAt, string name, int usageBytes, VectorStoreFileCount fileCounts, VectorStoreStatus status, DateTimeOffset? lastActiveAt, IReadOnlyDictionary metadata) + internal PersistentAgentsVectorStore(string id, DateTimeOffset createdAt, string name, int usageBytes, VectorStoreFileCount fileCounts, VectorStoreStatus status, DateTimeOffset? lastActiveAt, IReadOnlyDictionary metadata) { Argument.AssertNotNull(id, nameof(id)); Argument.AssertNotNull(name, nameof(name)); @@ -71,7 +71,7 @@ internal VectorStore(string id, DateTimeOffset createdAt, string name, int usage Metadata = metadata; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The identifier, which can be referenced in API endpoints. /// The object type, which is always `vector_store`. /// The Unix timestamp (in seconds) for when the vector store was created. @@ -84,7 +84,7 @@ internal VectorStore(string id, DateTimeOffset createdAt, string name, int usage /// The Unix timestamp (in seconds) for when the vector store was last active. /// 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 VectorStore(string id, VectorStoreObject @object, DateTimeOffset createdAt, string name, int usageBytes, VectorStoreFileCount fileCounts, VectorStoreStatus status, VectorStoreExpirationPolicy expiresAfter, DateTimeOffset? expiresAt, DateTimeOffset? lastActiveAt, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) + internal PersistentAgentsVectorStore(string id, PersistentAgentsVectorStoreObject @object, DateTimeOffset createdAt, string name, int usageBytes, VectorStoreFileCount fileCounts, VectorStoreStatus status, VectorStoreExpirationPolicy expiresAfter, DateTimeOffset? expiresAt, DateTimeOffset? lastActiveAt, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) { Id = id; Object = @object; @@ -100,15 +100,15 @@ internal VectorStore(string id, VectorStoreObject @object, DateTimeOffset create _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal VectorStore() + /// Initializes a new instance of for deserialization. + internal PersistentAgentsVectorStore() { } /// The identifier, which can be referenced in API endpoints. public string Id { get; } /// The object type, which is always `vector_store`. - public VectorStoreObject Object { get; } = VectorStoreObject.VectorStore; + public PersistentAgentsVectorStoreObject Object { get; } = PersistentAgentsVectorStoreObject.VectorStore; /// The Unix timestamp (in seconds) for when the vector store was created. public DateTimeOffset CreatedAt { get; } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsVectorStoreObject.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsVectorStoreObject.cs new file mode 100644 index 000000000000..11798aa1abd7 --- /dev/null +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentAgentsVectorStoreObject.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Agents.Persistent +{ + /// The PersistentAgentsVectorStore_object. + public readonly partial struct PersistentAgentsVectorStoreObject : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PersistentAgentsVectorStoreObject(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string VectorStoreValue = "vector_store"; + + /// vector_store. + public static PersistentAgentsVectorStoreObject VectorStore { get; } = new PersistentAgentsVectorStoreObject(VectorStoreValue); + /// Determines if two values are the same. + public static bool operator ==(PersistentAgentsVectorStoreObject left, PersistentAgentsVectorStoreObject right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PersistentAgentsVectorStoreObject left, PersistentAgentsVectorStoreObject right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PersistentAgentsVectorStoreObject(string value) => new PersistentAgentsVectorStoreObject(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PersistentAgentsVectorStoreObject other && Equals(other); + /// + public bool Equals(PersistentAgentsVectorStoreObject other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadMessage.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentThreadMessage.Serialization.cs similarity index 84% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadMessage.Serialization.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentThreadMessage.Serialization.cs index 2c255aa88655..af612c224e1c 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadMessage.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentThreadMessage.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Agents.Persistent { - public partial class ThreadMessage : IUtf8JsonSerializable, IJsonModel + public partial class PersistentThreadMessage : 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,16 +28,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt /// 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(ThreadMessage)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(PersistentThreadMessage)} does not support writing '{format}' format."); } writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); writer.WritePropertyName("object"u8); - writer.WriteStringValue(Object); + writer.WriteStringValue(Object.ToString()); writer.WritePropertyName("created_at"u8); writer.WriteNumberValue(CreatedAt, "U"); writer.WritePropertyName("thread_id"u8); @@ -144,19 +144,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ThreadMessage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + PersistentThreadMessage 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(ThreadMessage)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(PersistentThreadMessage)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeThreadMessage(document.RootElement, options); + return DeserializePersistentThreadMessage(document.RootElement, options); } - internal static ThreadMessage DeserializeThreadMessage(JsonElement element, ModelReaderWriterOptions options = null) + internal static PersistentThreadMessage DeserializePersistentThreadMessage(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -165,7 +165,7 @@ internal static ThreadMessage DeserializeThreadMessage(JsonElement element, Mode return null; } string id = default; - string @object = default; + PersistentThreadMessageObject @object = default; DateTimeOffset createdAt = default; string threadId = default; MessageStatus status = default; @@ -189,7 +189,7 @@ internal static ThreadMessage DeserializeThreadMessage(JsonElement element, Mode } if (property.NameEquals("object"u8)) { - @object = property.Value.GetString(); + @object = new PersistentThreadMessageObject(property.Value.GetString()); continue; } if (property.NameEquals("created_at"u8)) @@ -308,7 +308,7 @@ internal static ThreadMessage DeserializeThreadMessage(JsonElement element, Mode } } serializedAdditionalRawData = rawDataDictionary; - return new ThreadMessage( + return new PersistentThreadMessage( id, @object, createdAt, @@ -326,43 +326,43 @@ internal static ThreadMessage DeserializeThreadMessage(JsonElement element, Mode 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(ThreadMessage)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(PersistentThreadMessage)} does not support writing '{options.Format}' format."); } } - ThreadMessage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + PersistentThreadMessage 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 DeserializeThreadMessage(document.RootElement, options); + return DeserializePersistentThreadMessage(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ThreadMessage)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(PersistentThreadMessage)} 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 ThreadMessage FromResponse(Response response) + internal static PersistentThreadMessage FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeThreadMessage(document.RootElement); + return DeserializePersistentThreadMessage(document.RootElement); } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadMessage.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentThreadMessage.cs similarity index 86% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadMessage.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentThreadMessage.cs index 25bbc92a0f1b..6a07c64941d3 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadMessage.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentThreadMessage.cs @@ -12,7 +12,7 @@ namespace Azure.AI.Agents.Persistent { /// A single, existing message within an agent thread. - public partial class ThreadMessage + public partial class PersistentThreadMessage { /// /// Keeps track of any properties unknown to the library. @@ -46,7 +46,7 @@ public partial class ThreadMessage /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The identifier, which can be referenced in API endpoints. /// The Unix timestamp, in seconds, representing when this object was created. /// The ID of the thread that this message belongs to. @@ -65,7 +65,7 @@ public partial class ThreadMessage /// A list of files attached to the message, and the tools they were added to. /// 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. /// , or is null. - internal ThreadMessage(string id, DateTimeOffset createdAt, string threadId, MessageStatus status, MessageIncompleteDetails incompleteDetails, DateTimeOffset? completedAt, DateTimeOffset? incompleteAt, MessageRole role, IEnumerable contentItems, string assistantId, string runId, IEnumerable attachments, IReadOnlyDictionary metadata) + internal PersistentThreadMessage(string id, DateTimeOffset createdAt, string threadId, MessageStatus status, MessageIncompleteDetails incompleteDetails, DateTimeOffset? completedAt, DateTimeOffset? incompleteAt, MessageRole role, IEnumerable contentItems, string assistantId, string runId, IEnumerable attachments, IReadOnlyDictionary metadata) { Argument.AssertNotNull(id, nameof(id)); Argument.AssertNotNull(threadId, nameof(threadId)); @@ -86,7 +86,7 @@ internal ThreadMessage(string id, DateTimeOffset createdAt, string threadId, Mes Metadata = metadata; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The identifier, which can be referenced in API endpoints. /// The object type, which is always 'thread.message'. /// The Unix timestamp, in seconds, representing when this object was created. @@ -106,7 +106,7 @@ internal ThreadMessage(string id, DateTimeOffset createdAt, string threadId, Mes /// A list of files attached to the message, and the tools they were added to. /// 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 ThreadMessage(string id, string @object, DateTimeOffset createdAt, string threadId, MessageStatus status, MessageIncompleteDetails incompleteDetails, DateTimeOffset? completedAt, DateTimeOffset? incompleteAt, MessageRole role, IReadOnlyList contentItems, string assistantId, string runId, IReadOnlyList attachments, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) + internal PersistentThreadMessage(string id, PersistentThreadMessageObject @object, DateTimeOffset createdAt, string threadId, MessageStatus status, MessageIncompleteDetails incompleteDetails, DateTimeOffset? completedAt, DateTimeOffset? incompleteAt, MessageRole role, IReadOnlyList contentItems, string assistantId, string runId, IReadOnlyList attachments, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) { Id = id; Object = @object; @@ -125,13 +125,15 @@ internal ThreadMessage(string id, string @object, DateTimeOffset createdAt, stri _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ThreadMessage() + /// Initializes a new instance of for deserialization. + internal PersistentThreadMessage() { } /// The identifier, which can be referenced in API endpoints. public string Id { get; } + /// The object type, which is always 'thread.message'. + public PersistentThreadMessageObject Object { get; } = PersistentThreadMessageObject.ThreadMessage; /// The Unix timestamp, in seconds, representing when this object was created. public DateTimeOffset CreatedAt { get; } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentThreadMessageObject.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentThreadMessageObject.cs new file mode 100644 index 000000000000..53e1e13338de --- /dev/null +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/PersistentThreadMessageObject.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Agents.Persistent +{ + /// The PersistentThreadMessage_object. + public readonly partial struct PersistentThreadMessageObject : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PersistentThreadMessageObject(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ThreadMessageValue = "thread.message"; + + /// thread.message. + public static PersistentThreadMessageObject ThreadMessage { get; } = new PersistentThreadMessageObject(ThreadMessageValue); + /// Determines if two values are the same. + public static bool operator ==(PersistentThreadMessageObject left, PersistentThreadMessageObject right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PersistentThreadMessageObject left, PersistentThreadMessageObject right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PersistentThreadMessageObject(string value) => new PersistentThreadMessageObject(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PersistentThreadMessageObject other && Equals(other); + /// + public bool Equals(PersistentThreadMessageObject other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepStreamEvent.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepStreamEvent.cs index 075c49cc616f..84fda207876d 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepStreamEvent.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/RunStepStreamEvent.cs @@ -22,22 +22,22 @@ public RunStepStreamEvent(string value) _value = value ?? throw new ArgumentNullException(nameof(value)); } - private const string ThreadRunStepCreatedValue = "thread.run.step.created"; - private const string ThreadRunStepInProgressValue = "thread.run.step.in_progress"; - private const string ThreadRunStepDeltaValue = "thread.run.step.delta"; - private const string ThreadRunStepCompletedValue = "thread.run.step.completed"; + private const string CreatedValue = "thread.run.step.created"; + private const string InProgressValue = "thread.run.step.in_progress"; + private const string DeltaValue = "thread.run.step.delta"; + private const string CompletedValue = "thread.run.step.completed"; private const string ThreadRunStepFailedValue = "thread.run.step.failed"; private const string ThreadRunStepCancelledValue = "thread.run.step.cancelled"; private const string ThreadRunStepExpiredValue = "thread.run.step.expired"; /// Event sent when a new thread run step is created. The data of this event is of type RunStep. - public static RunStepStreamEvent ThreadRunStepCreated { get; } = new RunStepStreamEvent(ThreadRunStepCreatedValue); + public static RunStepStreamEvent Created { get; } = new RunStepStreamEvent(CreatedValue); /// Event sent when a run step moves to `in_progress` status. The data of this event is of type RunStep. - public static RunStepStreamEvent ThreadRunStepInProgress { get; } = new RunStepStreamEvent(ThreadRunStepInProgressValue); + public static RunStepStreamEvent InProgress { get; } = new RunStepStreamEvent(InProgressValue); /// Event sent when a run step is being streamed. The data of this event is of type RunStepDeltaChunk. - public static RunStepStreamEvent ThreadRunStepDelta { get; } = new RunStepStreamEvent(ThreadRunStepDeltaValue); + public static RunStepStreamEvent Delta { get; } = new RunStepStreamEvent(DeltaValue); /// Event sent when a run step is completed. The data of this event is of type RunStep. - public static RunStepStreamEvent ThreadRunStepCompleted { get; } = new RunStepStreamEvent(ThreadRunStepCompletedValue); + public static RunStepStreamEvent Completed { get; } = new RunStepStreamEvent(CompletedValue); /// Event sent when a run step fails. The data of this event is of type RunStep. public static RunStepStreamEvent ThreadRunStepFailed { get; } = new RunStepStreamEvent(ThreadRunStepFailedValue); /// Event sent when a run step is cancelled. The data of this event is of type RunStep. diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadMessageObject.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadMessageObject.cs deleted file mode 100644 index 4f90de5069d9..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadMessageObject.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Agents.Persistent -{ - /// The ThreadMessage_object. - internal readonly partial struct ThreadMessageObject : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ThreadMessageObject(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ThreadMessageValue = "thread.message"; - - /// thread.message. - public static ThreadMessageObject ThreadMessage { get; } = new ThreadMessageObject(ThreadMessageValue); - /// Determines if two values are the same. - public static bool operator ==(ThreadMessageObject left, ThreadMessageObject right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ThreadMessageObject left, ThreadMessageObject right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ThreadMessageObject(string value) => new ThreadMessageObject(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ThreadMessageObject other && Equals(other); - /// - public bool Equals(ThreadMessageObject other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadMessages.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadMessages.cs index cbce422ed6ac..9e2ef80a7334 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadMessages.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadMessages.cs @@ -71,7 +71,7 @@ internal ThreadMessages(ClientDiagnostics clientDiagnostics, HttpPipeline pipeli /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public virtual async Task> CreateMessageAsync(string threadId, MessageRole role, BinaryData content, IEnumerable attachments = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + public virtual async Task> CreateMessageAsync(string threadId, MessageRole role, BinaryData content, IEnumerable attachments = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); Argument.AssertNotNull(content, nameof(content)); @@ -79,7 +79,7 @@ public virtual async Task> CreateMessageAsync(string thr CreateMessageRequest createMessageRequest = new CreateMessageRequest(role, content, attachments?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), metadata ?? new ChangeTrackingDictionary(), null); RequestContext context = FromCancellationToken(cancellationToken); Response response = await CreateMessageAsync(threadId, createMessageRequest.ToRequestContent(), context).ConfigureAwait(false); - return Response.FromValue(ThreadMessage.FromResponse(response), response); + return Response.FromValue(PersistentThreadMessage.FromResponse(response), response); } /// Creates a new message on a specified thread. @@ -101,7 +101,7 @@ public virtual async Task> CreateMessageAsync(string thr /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public virtual Response CreateMessage(string threadId, MessageRole role, BinaryData content, IEnumerable attachments = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + public virtual Response CreateMessage(string threadId, MessageRole role, BinaryData content, IEnumerable attachments = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); Argument.AssertNotNull(content, nameof(content)); @@ -109,7 +109,7 @@ public virtual Response CreateMessage(string threadId, MessageRol CreateMessageRequest createMessageRequest = new CreateMessageRequest(role, content, attachments?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), metadata ?? new ChangeTrackingDictionary(), null); RequestContext context = FromCancellationToken(cancellationToken); Response response = CreateMessage(threadId, createMessageRequest.ToRequestContent(), context); - return Response.FromValue(ThreadMessage.FromResponse(response), response); + return Response.FromValue(PersistentThreadMessage.FromResponse(response), response); } /// @@ -200,14 +200,14 @@ public virtual Response CreateMessage(string threadId, RequestContent content, R /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. - public virtual async Task> GetMessageAsync(string threadId, string messageId, CancellationToken cancellationToken = default) + public virtual async Task> GetMessageAsync(string threadId, string messageId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); Argument.AssertNotNullOrEmpty(messageId, nameof(messageId)); RequestContext context = FromCancellationToken(cancellationToken); Response response = await GetMessageAsync(threadId, messageId, context).ConfigureAwait(false); - return Response.FromValue(ThreadMessage.FromResponse(response), response); + return Response.FromValue(PersistentThreadMessage.FromResponse(response), response); } /// Retrieves an existing message. @@ -216,14 +216,14 @@ public virtual async Task> GetMessageAsync(string thread /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. - public virtual Response GetMessage(string threadId, string messageId, CancellationToken cancellationToken = default) + public virtual Response GetMessage(string threadId, string messageId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); Argument.AssertNotNullOrEmpty(messageId, nameof(messageId)); RequestContext context = FromCancellationToken(cancellationToken); Response response = GetMessage(threadId, messageId, context); - return Response.FromValue(ThreadMessage.FromResponse(response), response); + return Response.FromValue(PersistentThreadMessage.FromResponse(response), response); } /// @@ -315,7 +315,7 @@ public virtual Response GetMessage(string threadId, string messageId, RequestCon /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. - public virtual async Task> UpdateMessageAsync(string threadId, string messageId, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + public virtual async Task> UpdateMessageAsync(string threadId, string messageId, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); Argument.AssertNotNullOrEmpty(messageId, nameof(messageId)); @@ -323,7 +323,7 @@ public virtual async Task> UpdateMessageAsync(string thr UpdateMessageRequest updateMessageRequest = new UpdateMessageRequest(metadata ?? new ChangeTrackingDictionary(), null); RequestContext context = FromCancellationToken(cancellationToken); Response response = await UpdateMessageAsync(threadId, messageId, updateMessageRequest.ToRequestContent(), context).ConfigureAwait(false); - return Response.FromValue(ThreadMessage.FromResponse(response), response); + return Response.FromValue(PersistentThreadMessage.FromResponse(response), response); } /// Modifies an existing message on an existing thread. @@ -333,7 +333,7 @@ public virtual async Task> UpdateMessageAsync(string thr /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. - public virtual Response UpdateMessage(string threadId, string messageId, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + public virtual Response UpdateMessage(string threadId, string messageId, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); Argument.AssertNotNullOrEmpty(messageId, nameof(messageId)); @@ -341,7 +341,7 @@ public virtual Response UpdateMessage(string threadId, string mes UpdateMessageRequest updateMessageRequest = new UpdateMessageRequest(metadata ?? new ChangeTrackingDictionary(), null); RequestContext context = FromCancellationToken(cancellationToken); Response response = UpdateMessage(threadId, messageId, updateMessageRequest.ToRequestContent(), context); - return Response.FromValue(ThreadMessage.FromResponse(response), response); + return Response.FromValue(PersistentThreadMessage.FromResponse(response), response); } /// 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 90e5b8f0279c..c4a4245b9c3a 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 @@ -312,7 +312,7 @@ internal static ThreadRun DeserializeThreadRun(JsonElement element, ModelReaderW float? topP = default; int? maxPromptTokens = default; int? maxCompletionTokens = default; - TruncationObject truncationStrategy = default; + Truncation truncationStrategy = default; BinaryData toolChoice = default; BinaryData responseFormat = default; IReadOnlyDictionary metadata = default; @@ -484,7 +484,7 @@ internal static ThreadRun DeserializeThreadRun(JsonElement element, ModelReaderW truncationStrategy = null; continue; } - truncationStrategy = TruncationObject.DeserializeTruncationObject(property.Value, options); + truncationStrategy = Truncation.DeserializeTruncation(property.Value, options); continue; } if (property.NameEquals("tool_choice"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 42695031c0da..f82dda33493b 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadRun.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadRun.cs @@ -75,7 +75,7 @@ public partial class 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. /// Determines if tools can be executed in parallel within the run. /// , , , , or is null. - internal ThreadRun(string id, string threadId, string assistantId, RunStatus status, RunError lastError, string model, string instructions, IEnumerable tools, DateTimeOffset createdAt, DateTimeOffset? expiresAt, DateTimeOffset? startedAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, IncompleteRunDetails incompleteDetails, RunCompletionUsage usage, int? maxPromptTokens, int? maxCompletionTokens, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, bool parallelToolCalls) + internal ThreadRun(string id, string threadId, string assistantId, RunStatus status, RunError lastError, string model, string instructions, IEnumerable tools, DateTimeOffset createdAt, DateTimeOffset? expiresAt, DateTimeOffset? startedAt, DateTimeOffset? completedAt, DateTimeOffset? cancelledAt, DateTimeOffset? failedAt, IncompleteRunDetails incompleteDetails, RunCompletionUsage usage, int? maxPromptTokens, int? maxCompletionTokens, Truncation truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, bool parallelToolCalls) { Argument.AssertNotNull(id, nameof(id)); Argument.AssertNotNull(threadId, nameof(threadId)); @@ -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, TruncationObject 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, UpdateToolResourcesOptions toolResources, bool parallelToolCalls, IDictionary serializedAdditionalRawData) { Id = id; Object = @object; @@ -237,7 +237,7 @@ internal ThreadRun() /// The maximum number of completion tokens specified to have been used over the course of the run. public int? MaxCompletionTokens { get; } /// The strategy to use for dropping messages as the context windows moves forward. - public TruncationObject TruncationStrategy { get; } + public Truncation TruncationStrategy { get; } /// /// Controls whether or not and which tool is called by the model. /// diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadRuns.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadRuns.cs index 6a6a28253110..73e1a965b95e 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadRuns.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/ThreadRuns.cs @@ -101,7 +101,7 @@ internal ThreadRuns(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public virtual async Task> CreateRunAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, IEnumerable include = null, CancellationToken cancellationToken = default) + public virtual async Task> CreateRunAsync(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = 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, IEnumerable include = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); Argument.AssertNotNull(assistantId, nameof(assistantId)); @@ -178,7 +178,7 @@ public virtual async Task> CreateRunAsync(string threadId, s /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public virtual Response CreateRun(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = null, bool? stream = null, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, bool? parallelToolCalls = null, IReadOnlyDictionary metadata = null, IEnumerable include = null, CancellationToken cancellationToken = default) + public virtual Response CreateRun(string threadId, string assistantId, string overrideModelName = null, string overrideInstructions = null, string additionalInstructions = null, IEnumerable additionalMessages = null, IEnumerable overrideTools = 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, IEnumerable include = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); Argument.AssertNotNull(assistantId, nameof(assistantId)); @@ -216,7 +216,7 @@ public virtual Response CreateRun(string threadId, string assistantId /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -262,7 +262,7 @@ public virtual async Task CreateRunAsync(string threadId, RequestConte /// /// /// - /// 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/TruncationObject.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/Truncation.Serialization.cs similarity index 73% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/TruncationObject.Serialization.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/Truncation.Serialization.cs index 54c30c09d7bf..7489242e3944 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/TruncationObject.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/Truncation.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Agents.Persistent { - public partial class TruncationObject : IUtf8JsonSerializable, IJsonModel + public partial class Truncation : 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, ModelReaderWriter /// 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(TruncationObject)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(Truncation)} does not support writing '{format}' format."); } writer.WritePropertyName("type"u8); @@ -65,19 +65,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - TruncationObject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + Truncation 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(TruncationObject)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(Truncation)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeTruncationObject(document.RootElement, options); + return DeserializeTruncation(document.RootElement, options); } - internal static TruncationObject DeserializeTruncationObject(JsonElement element, ModelReaderWriterOptions options = null) + internal static Truncation DeserializeTruncation(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -112,46 +112,46 @@ internal static TruncationObject DeserializeTruncationObject(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new TruncationObject(type, lastMessages, serializedAdditionalRawData); + return new Truncation(type, lastMessages, 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(TruncationObject)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(Truncation)} does not support writing '{options.Format}' format."); } } - TruncationObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + Truncation 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 DeserializeTruncationObject(document.RootElement, options); + return DeserializeTruncation(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(TruncationObject)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(Truncation)} 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 TruncationObject FromResponse(Response response) + internal static Truncation FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeTruncationObject(document.RootElement); + return DeserializeTruncation(document.RootElement); } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/TruncationObject.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/Truncation.cs similarity index 91% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/TruncationObject.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/Truncation.cs index 651754d64319..7a81277dc33e 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/TruncationObject.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/Truncation.cs @@ -14,7 +14,7 @@ namespace Azure.AI.Agents.Persistent /// Controls for how a thread will be truncated prior to the run. Use this to control the initial /// context window of the run. /// - public partial class TruncationObject + public partial class Truncation { /// /// Keeps track of any properties unknown to the library. @@ -48,18 +48,18 @@ public partial class TruncationObject /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will /// be truncated to the `lastMessages` count most recent messages in the thread. When set to `auto`, messages in the middle of the thread /// will be dropped to fit the context length of the model, `max_prompt_tokens`. /// - public TruncationObject(TruncationStrategy type) + public Truncation(TruncationStrategy type) { Type = type; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will /// be truncated to the `lastMessages` count most recent messages in the thread. When set to `auto`, messages in the middle of the thread @@ -67,15 +67,15 @@ public TruncationObject(TruncationStrategy type) /// /// The number of most recent messages from the thread when constructing the context for the run. /// Keeps track of any properties unknown to the library. - internal TruncationObject(TruncationStrategy type, int? lastMessages, IDictionary serializedAdditionalRawData) + internal Truncation(TruncationStrategy type, int? lastMessages, IDictionary serializedAdditionalRawData) { Type = type; LastMessages = lastMessages; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal TruncationObject() + /// Initializes a new instance of for deserialization. + internal Truncation() { } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UnknownVectorStoreChunkingStrategyRequest.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UnknownVectorStoreChunkingStrategy.Serialization.cs similarity index 63% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UnknownVectorStoreChunkingStrategyRequest.Serialization.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UnknownVectorStoreChunkingStrategy.Serialization.cs index 2b802ffe214f..9440a71d7e44 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UnknownVectorStoreChunkingStrategyRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UnknownVectorStoreChunkingStrategy.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Agents.Persistent { - internal partial class UnknownVectorStoreChunkingStrategyRequest : IUtf8JsonSerializable, IJsonModel + internal partial class UnknownVectorStoreChunkingStrategy : 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,28 +28,28 @@ void IJsonModel.Write(Utf8JsonWriter 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(VectorStoreChunkingStrategyRequest)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(VectorStoreChunkingStrategy)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); } - VectorStoreChunkingStrategyRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + VectorStoreChunkingStrategy 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(VectorStoreChunkingStrategyRequest)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(VectorStoreChunkingStrategy)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeVectorStoreChunkingStrategyRequest(document.RootElement, options); + return DeserializeVectorStoreChunkingStrategy(document.RootElement, options); } - internal static UnknownVectorStoreChunkingStrategyRequest DeserializeUnknownVectorStoreChunkingStrategyRequest(JsonElement element, ModelReaderWriterOptions options = null) + internal static UnknownVectorStoreChunkingStrategy DeserializeUnknownVectorStoreChunkingStrategy(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -73,53 +73,53 @@ internal static UnknownVectorStoreChunkingStrategyRequest DeserializeUnknownVect } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownVectorStoreChunkingStrategyRequest(type, serializedAdditionalRawData); + return new UnknownVectorStoreChunkingStrategy(type, 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(VectorStoreChunkingStrategyRequest)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(VectorStoreChunkingStrategy)} does not support writing '{options.Format}' format."); } } - VectorStoreChunkingStrategyRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + VectorStoreChunkingStrategy 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 DeserializeVectorStoreChunkingStrategyRequest(document.RootElement, options); + return DeserializeVectorStoreChunkingStrategy(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(VectorStoreChunkingStrategyRequest)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(VectorStoreChunkingStrategy)} 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 new UnknownVectorStoreChunkingStrategyRequest FromResponse(Response response) + internal static new UnknownVectorStoreChunkingStrategy FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeUnknownVectorStoreChunkingStrategyRequest(document.RootElement); + return DeserializeUnknownVectorStoreChunkingStrategy(document.RootElement); } /// Convert into a . internal override RequestContent ToRequestContent() { var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); return content; } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UnknownVectorStoreChunkingStrategyRequest.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UnknownVectorStoreChunkingStrategy.cs similarity index 55% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UnknownVectorStoreChunkingStrategyRequest.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UnknownVectorStoreChunkingStrategy.cs index 162a057d3f4a..be6f5ebecd6a 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UnknownVectorStoreChunkingStrategyRequest.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/UnknownVectorStoreChunkingStrategy.cs @@ -10,18 +10,18 @@ namespace Azure.AI.Agents.Persistent { - /// Unknown version of VectorStoreChunkingStrategyRequest. - internal partial class UnknownVectorStoreChunkingStrategyRequest : VectorStoreChunkingStrategyRequest + /// Unknown version of VectorStoreChunkingStrategy. + internal partial class UnknownVectorStoreChunkingStrategy : VectorStoreChunkingStrategy { - /// Initializes a new instance of . + /// Initializes a new instance of . /// The object type. /// Keeps track of any properties unknown to the library. - internal UnknownVectorStoreChunkingStrategyRequest(VectorStoreChunkingStrategyRequestType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + internal UnknownVectorStoreChunkingStrategy(VectorStoreChunkingStrategyRequestType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) { } - /// Initializes a new instance of for deserialization. - internal UnknownVectorStoreChunkingStrategyRequest() + /// Initializes a new instance of for deserialization. + internal UnknownVectorStoreChunkingStrategy() { } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreAutoChunkingStrategyRequest.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreAutoChunkingStrategy.Serialization.cs similarity index 64% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreAutoChunkingStrategyRequest.Serialization.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreAutoChunkingStrategy.Serialization.cs index b3c3b38b532a..6928387962c5 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreAutoChunkingStrategyRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreAutoChunkingStrategy.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.AI.Agents.Persistent { - public partial class VectorStoreAutoChunkingStrategyRequest : IUtf8JsonSerializable, IJsonModel + public partial class VectorStoreAutoChunkingStrategy : 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,28 +28,28 @@ void IJsonModel.Write(Utf8JsonWriter wri /// 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(VectorStoreAutoChunkingStrategyRequest)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(VectorStoreAutoChunkingStrategy)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); } - VectorStoreAutoChunkingStrategyRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + VectorStoreAutoChunkingStrategy 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(VectorStoreAutoChunkingStrategyRequest)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(VectorStoreAutoChunkingStrategy)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeVectorStoreAutoChunkingStrategyRequest(document.RootElement, options); + return DeserializeVectorStoreAutoChunkingStrategy(document.RootElement, options); } - internal static VectorStoreAutoChunkingStrategyRequest DeserializeVectorStoreAutoChunkingStrategyRequest(JsonElement element, ModelReaderWriterOptions options = null) + internal static VectorStoreAutoChunkingStrategy DeserializeVectorStoreAutoChunkingStrategy(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -73,46 +73,46 @@ internal static VectorStoreAutoChunkingStrategyRequest DeserializeVectorStoreAut } } serializedAdditionalRawData = rawDataDictionary; - return new VectorStoreAutoChunkingStrategyRequest(type, serializedAdditionalRawData); + return new VectorStoreAutoChunkingStrategy(type, 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(VectorStoreAutoChunkingStrategyRequest)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(VectorStoreAutoChunkingStrategy)} does not support writing '{options.Format}' format."); } } - VectorStoreAutoChunkingStrategyRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + VectorStoreAutoChunkingStrategy 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 DeserializeVectorStoreAutoChunkingStrategyRequest(document.RootElement, options); + return DeserializeVectorStoreAutoChunkingStrategy(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(VectorStoreAutoChunkingStrategyRequest)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(VectorStoreAutoChunkingStrategy)} 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 new VectorStoreAutoChunkingStrategyRequest FromResponse(Response response) + internal static new VectorStoreAutoChunkingStrategy FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeVectorStoreAutoChunkingStrategyRequest(document.RootElement); + return DeserializeVectorStoreAutoChunkingStrategy(document.RootElement); } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreAutoChunkingStrategyRequest.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreAutoChunkingStrategy.cs similarity index 62% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreAutoChunkingStrategyRequest.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreAutoChunkingStrategy.cs index e56519868347..30b7671a3e76 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreAutoChunkingStrategyRequest.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreAutoChunkingStrategy.cs @@ -11,18 +11,18 @@ namespace Azure.AI.Agents.Persistent { /// The default strategy. This strategy currently uses a max_chunk_size_tokens of 800 and chunk_overlap_tokens of 400. - public partial class VectorStoreAutoChunkingStrategyRequest : VectorStoreChunkingStrategyRequest + public partial class VectorStoreAutoChunkingStrategy : VectorStoreChunkingStrategy { - /// Initializes a new instance of . - public VectorStoreAutoChunkingStrategyRequest() + /// Initializes a new instance of . + public VectorStoreAutoChunkingStrategy() { Type = VectorStoreChunkingStrategyRequestType.Auto; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The object type. /// Keeps track of any properties unknown to the library. - internal VectorStoreAutoChunkingStrategyRequest(VectorStoreChunkingStrategyRequestType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + internal VectorStoreAutoChunkingStrategy(VectorStoreChunkingStrategyRequestType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) { } } diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreChunkingStrategyRequest.Serialization.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreChunkingStrategy.Serialization.cs similarity index 64% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreChunkingStrategyRequest.Serialization.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreChunkingStrategy.Serialization.cs index 9b15178e7016..9d22c7fde3e3 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreChunkingStrategyRequest.Serialization.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreChunkingStrategy.Serialization.cs @@ -12,12 +12,12 @@ namespace Azure.AI.Agents.Persistent { - [PersistableModelProxy(typeof(UnknownVectorStoreChunkingStrategyRequest))] - public partial class VectorStoreChunkingStrategyRequest : IUtf8JsonSerializable, IJsonModel + [PersistableModelProxy(typeof(UnknownVectorStoreChunkingStrategy))] + public partial class VectorStoreChunkingStrategy : 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, /// 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(VectorStoreChunkingStrategyRequest)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(VectorStoreChunkingStrategy)} does not support writing '{format}' format."); } writer.WritePropertyName("type"u8); @@ -53,19 +53,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - VectorStoreChunkingStrategyRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + VectorStoreChunkingStrategy 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(VectorStoreChunkingStrategyRequest)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(VectorStoreChunkingStrategy)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeVectorStoreChunkingStrategyRequest(document.RootElement, options); + return DeserializeVectorStoreChunkingStrategy(document.RootElement, options); } - internal static VectorStoreChunkingStrategyRequest DeserializeVectorStoreChunkingStrategyRequest(JsonElement element, ModelReaderWriterOptions options = null) + internal static VectorStoreChunkingStrategy DeserializeVectorStoreChunkingStrategy(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -77,50 +77,50 @@ internal static VectorStoreChunkingStrategyRequest DeserializeVectorStoreChunkin { switch (discriminator.GetString()) { - case "auto": return VectorStoreAutoChunkingStrategyRequest.DeserializeVectorStoreAutoChunkingStrategyRequest(element, options); + case "auto": return VectorStoreAutoChunkingStrategy.DeserializeVectorStoreAutoChunkingStrategy(element, options); case "static": return VectorStoreStaticChunkingStrategyRequest.DeserializeVectorStoreStaticChunkingStrategyRequest(element, options); } } - return UnknownVectorStoreChunkingStrategyRequest.DeserializeUnknownVectorStoreChunkingStrategyRequest(element, options); + return UnknownVectorStoreChunkingStrategy.DeserializeUnknownVectorStoreChunkingStrategy(element, options); } - 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(VectorStoreChunkingStrategyRequest)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(VectorStoreChunkingStrategy)} does not support writing '{options.Format}' format."); } } - VectorStoreChunkingStrategyRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + VectorStoreChunkingStrategy 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 DeserializeVectorStoreChunkingStrategyRequest(document.RootElement, options); + return DeserializeVectorStoreChunkingStrategy(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(VectorStoreChunkingStrategyRequest)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(VectorStoreChunkingStrategy)} 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 VectorStoreChunkingStrategyRequest FromResponse(Response response) + internal static VectorStoreChunkingStrategy FromResponse(Response response) { using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeVectorStoreChunkingStrategyRequest(document.RootElement); + return DeserializeVectorStoreChunkingStrategy(document.RootElement); } /// Convert into a . diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreChunkingStrategyRequest.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreChunkingStrategy.cs similarity index 76% rename from sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreChunkingStrategyRequest.cs rename to sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreChunkingStrategy.cs index 9cf6167d4534..7ca0c584ca1c 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreChunkingStrategyRequest.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreChunkingStrategy.cs @@ -12,10 +12,10 @@ namespace Azure.AI.Agents.Persistent { /// /// An abstract representation of a vector store chunking strategy configuration. - /// 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 . + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . /// - public abstract partial class VectorStoreChunkingStrategyRequest + public abstract partial class VectorStoreChunkingStrategy { /// /// Keeps track of any properties unknown to the library. @@ -49,15 +49,15 @@ public abstract partial class VectorStoreChunkingStrategyRequest /// private protected IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - protected VectorStoreChunkingStrategyRequest() + /// Initializes a new instance of . + protected VectorStoreChunkingStrategy() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The object type. /// Keeps track of any properties unknown to the library. - internal VectorStoreChunkingStrategyRequest(VectorStoreChunkingStrategyRequestType type, IDictionary serializedAdditionalRawData) + internal VectorStoreChunkingStrategy(VectorStoreChunkingStrategyRequestType type, IDictionary serializedAdditionalRawData) { Type = type; _serializedAdditionalRawData = serializedAdditionalRawData; diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreDeletionStatusObject.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreDeletionStatusObject.cs deleted file mode 100644 index 3728d051a734..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreDeletionStatusObject.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Agents.Persistent -{ - /// The VectorStoreDeletionStatus_object. - public readonly partial struct VectorStoreDeletionStatusObject : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public VectorStoreDeletionStatusObject(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string VectorStoreDeletedValue = "vector_store.deleted"; - - /// vector_store.deleted. - public static VectorStoreDeletionStatusObject VectorStoreDeleted { get; } = new VectorStoreDeletionStatusObject(VectorStoreDeletedValue); - /// Determines if two values are the same. - public static bool operator ==(VectorStoreDeletionStatusObject left, VectorStoreDeletionStatusObject right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(VectorStoreDeletionStatusObject left, VectorStoreDeletionStatusObject right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator VectorStoreDeletionStatusObject(string value) => new VectorStoreDeletionStatusObject(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is VectorStoreDeletionStatusObject other && Equals(other); - /// - public bool Equals(VectorStoreDeletionStatusObject other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreFileBatches.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreFileBatches.cs index 21ec7ed3b522..0f5fac22d94d 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreFileBatches.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreFileBatches.cs @@ -63,7 +63,7 @@ internal VectorStoreFileBatches(ClientDiagnostics clientDiagnostics, HttpPipelin /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public virtual async Task> CreateVectorStoreFileBatchAsync(string vectorStoreId, IEnumerable fileIds = null, IEnumerable dataSources = null, VectorStoreChunkingStrategyRequest chunkingStrategy = null, CancellationToken cancellationToken = default) + public virtual async Task> CreateVectorStoreFileBatchAsync(string vectorStoreId, IEnumerable fileIds = null, IEnumerable dataSources = null, VectorStoreChunkingStrategy chunkingStrategy = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); @@ -81,7 +81,7 @@ public virtual async Task> CreateVectorStoreFileB /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public virtual Response CreateVectorStoreFileBatch(string vectorStoreId, IEnumerable fileIds = null, IEnumerable dataSources = null, VectorStoreChunkingStrategyRequest chunkingStrategy = null, CancellationToken cancellationToken = default) + public virtual Response CreateVectorStoreFileBatch(string vectorStoreId, IEnumerable fileIds = null, IEnumerable dataSources = null, VectorStoreChunkingStrategy chunkingStrategy = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); @@ -101,7 +101,7 @@ public virtual Response CreateVectorStoreFileBatch(string /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -142,7 +142,7 @@ public virtual async Task CreateVectorStoreFileBatchAsync(string vecto /// /// /// - /// 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/VectorStoreFileDeletionStatusObject.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreFileDeletionStatusObject.cs deleted file mode 100644 index 68251d57c507..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreFileDeletionStatusObject.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Agents.Persistent -{ - /// The VectorStoreFileDeletionStatus_object. - public readonly partial struct VectorStoreFileDeletionStatusObject : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public VectorStoreFileDeletionStatusObject(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string VectorStoreFileDeletedValue = "vector_store.file.deleted"; - - /// vector_store.file.deleted. - public static VectorStoreFileDeletionStatusObject VectorStoreFileDeleted { get; } = new VectorStoreFileDeletionStatusObject(VectorStoreFileDeletedValue); - /// Determines if two values are the same. - public static bool operator ==(VectorStoreFileDeletionStatusObject left, VectorStoreFileDeletionStatusObject right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(VectorStoreFileDeletionStatusObject left, VectorStoreFileDeletionStatusObject right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator VectorStoreFileDeletionStatusObject(string value) => new VectorStoreFileDeletionStatusObject(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is VectorStoreFileDeletionStatusObject other && Equals(other); - /// - public bool Equals(VectorStoreFileDeletionStatusObject other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreFiles.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreFiles.cs index 5c5d0f723a19..d67776d9ebf0 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreFiles.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreFiles.cs @@ -62,7 +62,7 @@ internal VectorStoreFiles(ClientDiagnostics clientDiagnostics, HttpPipeline pipe /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public virtual async Task> CreateVectorStoreFileAsync(string vectorStoreId, string fileId = null, VectorStoreDataSource dataSource = null, VectorStoreChunkingStrategyRequest chunkingStrategy = null, CancellationToken cancellationToken = default) + public virtual async Task> CreateVectorStoreFileAsync(string vectorStoreId, string fileId = null, VectorStoreDataSource dataSource = null, VectorStoreChunkingStrategy chunkingStrategy = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); @@ -80,7 +80,7 @@ public virtual async Task> CreateVectorStoreFileAsync( /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public virtual Response CreateVectorStoreFile(string vectorStoreId, string fileId = null, VectorStoreDataSource dataSource = null, VectorStoreChunkingStrategyRequest chunkingStrategy = null, CancellationToken cancellationToken = default) + public virtual Response CreateVectorStoreFile(string vectorStoreId, string fileId = null, VectorStoreDataSource dataSource = null, VectorStoreChunkingStrategy chunkingStrategy = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); @@ -100,7 +100,7 @@ public virtual Response CreateVectorStoreFile(string vectorStor /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -141,7 +141,7 @@ public virtual async Task CreateVectorStoreFileAsync(string vectorStor /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -292,14 +292,14 @@ public virtual Response GetVectorStoreFile(string vectorStoreId, string fileId, /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. - public virtual async Task> DeleteVectorStoreFileAsync(string vectorStoreId, string fileId, CancellationToken cancellationToken = default) + internal virtual async Task> InternalDeleteVectorStoreFileAsync(string vectorStoreId, string fileId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); Argument.AssertNotNullOrEmpty(fileId, nameof(fileId)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await DeleteVectorStoreFileAsync(vectorStoreId, fileId, context).ConfigureAwait(false); - return Response.FromValue(VectorStoreFileDeletionStatus.FromResponse(response), response); + Response response = await InternalDeleteVectorStoreFileAsync(vectorStoreId, fileId, context).ConfigureAwait(false); + return Response.FromValue(InternalVectorStoreFileDeletionStatus.FromResponse(response), response); } /// Deletes a vector store file. This removes the file‐to‐store link (does not delete the file itself). @@ -308,14 +308,14 @@ public virtual async Task> DeleteVectorS /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. - public virtual Response DeleteVectorStoreFile(string vectorStoreId, string fileId, CancellationToken cancellationToken = default) + internal virtual Response InternalDeleteVectorStoreFile(string vectorStoreId, string fileId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); Argument.AssertNotNullOrEmpty(fileId, nameof(fileId)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = DeleteVectorStoreFile(vectorStoreId, fileId, context); - return Response.FromValue(VectorStoreFileDeletionStatus.FromResponse(response), response); + Response response = InternalDeleteVectorStoreFile(vectorStoreId, fileId, context); + return Response.FromValue(InternalVectorStoreFileDeletionStatus.FromResponse(response), response); } /// @@ -328,7 +328,7 @@ public virtual Response DeleteVectorStoreFile(str /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -340,16 +340,16 @@ public virtual Response DeleteVectorStoreFile(str /// or is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - public virtual async Task DeleteVectorStoreFileAsync(string vectorStoreId, string fileId, RequestContext context) + internal virtual async Task InternalDeleteVectorStoreFileAsync(string vectorStoreId, string fileId, RequestContext context) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); Argument.AssertNotNullOrEmpty(fileId, nameof(fileId)); - using var scope = ClientDiagnostics.CreateScope("VectorStoreFiles.DeleteVectorStoreFile"); + using var scope = ClientDiagnostics.CreateScope("VectorStoreFiles.InternalDeleteVectorStoreFile"); scope.Start(); try { - using HttpMessage message = CreateDeleteVectorStoreFileRequest(vectorStoreId, fileId, context); + using HttpMessage message = CreateInternalDeleteVectorStoreFileRequest(vectorStoreId, fileId, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -369,7 +369,7 @@ public virtual async Task DeleteVectorStoreFileAsync(string vectorStor /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -381,16 +381,16 @@ public virtual async Task DeleteVectorStoreFileAsync(string vectorStor /// or is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - public virtual Response DeleteVectorStoreFile(string vectorStoreId, string fileId, RequestContext context) + internal virtual Response InternalDeleteVectorStoreFile(string vectorStoreId, string fileId, RequestContext context) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); Argument.AssertNotNullOrEmpty(fileId, nameof(fileId)); - using var scope = ClientDiagnostics.CreateScope("VectorStoreFiles.DeleteVectorStoreFile"); + using var scope = ClientDiagnostics.CreateScope("VectorStoreFiles.InternalDeleteVectorStoreFile"); scope.Start(); try { - using HttpMessage message = CreateDeleteVectorStoreFileRequest(vectorStoreId, fileId, context); + using HttpMessage message = CreateInternalDeleteVectorStoreFileRequest(vectorStoreId, fileId, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -471,7 +471,7 @@ internal HttpMessage CreateGetVectorStoreFileRequest(string vectorStoreId, strin return message; } - internal HttpMessage CreateDeleteVectorStoreFileRequest(string vectorStoreId, string fileId, RequestContext context) + internal HttpMessage CreateInternalDeleteVectorStoreFileRequest(string vectorStoreId, string fileId, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreObject.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreObject.cs deleted file mode 100644 index 90ad1cb720ee..000000000000 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreObject.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Agents.Persistent -{ - /// The VectorStore_object. - public readonly partial struct VectorStoreObject : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public VectorStoreObject(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string VectorStoreValue = "vector_store"; - - /// vector_store. - public static VectorStoreObject VectorStore { get; } = new VectorStoreObject(VectorStoreValue); - /// Determines if two values are the same. - public static bool operator ==(VectorStoreObject left, VectorStoreObject right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(VectorStoreObject left, VectorStoreObject right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator VectorStoreObject(string value) => new VectorStoreObject(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is VectorStoreObject other && Equals(other); - /// - public bool Equals(VectorStoreObject other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreStaticChunkingStrategyRequest.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreStaticChunkingStrategyRequest.cs index 2459bf162fe5..54841c9a668d 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreStaticChunkingStrategyRequest.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStoreStaticChunkingStrategyRequest.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Agents.Persistent { /// A statically configured chunking strategy. - public partial class VectorStoreStaticChunkingStrategyRequest : VectorStoreChunkingStrategyRequest + public partial class VectorStoreStaticChunkingStrategyRequest : VectorStoreChunkingStrategy { /// Initializes a new instance of . /// The options for the static chunking strategy. diff --git a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStores.cs b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStores.cs index b7fae16a5e87..46d62ede6ffd 100644 --- a/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStores.cs +++ b/sdk/ai/Azure.AI.Agents.Persistent/src/Generated/VectorStores.cs @@ -60,7 +60,7 @@ internal VectorStores(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline /// The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. Only applicable if file_ids is non-empty. /// 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. - public virtual async Task> CreateVectorStoreAsync(IEnumerable fileIds = null, string name = null, VectorStoreConfiguration storeConfiguration = null, VectorStoreExpirationPolicy expiresAfter = null, VectorStoreChunkingStrategyRequest chunkingStrategy = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + public virtual async Task> CreateVectorStoreAsync(IEnumerable fileIds = null, string name = null, VectorStoreConfiguration storeConfiguration = null, VectorStoreExpirationPolicy expiresAfter = null, VectorStoreChunkingStrategy chunkingStrategy = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { CreateVectorStoreRequest createVectorStoreRequest = new CreateVectorStoreRequest( fileIds?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), @@ -72,7 +72,7 @@ public virtual async Task> CreateVectorStoreAsync(IEnumera null); RequestContext context = FromCancellationToken(cancellationToken); Response response = await CreateVectorStoreAsync(createVectorStoreRequest.ToRequestContent(), context).ConfigureAwait(false); - return Response.FromValue(VectorStore.FromResponse(response), response); + return Response.FromValue(PersistentAgentsVectorStore.FromResponse(response), response); } /// Creates a vector store. @@ -83,7 +83,7 @@ public virtual async Task> CreateVectorStoreAsync(IEnumera /// The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. Only applicable if file_ids is non-empty. /// 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. - public virtual Response CreateVectorStore(IEnumerable fileIds = null, string name = null, VectorStoreConfiguration storeConfiguration = null, VectorStoreExpirationPolicy expiresAfter = null, VectorStoreChunkingStrategyRequest chunkingStrategy = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + public virtual Response CreateVectorStore(IEnumerable fileIds = null, string name = null, VectorStoreConfiguration storeConfiguration = null, VectorStoreExpirationPolicy expiresAfter = null, VectorStoreChunkingStrategy chunkingStrategy = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { CreateVectorStoreRequest createVectorStoreRequest = new CreateVectorStoreRequest( fileIds?.ToList() as IReadOnlyList ?? new ChangeTrackingList(), @@ -95,7 +95,7 @@ public virtual Response CreateVectorStore(IEnumerable fileI null); RequestContext context = FromCancellationToken(cancellationToken); Response response = CreateVectorStore(createVectorStoreRequest.ToRequestContent(), context); - return Response.FromValue(VectorStore.FromResponse(response), response); + return Response.FromValue(PersistentAgentsVectorStore.FromResponse(response), response); } /// @@ -108,7 +108,7 @@ public virtual Response CreateVectorStore(IEnumerable fileI /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -146,7 +146,7 @@ public virtual async Task CreateVectorStoreAsync(RequestContent conten /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -179,13 +179,13 @@ public virtual Response CreateVectorStore(RequestContent content, RequestContext /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public virtual async Task> GetVectorStoreAsync(string vectorStoreId, CancellationToken cancellationToken = default) + public virtual async Task> GetVectorStoreAsync(string vectorStoreId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); RequestContext context = FromCancellationToken(cancellationToken); Response response = await GetVectorStoreAsync(vectorStoreId, context).ConfigureAwait(false); - return Response.FromValue(VectorStore.FromResponse(response), response); + return Response.FromValue(PersistentAgentsVectorStore.FromResponse(response), response); } /// Returns the vector store object matching the specified ID. @@ -193,13 +193,13 @@ public virtual async Task> GetVectorStoreAsync(string vect /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public virtual Response GetVectorStore(string vectorStoreId, CancellationToken cancellationToken = default) + public virtual Response GetVectorStore(string vectorStoreId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); RequestContext context = FromCancellationToken(cancellationToken); Response response = GetVectorStore(vectorStoreId, context); - return Response.FromValue(VectorStore.FromResponse(response), response); + return Response.FromValue(PersistentAgentsVectorStore.FromResponse(response), response); } /// @@ -288,14 +288,14 @@ public virtual Response GetVectorStore(string vectorStoreId, RequestContext cont /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public virtual async Task> ModifyVectorStoreAsync(string vectorStoreId, string name = null, VectorStoreExpirationPolicy expiresAfter = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + public virtual async Task> ModifyVectorStoreAsync(string vectorStoreId, string name = null, VectorStoreExpirationPolicy expiresAfter = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); ModifyVectorStoreRequest modifyVectorStoreRequest = new ModifyVectorStoreRequest(name, expiresAfter, metadata ?? new ChangeTrackingDictionary(), null); RequestContext context = FromCancellationToken(cancellationToken); Response response = await ModifyVectorStoreAsync(vectorStoreId, modifyVectorStoreRequest.ToRequestContent(), context).ConfigureAwait(false); - return Response.FromValue(VectorStore.FromResponse(response), response); + return Response.FromValue(PersistentAgentsVectorStore.FromResponse(response), response); } /// Modifies an existing vector store. @@ -306,14 +306,14 @@ public virtual async Task> ModifyVectorStoreAsync(string v /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public virtual Response ModifyVectorStore(string vectorStoreId, string name = null, VectorStoreExpirationPolicy expiresAfter = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) + public virtual Response ModifyVectorStore(string vectorStoreId, string name = null, VectorStoreExpirationPolicy expiresAfter = null, IReadOnlyDictionary metadata = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); ModifyVectorStoreRequest modifyVectorStoreRequest = new ModifyVectorStoreRequest(name, expiresAfter, metadata ?? new ChangeTrackingDictionary(), null); RequestContext context = FromCancellationToken(cancellationToken); Response response = ModifyVectorStore(vectorStoreId, modifyVectorStoreRequest.ToRequestContent(), context); - return Response.FromValue(VectorStore.FromResponse(response), response); + return Response.FromValue(PersistentAgentsVectorStore.FromResponse(response), response); } /// @@ -403,13 +403,13 @@ public virtual Response ModifyVectorStore(string vectorStoreId, RequestContent c /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public virtual async Task> DeleteVectorStoreAsync(string vectorStoreId, CancellationToken cancellationToken = default) + internal virtual async Task> InternalDeleteVectorStoreAsync(string vectorStoreId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = await DeleteVectorStoreAsync(vectorStoreId, context).ConfigureAwait(false); - return Response.FromValue(VectorStoreDeletionStatus.FromResponse(response), response); + Response response = await InternalDeleteVectorStoreAsync(vectorStoreId, context).ConfigureAwait(false); + return Response.FromValue(InternalVectorStoreDeletionStatus.FromResponse(response), response); } /// Deletes the vector store object matching the specified ID. @@ -417,13 +417,13 @@ public virtual async Task> DeleteVectorStore /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public virtual Response DeleteVectorStore(string vectorStoreId, CancellationToken cancellationToken = default) + internal virtual Response InternalDeleteVectorStore(string vectorStoreId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); RequestContext context = FromCancellationToken(cancellationToken); - Response response = DeleteVectorStore(vectorStoreId, context); - return Response.FromValue(VectorStoreDeletionStatus.FromResponse(response), response); + Response response = InternalDeleteVectorStore(vectorStoreId, context); + return Response.FromValue(InternalVectorStoreDeletionStatus.FromResponse(response), response); } /// @@ -436,7 +436,7 @@ public virtual Response DeleteVectorStore(string vect /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -447,15 +447,15 @@ public virtual Response DeleteVectorStore(string vect /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - public virtual async Task DeleteVectorStoreAsync(string vectorStoreId, RequestContext context) + internal virtual async Task InternalDeleteVectorStoreAsync(string vectorStoreId, RequestContext context) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); - using var scope = ClientDiagnostics.CreateScope("VectorStores.DeleteVectorStore"); + using var scope = ClientDiagnostics.CreateScope("VectorStores.InternalDeleteVectorStore"); scope.Start(); try { - using HttpMessage message = CreateDeleteVectorStoreRequest(vectorStoreId, context); + using HttpMessage message = CreateInternalDeleteVectorStoreRequest(vectorStoreId, context); return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); } catch (Exception e) @@ -475,7 +475,7 @@ public virtual async Task DeleteVectorStoreAsync(string vectorStoreId, /// /// /// - /// Please try the simpler convenience overload with strongly typed models first. + /// Please try the simpler convenience overload with strongly typed models first. /// /// /// @@ -486,15 +486,15 @@ public virtual async Task DeleteVectorStoreAsync(string vectorStoreId, /// is an empty string, and was expected to be non-empty. /// Service returned a non-success status code. /// The response returned from the service. - public virtual Response DeleteVectorStore(string vectorStoreId, RequestContext context) + internal virtual Response InternalDeleteVectorStore(string vectorStoreId, RequestContext context) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); - using var scope = ClientDiagnostics.CreateScope("VectorStores.DeleteVectorStore"); + using var scope = ClientDiagnostics.CreateScope("VectorStores.InternalDeleteVectorStore"); scope.Start(); try { - using HttpMessage message = CreateDeleteVectorStoreRequest(vectorStoreId, context); + using HttpMessage message = CreateInternalDeleteVectorStoreRequest(vectorStoreId, context); return _pipeline.ProcessMessage(message, context); } catch (Exception e) @@ -582,7 +582,7 @@ internal HttpMessage CreateModifyVectorStoreRequest(string vectorStoreId, Reques return message; } - internal HttpMessage CreateDeleteVectorStoreRequest(string vectorStoreId, RequestContext context) + internal HttpMessage CreateInternalDeleteVectorStoreRequest(string vectorStoreId, RequestContext context) { var message = _pipeline.CreateMessage(context, ResponseClassifier200); var request = message.Request; diff --git a/sdk/ai/Azure.AI.Agents.Persistent/tsp-location.yaml b/sdk/ai/Azure.AI.Agents.Persistent/tsp-location.yaml index cf944b1f937d..3303ebcc2796 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: 2f0af7bbb6340f5b3f89ab423267de352b834f7b +commit: bb99e131bf41349b782e1eacfb2ad98f0a5208a0 repo: Azure/azure-rest-api-specs additionalDirectories: