From d529f94dfa5e57b37e394859b5edec7d0b1329e4 Mon Sep 17 00:00:00 2001 From: Marko Hietala Date: Tue, 26 Nov 2024 14:52:41 -0600 Subject: [PATCH 1/2] fix incomplete run details --- .../src/Custom/Agent/AIClientModelFactory.cs | 2 +- .../src/Generated/AIProjectsModelFactory.cs | 12 +- .../Azure.AI.Projects/src/Generated/Agent.cs | 6 +- .../src/Generated/AgentStreamEvent.cs | 3 + .../Generated/AgentsNamedToolChoiceType.cs | 4 +- .../Generated/CodeInterpreterToolResource.cs | 4 +- .../src/Generated/CreateAgentRequest.cs | 4 +- .../src/Generated/CreateRunRequest.cs | 4 +- .../Generated/CreateThreadAndRunRequest.cs | 4 +- .../FileSearchToolDefinitionDetails.cs | 4 +- .../src/Generated/FileSearchToolResource.cs | 12 +- .../src/Generated/IncompleteDetailsReason.cs | 51 +++++++ .../IncompleteRunDetails.Serialization.cs | 142 ++++++++++++++++++ .../src/Generated/IncompleteRunDetails.cs | 85 +++++++---- ...osoftFabricToolDefinition.Serialization.cs | 12 +- .../MicrosoftFabricToolDefinition.cs | 20 +-- .../src/Generated/RequiredToolCall.cs | 2 +- ...epMicrosoftFabricToolCall.Serialization.cs | 10 +- .../RunStepMicrosoftFabricToolCall.cs | 2 +- .../RunStepToolCall.Serialization.cs | 2 +- .../src/Generated/RunStepToolCall.cs | 2 +- .../src/Generated/RunStepToolCallDetails.cs | 6 +- .../src/Generated/RunStreamEvent.cs | 3 + .../src/Generated/ThreadRun.Serialization.cs | 6 +- .../src/Generated/ThreadRun.cs | 12 +- .../src/Generated/ToolConnectionList.cs | 2 +- .../Generated/ToolDefinition.Serialization.cs | 2 +- .../src/Generated/ToolDefinition.cs | 2 +- .../src/Generated/ToolResources.cs | 4 +- .../src/Generated/UpdateAgentRequest.cs | 4 +- .../VectorStoreDataSource.Serialization.cs | 4 +- ...rStoreDataSourceAssetType.Serialization.cs | 28 ---- .../VectorStoreDataSourceAssetType.cs | 43 +++++- .../src/Generated/VectorStoreFileError.cs | 2 +- sdk/ai/Azure.AI.Projects/tsp-location.yaml | 2 +- 35 files changed, 370 insertions(+), 137 deletions(-) create mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/IncompleteDetailsReason.cs create mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/IncompleteRunDetails.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSourceAssetType.Serialization.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AIClientModelFactory.cs b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AIClientModelFactory.cs index 73ae1c7696056..2a226baaaad29 100644 --- a/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AIClientModelFactory.cs +++ b/sdk/ai/Azure.AI.Projects/src/Custom/Agent/AIClientModelFactory.cs @@ -128,7 +128,7 @@ public static AgentThread AgentThread(string id = null, DateTimeOffset createdAt /// 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. /// A new instance for mocking. - public static ThreadRun ThreadRun(string id = null, string threadId = null, string agentId = null, RunStatus status = default, RequiredAction requiredAction = null, RunError lastError = null, string model = null, string instructions = null, IEnumerable tools = null, DateTimeOffset createdAt = default, DateTimeOffset? expiresAt = null, DateTimeOffset? startedAt = null, DateTimeOffset? completedAt = null, DateTimeOffset? cancelledAt = null, DateTimeOffset? failedAt = null, IncompleteRunDetails? incompleteDetails = null, RunCompletionUsage usage = default, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, UpdateToolResourcesOptions toolResources = null, bool? parallelToolCalls = null) + public static ThreadRun ThreadRun(string id = null, string threadId = null, string agentId = null, RunStatus status = default, RequiredAction requiredAction = null, RunError lastError = null, string model = null, string instructions = null, IEnumerable tools = null, DateTimeOffset createdAt = default, DateTimeOffset? expiresAt = null, DateTimeOffset? startedAt = null, DateTimeOffset? completedAt = null, DateTimeOffset? cancelledAt = null, DateTimeOffset? failedAt = null, IncompleteRunDetails incompleteDetails = default, RunCompletionUsage usage = default, float? temperature = null, float? topP = null, int? maxPromptTokens = null, int? maxCompletionTokens = null, TruncationObject truncationStrategy = null, BinaryData toolChoice = null, BinaryData responseFormat = null, IReadOnlyDictionary metadata = null, UpdateToolResourcesOptions toolResources = null, bool? parallelToolCalls = null) { tools ??= new List(); metadata ??= new Dictionary(); diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs index ca30fab8a0366..cbab281da95be 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs @@ -223,6 +223,14 @@ public static RunError RunError(string code = null, string message = null) return new RunError(code, message, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The reason why the run is incomplete. This indicates which specific token limit was reached during the run. + /// A new instance for mocking. + public static IncompleteRunDetails IncompleteRunDetails(IncompleteDetailsReason reason = default) + { + return new IncompleteRunDetails(reason, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Number of completion tokens used over the course of the run. /// Number of prompt tokens used over the course of the run. @@ -253,7 +261,7 @@ public static RunStepMessageCreationReference RunStepMessageCreationReference(st /// /// A list of tool call details for this run step. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// /// A new instance for mocking. public static RunStepToolCallDetails RunStepToolCallDetails(IEnumerable toolCalls = null) @@ -348,7 +356,7 @@ public static RunStepMicrosoftFabricToolCall RunStepMicrosoftFabricToolCall(stri { microsoftFabric ??= new Dictionary(); - return new RunStepMicrosoftFabricToolCall("microsoft_fabric", id, serializedAdditionalRawData: null, microsoftFabric); + return new RunStepMicrosoftFabricToolCall("fabric_aiskill", id, serializedAdditionalRawData: null, microsoftFabric); } /// Initializes a new instance of . diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs index 51f05f61a7b8c..394ba7cc4b5a8 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs @@ -56,7 +56,7 @@ public partial class Agent /// /// The collection of tools enabled for the agent. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// /// /// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter` @@ -104,7 +104,7 @@ internal Agent(string id, DateTimeOffset createdAt, string name, string descript /// /// The collection of tools enabled for the agent. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// /// /// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter` @@ -162,7 +162,7 @@ internal Agent() /// /// The collection of tools enabled for the agent. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// public IReadOnlyList Tools { get; } /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs index 467c36acfd8ba..0c2e715e09a92 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs @@ -45,6 +45,7 @@ public AgentStreamEvent(string value) private const string ThreadRunInProgressValue = "thread.run.in_progress"; private const string ThreadRunRequiresActionValue = "thread.run.requires_action"; private const string ThreadRunCompletedValue = "thread.run.completed"; + private const string ThreadRunIncompleteValue = "thread.run.incomplete"; private const string ThreadRunFailedValue = "thread.run.failed"; private const string ThreadRunCancellingValue = "thread.run.cancelling"; private const string ThreadRunCancelledValue = "thread.run.cancelled"; @@ -76,6 +77,8 @@ public AgentStreamEvent(string value) public static AgentStreamEvent ThreadRunRequiresAction { get; } = new AgentStreamEvent(ThreadRunRequiresActionValue); /// Event sent when a run is completed. The data of this event is of type ThreadRun. public static AgentStreamEvent ThreadRunCompleted { get; } = new AgentStreamEvent(ThreadRunCompletedValue); + /// Event sent when a run ends incompleted. The data of this event is of type ThreadRun. + public static AgentStreamEvent ThreadRunIncomplete { get; } = new AgentStreamEvent(ThreadRunIncompleteValue); /// Event sent when a run fails. The data of this event is of type ThreadRun. public static AgentStreamEvent ThreadRunFailed { get; } = new AgentStreamEvent(ThreadRunFailedValue); /// Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsNamedToolChoiceType.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsNamedToolChoiceType.cs index 1fce40ad472d6..e9371e9da0586 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsNamedToolChoiceType.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentsNamedToolChoiceType.cs @@ -26,7 +26,7 @@ public AgentsNamedToolChoiceType(string value) private const string CodeInterpreterValue = "code_interpreter"; private const string FileSearchValue = "file_search"; private const string BingGroundingValue = "bing_grounding"; - private const string MicrosoftFabricValue = "microsoft_fabric"; + private const string MicrosoftFabricValue = "fabric_aiskill"; private const string SharepointValue = "sharepoint_grounding"; private const string AzureAISearchValue = "azure_ai_search"; @@ -38,7 +38,7 @@ public AgentsNamedToolChoiceType(string value) public static AgentsNamedToolChoiceType FileSearch { get; } = new AgentsNamedToolChoiceType(FileSearchValue); /// Tool type `bing_grounding`. public static AgentsNamedToolChoiceType BingGrounding { get; } = new AgentsNamedToolChoiceType(BingGroundingValue); - /// Tool type `microsoft_fabric`. + /// Tool type `fabric_aiskill`. public static AgentsNamedToolChoiceType MicrosoftFabric { get; } = new AgentsNamedToolChoiceType(MicrosoftFabricValue); /// Tool type `sharepoint_grounding`. public static AgentsNamedToolChoiceType Sharepoint { get; } = new AgentsNamedToolChoiceType(SharepointValue); diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CodeInterpreterToolResource.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CodeInterpreterToolResource.cs index 1e49d70a3a98c..5eebfab8f0852 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CodeInterpreterToolResource.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CodeInterpreterToolResource.cs @@ -57,7 +57,7 @@ public CodeInterpreterToolResource() /// A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files /// associated with the tool. /// - /// The data sources to be used. This option is mutually exclusive with fileIds. + /// The data sources to be used. This option is mutually exclusive with the `fileIds` property. /// Keeps track of any properties unknown to the library. internal CodeInterpreterToolResource(IList fileIds, IList dataSources, IDictionary serializedAdditionalRawData) { @@ -71,7 +71,7 @@ internal CodeInterpreterToolResource(IList fileIds, IList public IList FileIds { get; } - /// The data sources to be used. This option is mutually exclusive with fileIds. + /// The data sources to be used. This option is mutually exclusive with the `fileIds` property. public IList DataSources { get; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateAgentRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateAgentRequest.cs index 606b205632601..591b09e307920 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateAgentRequest.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateAgentRequest.cs @@ -65,7 +65,7 @@ internal CreateAgentRequest(string model) /// /// The collection of tools to enable for the new agent. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// /// /// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter` @@ -115,7 +115,7 @@ internal CreateAgentRequest() /// /// The collection of tools to enable for the new agent. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// public IReadOnlyList Tools { get; } /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs index b47736e413ebf..f3f8b30781b34 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateRunRequest.cs @@ -70,7 +70,7 @@ internal CreateRunRequest(string assistantId) /// /// The overridden list of enabled tools that the agent should use to run the thread. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// /// /// If `true`, returns a stream of events that happen during the Run as server-sent events, @@ -143,7 +143,7 @@ internal CreateRunRequest() /// /// The overridden list of enabled tools that the agent should use to run the thread. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// public IReadOnlyList OverrideTools { get; } /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.cs index 1a002dd86bdd3..d234f56a46c83 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/CreateThreadAndRunRequest.cs @@ -65,7 +65,7 @@ internal CreateThreadAndRunRequest(string assistantId) /// /// The overridden list of enabled tools the agent should use to run the thread. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// /// Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis. /// @@ -134,7 +134,7 @@ internal CreateThreadAndRunRequest() /// /// The overridden list of enabled tools the agent should use to run the thread. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// public IReadOnlyList OverrideTools { get; } /// Override the tools the agent can use for this run. This is useful for modifying the behavior on a per-run basis. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolDefinitionDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolDefinitionDetails.cs index 27d2c74fd442f..a2445583f91cd 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolDefinitionDetails.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolDefinitionDetails.cs @@ -56,7 +56,7 @@ public FileSearchToolDefinitionDetails() /// /// Note that the file search tool may output fewer than `max_num_results` results. See the file search tool documentation for more information. /// - /// + /// Ranking options for file search. /// Keeps track of any properties unknown to the library. internal FileSearchToolDefinitionDetails(int? maxNumResults, FileSearchRankingOptions rankingOptions, IDictionary serializedAdditionalRawData) { @@ -71,7 +71,7 @@ internal FileSearchToolDefinitionDetails(int? maxNumResults, FileSearchRankingOp /// Note that the file search tool may output fewer than `max_num_results` results. See the file search tool documentation for more information. /// public int? MaxNumResults { get; set; } - /// Gets or sets the ranking options. + /// Ranking options for file search. public FileSearchRankingOptions RankingOptions { get; set; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolResource.cs b/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolResource.cs index da9f6a2ceb26e..9dc2301d67eaa 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolResource.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolResource.cs @@ -58,9 +58,9 @@ public FileSearchToolResource() /// store attached to the agent. /// /// - /// The list of vector store configuration objects from Azure. This list is limited to one - /// element. The only element of this list contains - /// the list of azure asset IDs used by the search tool. + /// The list of vector store configuration objects from Azure. + /// This list is limited to one element. + /// The only element of this list contains the list of azure asset IDs used by the search tool. /// /// Keeps track of any properties unknown to the library. internal FileSearchToolResource(IList vectorStoreIds, IList vectorStores, IDictionary serializedAdditionalRawData) @@ -76,9 +76,9 @@ internal FileSearchToolResource(IList vectorStoreIds, IList public IList VectorStoreIds { get; } /// - /// The list of vector store configuration objects from Azure. This list is limited to one - /// element. The only element of this list contains - /// the list of azure asset IDs used by the search tool. + /// The list of vector store configuration objects from Azure. + /// This list is limited to one element. + /// The only element of this list contains the list of azure asset IDs used by the search tool. /// public IList VectorStores { get; } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteDetailsReason.cs b/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteDetailsReason.cs new file mode 100644 index 0000000000000..517961f355be5 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteDetailsReason.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.Projects +{ + /// The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. + public readonly partial struct IncompleteDetailsReason : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IncompleteDetailsReason(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MaxCompletionTokensValue = "max_completion_tokens"; + private const string MaxPromptTokensValue = "max_prompt_tokens"; + + /// Maximum completion tokens exceeded. + public static IncompleteDetailsReason MaxCompletionTokens { get; } = new IncompleteDetailsReason(MaxCompletionTokensValue); + /// Maximum prompt tokens exceeded. + public static IncompleteDetailsReason MaxPromptTokens { get; } = new IncompleteDetailsReason(MaxPromptTokensValue); + /// Determines if two values are the same. + public static bool operator ==(IncompleteDetailsReason left, IncompleteDetailsReason right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IncompleteDetailsReason left, IncompleteDetailsReason right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IncompleteDetailsReason(string value) => new IncompleteDetailsReason(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IncompleteDetailsReason other && Equals(other); + /// + public bool Equals(IncompleteDetailsReason 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.Projects/src/Generated/IncompleteRunDetails.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteRunDetails.Serialization.cs new file mode 100644 index 0000000000000..6264642302cb1 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteRunDetails.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.AI.Projects +{ + public partial class IncompleteRunDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IncompleteRunDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("reason"u8); + writer.WriteStringValue(Reason.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IncompleteRunDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IncompleteRunDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIncompleteRunDetails(document.RootElement, options); + } + + internal static IncompleteRunDetails DeserializeIncompleteRunDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IncompleteDetailsReason reason = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("reason"u8)) + { + reason = new IncompleteDetailsReason(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IncompleteRunDetails(reason, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(IncompleteRunDetails)} does not support writing '{options.Format}' format."); + } + } + + IncompleteRunDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIncompleteRunDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IncompleteRunDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static IncompleteRunDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeIncompleteRunDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteRunDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteRunDetails.cs index 824797e5f7c67..786489fd33693 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteRunDetails.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/IncompleteRunDetails.cs @@ -6,46 +6,67 @@ #nullable disable using System; -using System.ComponentModel; +using System.Collections.Generic; namespace Azure.AI.Projects { - /// The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - public readonly partial struct IncompleteRunDetails : IEquatable + /// Details on why the run is incomplete. Will be `null` if the run is not incomplete. + public partial class IncompleteRunDetails { - private readonly string _value; + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// is null. - public IncompleteRunDetails(string value) + /// The reason why the run is incomplete. This indicates which specific token limit was reached during the run. + internal IncompleteRunDetails(IncompleteDetailsReason reason) { - _value = value ?? throw new ArgumentNullException(nameof(value)); + Reason = reason; } - private const string MaxCompletionTokensValue = "max_completion_tokens"; - private const string MaxPromptTokensValue = "max_prompt_tokens"; - - /// Maximum completion tokens exceeded. - public static IncompleteRunDetails MaxCompletionTokens { get; } = new IncompleteRunDetails(MaxCompletionTokensValue); - /// Maximum prompt tokens exceeded. - public static IncompleteRunDetails MaxPromptTokens { get; } = new IncompleteRunDetails(MaxPromptTokensValue); - /// Determines if two values are the same. - public static bool operator ==(IncompleteRunDetails left, IncompleteRunDetails right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IncompleteRunDetails left, IncompleteRunDetails right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator IncompleteRunDetails(string value) => new IncompleteRunDetails(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IncompleteRunDetails other && Equals(other); - /// - public bool Equals(IncompleteRunDetails 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; + /// Initializes a new instance of . + /// The reason why the run is incomplete. This indicates which specific token limit was reached during the run. + /// Keeps track of any properties unknown to the library. + internal IncompleteRunDetails(IncompleteDetailsReason reason, IDictionary serializedAdditionalRawData) + { + Reason = reason; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal IncompleteRunDetails() + { + } + + /// The reason why the run is incomplete. This indicates which specific token limit was reached during the run. + public IncompleteDetailsReason Reason { get; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MicrosoftFabricToolDefinition.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MicrosoftFabricToolDefinition.Serialization.cs index 74fb6c1c1968a..ad1aecac60134 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MicrosoftFabricToolDefinition.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MicrosoftFabricToolDefinition.Serialization.cs @@ -35,8 +35,8 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("microsoft_fabric"u8); - writer.WriteObjectValue(MicrosoftFabric, options); + writer.WritePropertyName("fabric_aiskill"u8); + writer.WriteObjectValue(FabricAiskill, options); } MicrosoftFabricToolDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -59,15 +59,15 @@ internal static MicrosoftFabricToolDefinition DeserializeMicrosoftFabricToolDefi { return null; } - ToolConnectionList microsoftFabric = default; + ToolConnectionList fabricAiskill = default; string type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("microsoft_fabric"u8)) + if (property.NameEquals("fabric_aiskill"u8)) { - microsoftFabric = ToolConnectionList.DeserializeToolConnectionList(property.Value, options); + fabricAiskill = ToolConnectionList.DeserializeToolConnectionList(property.Value, options); continue; } if (property.NameEquals("type"u8)) @@ -81,7 +81,7 @@ internal static MicrosoftFabricToolDefinition DeserializeMicrosoftFabricToolDefi } } serializedAdditionalRawData = rawDataDictionary; - return new MicrosoftFabricToolDefinition(type, serializedAdditionalRawData, microsoftFabric); + return new MicrosoftFabricToolDefinition(type, serializedAdditionalRawData, fabricAiskill); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MicrosoftFabricToolDefinition.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MicrosoftFabricToolDefinition.cs index fb886ddbd8693..f62e63d2f7f01 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MicrosoftFabricToolDefinition.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/MicrosoftFabricToolDefinition.cs @@ -14,23 +14,23 @@ namespace Azure.AI.Projects public partial class MicrosoftFabricToolDefinition : ToolDefinition { /// Initializes a new instance of . - /// The list of connections used by the Microsoft Fabric tool. - /// is null. - public MicrosoftFabricToolDefinition(ToolConnectionList microsoftFabric) + /// The list of connections used by the Microsoft Fabric tool. + /// is null. + public MicrosoftFabricToolDefinition(ToolConnectionList fabricAiskill) { - Argument.AssertNotNull(microsoftFabric, nameof(microsoftFabric)); + Argument.AssertNotNull(fabricAiskill, nameof(fabricAiskill)); - Type = "microsoft_fabric"; - MicrosoftFabric = microsoftFabric; + Type = "fabric_aiskill"; + FabricAiskill = fabricAiskill; } /// Initializes a new instance of . /// The object type. /// Keeps track of any properties unknown to the library. - /// The list of connections used by the Microsoft Fabric tool. - internal MicrosoftFabricToolDefinition(string type, IDictionary serializedAdditionalRawData, ToolConnectionList microsoftFabric) : base(type, serializedAdditionalRawData) + /// The list of connections used by the Microsoft Fabric tool. + internal MicrosoftFabricToolDefinition(string type, IDictionary serializedAdditionalRawData, ToolConnectionList fabricAiskill) : base(type, serializedAdditionalRawData) { - MicrosoftFabric = microsoftFabric; + FabricAiskill = fabricAiskill; } /// Initializes a new instance of for deserialization. @@ -39,6 +39,6 @@ internal MicrosoftFabricToolDefinition() } /// The list of connections used by the Microsoft Fabric tool. - public ToolConnectionList MicrosoftFabric { get; set; } + public ToolConnectionList FabricAiskill { get; set; } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RequiredToolCall.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RequiredToolCall.cs index f9e94be0b0fd9..abeb4d7c18ec5 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RequiredToolCall.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/RequiredToolCall.cs @@ -11,7 +11,7 @@ namespace Azure.AI.Projects { /// - /// An abstract representation a a tool invocation needed by the model to continue a run. + /// An abstract representation of a tool invocation needed by the model to continue a run. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepMicrosoftFabricToolCall.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepMicrosoftFabricToolCall.Serialization.cs index e4cbd4acd5903..1b3f42907d655 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepMicrosoftFabricToolCall.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepMicrosoftFabricToolCall.Serialization.cs @@ -35,7 +35,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("microsoft_fabric"u8); + writer.WritePropertyName("fabric_aiskill"u8); writer.WriteStartObject(); foreach (var item in MicrosoftFabric) { @@ -65,21 +65,21 @@ internal static RunStepMicrosoftFabricToolCall DeserializeRunStepMicrosoftFabric { return null; } - IReadOnlyDictionary microsoftFabric = default; + IReadOnlyDictionary fabricAiskill = default; string type = default; string id = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("microsoft_fabric"u8)) + if (property.NameEquals("fabric_aiskill"u8)) { Dictionary dictionary = new Dictionary(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } - microsoftFabric = dictionary; + fabricAiskill = dictionary; continue; } if (property.NameEquals("type"u8)) @@ -98,7 +98,7 @@ internal static RunStepMicrosoftFabricToolCall DeserializeRunStepMicrosoftFabric } } serializedAdditionalRawData = rawDataDictionary; - return new RunStepMicrosoftFabricToolCall(type, id, serializedAdditionalRawData, microsoftFabric); + return new RunStepMicrosoftFabricToolCall(type, id, serializedAdditionalRawData, fabricAiskill); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepMicrosoftFabricToolCall.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepMicrosoftFabricToolCall.cs index 15f664c26464a..b212127c06057 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepMicrosoftFabricToolCall.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepMicrosoftFabricToolCall.cs @@ -25,7 +25,7 @@ internal RunStepMicrosoftFabricToolCall(string id, IReadOnlyDictionary /// An abstract representation of a detailed tool call as recorded within a run step for an existing run. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// public abstract partial class RunStepToolCall { diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepToolCallDetails.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepToolCallDetails.cs index f5a2490363ac0..f734d2d76efe3 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepToolCallDetails.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepToolCallDetails.cs @@ -18,7 +18,7 @@ public partial class RunStepToolCallDetails : RunStepDetails /// /// A list of tool call details for this run step. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// /// is null. internal RunStepToolCallDetails(IEnumerable toolCalls) @@ -35,7 +35,7 @@ internal RunStepToolCallDetails(IEnumerable toolCalls) /// /// A list of tool call details for this run step. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// internal RunStepToolCallDetails(RunStepType type, IDictionary serializedAdditionalRawData, IReadOnlyList toolCalls) : base(type, serializedAdditionalRawData) { @@ -50,7 +50,7 @@ internal RunStepToolCallDetails() /// /// A list of tool call details for this run step. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// public IReadOnlyList ToolCalls { get; } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStreamEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStreamEvent.cs index f560f75366ce4..630d33f59e668 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStreamEvent.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/RunStreamEvent.cs @@ -27,6 +27,7 @@ public RunStreamEvent(string value) private const string ThreadRunInProgressValue = "thread.run.in_progress"; private const string ThreadRunRequiresActionValue = "thread.run.requires_action"; private const string ThreadRunCompletedValue = "thread.run.completed"; + private const string ThreadRunIncompleteValue = "thread.run.incomplete"; private const string ThreadRunFailedValue = "thread.run.failed"; private const string ThreadRunCancellingValue = "thread.run.cancelling"; private const string ThreadRunCancelledValue = "thread.run.cancelled"; @@ -42,6 +43,8 @@ public RunStreamEvent(string value) public static RunStreamEvent ThreadRunRequiresAction { get; } = new RunStreamEvent(ThreadRunRequiresActionValue); /// Event sent when a run is completed. The data of this event is of type ThreadRun. public static RunStreamEvent ThreadRunCompleted { get; } = new RunStreamEvent(ThreadRunCompletedValue); + /// Event sent when a run ends incompleted. The data of this event is of type ThreadRun. + public static RunStreamEvent ThreadRunIncomplete { get; } = new RunStreamEvent(ThreadRunIncompleteValue); /// Event sent when a run fails. The data of this event is of type ThreadRun. public static RunStreamEvent ThreadRunFailed { get; } = new RunStreamEvent(ThreadRunFailedValue); /// Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.Serialization.cs index 310ef48146c4d..3319be0f6b356 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.Serialization.cs @@ -126,7 +126,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (IncompleteDetails != null) { writer.WritePropertyName("incomplete_details"u8); - writer.WriteStringValue(IncompleteDetails.Value.ToString()); + writer.WriteObjectValue(IncompleteDetails, options); } else { @@ -309,7 +309,7 @@ internal static ThreadRun DeserializeThreadRun(JsonElement element, ModelReaderW DateTimeOffset? completedAt = default; DateTimeOffset? cancelledAt = default; DateTimeOffset? failedAt = default; - IncompleteRunDetails? incompleteDetails = default; + IncompleteRunDetails incompleteDetails = default; RunCompletionUsage usage = default; float? temperature = default; float? topP = default; @@ -427,7 +427,7 @@ internal static ThreadRun DeserializeThreadRun(JsonElement element, ModelReaderW incompleteDetails = null; continue; } - incompleteDetails = new IncompleteRunDetails(property.Value.GetString()); + incompleteDetails = IncompleteRunDetails.DeserializeIncompleteRunDetails(property.Value, options); continue; } if (property.NameEquals("usage"u8)) diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.cs index e3aa03d008e09..f60b310b3bcbe 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadRun.cs @@ -57,7 +57,7 @@ public partial class ThreadRun /// /// The overridden enabled tools used for this agent thread run. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// /// The Unix timestamp, in seconds, representing when this object was created. /// The Unix timestamp, in seconds, representing when this item expires. @@ -74,7 +74,7 @@ public partial class ThreadRun /// The response format of the tool calls used in this run. /// 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 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) + 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) { Argument.AssertNotNull(id, nameof(id)); Argument.AssertNotNull(threadId, nameof(threadId)); @@ -124,7 +124,7 @@ internal ThreadRun(string id, string threadId, string assistantId, RunStatus sta /// /// The overridden enabled tools used for this agent thread run. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// /// The Unix timestamp, in seconds, representing when this object was created. /// The Unix timestamp, in seconds, representing when this item expires. @@ -145,7 +145,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, TruncationObject truncationStrategy, BinaryData toolChoice, BinaryData responseFormat, IReadOnlyDictionary metadata, UpdateToolResourcesOptions toolResources, bool? parallelToolCalls, IDictionary serializedAdditionalRawData) { Id = id; Object = @object; @@ -207,7 +207,7 @@ internal ThreadRun() /// /// The overridden enabled tools used for this agent thread run. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// public IReadOnlyList Tools { get; } /// The Unix timestamp, in seconds, representing when this object was created. @@ -223,7 +223,7 @@ internal ThreadRun() /// The Unix timestamp, in seconds, representing when this failed. public DateTimeOffset? FailedAt { get; } /// Details on why the run is incomplete. Will be `null` if the run is not incomplete. - public IncompleteRunDetails? IncompleteDetails { get; } + public IncompleteRunDetails IncompleteDetails { get; } /// Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). public RunCompletionUsage Usage { get; } /// The sampling temperature used for this run. If not set, defaults to 1. diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ToolConnectionList.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ToolConnectionList.cs index f0969e099cd39..9b4fec134cef8 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ToolConnectionList.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ToolConnectionList.cs @@ -10,7 +10,7 @@ namespace Azure.AI.Projects { - /// A set of connection resources currently used by either the `bing_grounding`, `microsoft_fabric`, or `sharepoint_grounding` tools. + /// A set of connection resources currently used by either the `bing_grounding`, `fabric_aiskill`, or `sharepoint_grounding` tools. public partial class ToolConnectionList { /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.Serialization.cs index 6a49db04a1eff..9f93ac27a4655 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.Serialization.cs @@ -80,9 +80,9 @@ internal static ToolDefinition DeserializeToolDefinition(JsonElement element, Mo case "azure_ai_search": return AzureAISearchToolDefinition.DeserializeAzureAISearchToolDefinition(element, options); case "bing_grounding": return BingGroundingToolDefinition.DeserializeBingGroundingToolDefinition(element, options); case "code_interpreter": return CodeInterpreterToolDefinition.DeserializeCodeInterpreterToolDefinition(element, options); + case "fabric_aiskill": return MicrosoftFabricToolDefinition.DeserializeMicrosoftFabricToolDefinition(element, options); case "file_search": return FileSearchToolDefinition.DeserializeFileSearchToolDefinition(element, options); case "function": return FunctionToolDefinition.DeserializeFunctionToolDefinition(element, options); - case "microsoft_fabric": return MicrosoftFabricToolDefinition.DeserializeMicrosoftFabricToolDefinition(element, options); case "sharepoint_grounding": return SharepointToolDefinition.DeserializeSharepointToolDefinition(element, options); } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.cs index f55e424751739..81252e5ccbbaf 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ToolDefinition.cs @@ -13,7 +13,7 @@ namespace Azure.AI.Projects /// /// An abstract representation of an input tool definition that an agent can use. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// public abstract partial class ToolDefinition { diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ToolResources.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ToolResources.cs index 28193fd49d85d..f3bc125c78b5c 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ToolResources.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/ToolResources.cs @@ -55,7 +55,7 @@ public ToolResources() } /// Initializes a new instance of . - /// Resources to be used by the `code_interpreter tool` consisting of file IDs. + /// Resources to be used by the `code_interpreter` tool consisting of file IDs. /// Resources to be used by the `file_search` tool consisting of vector store IDs. /// Resources to be used by the `azure_ai_search` tool consisting of index IDs and names. /// Keeps track of any properties unknown to the library. @@ -67,7 +67,7 @@ internal ToolResources(CodeInterpreterToolResource codeInterpreter, FileSearchTo _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Resources to be used by the `code_interpreter tool` consisting of file IDs. + /// Resources to be used by the `code_interpreter` tool consisting of file IDs. public CodeInterpreterToolResource CodeInterpreter { get; set; } /// Resources to be used by the `file_search` tool consisting of vector store IDs. public FileSearchToolResource FileSearch { get; set; } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UpdateAgentRequest.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UpdateAgentRequest.cs index 518491348498e..da7f3ac2d4b59 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/UpdateAgentRequest.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/UpdateAgentRequest.cs @@ -60,7 +60,7 @@ internal UpdateAgentRequest() /// /// The modified collection of tools to enable for the agent. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// /// /// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, @@ -105,7 +105,7 @@ internal UpdateAgentRequest(string model, string name, string description, strin /// /// The modified collection of tools to enable for the agent. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , and . + /// The available derived classes include , , , , , and . /// public IReadOnlyList Tools { get; } /// diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSource.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSource.Serialization.cs index fa09eb23ce13e..817dc0f970563 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSource.Serialization.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSource.Serialization.cs @@ -37,7 +37,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("uri"u8); writer.WriteStringValue(AssetIdentifier); writer.WritePropertyName("type"u8); - writer.WriteStringValue(AssetType.ToSerialString()); + writer.WriteStringValue(AssetType.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -88,7 +88,7 @@ internal static VectorStoreDataSource DeserializeVectorStoreDataSource(JsonEleme } if (property.NameEquals("type"u8)) { - type = property.Value.GetString().ToVectorStoreDataSourceAssetType(); + type = new VectorStoreDataSourceAssetType(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSourceAssetType.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSourceAssetType.Serialization.cs deleted file mode 100644 index 86bb19f437697..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSourceAssetType.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.AI.Projects -{ - internal static partial class VectorStoreDataSourceAssetTypeExtensions - { - public static string ToSerialString(this VectorStoreDataSourceAssetType value) => value switch - { - VectorStoreDataSourceAssetType.UriAsset => "uri_asset", - VectorStoreDataSourceAssetType.IdAsset => "id_asset", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown VectorStoreDataSourceAssetType value.") - }; - - public static VectorStoreDataSourceAssetType ToVectorStoreDataSourceAssetType(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "uri_asset")) return VectorStoreDataSourceAssetType.UriAsset; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "id_asset")) return VectorStoreDataSourceAssetType.IdAsset; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown VectorStoreDataSourceAssetType value."); - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSourceAssetType.cs b/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSourceAssetType.cs index 29861bedb6117..8a121dac0aef3 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSourceAssetType.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreDataSourceAssetType.cs @@ -5,17 +5,50 @@ #nullable disable +using System; +using System.ComponentModel; + namespace Azure.AI.Projects { /// /// Type of vector storage asset. Asset type may be a uri_asset, in this case it should contain asset URI ID, /// in the case of id_asset it should contain the data ID. /// - public enum VectorStoreDataSourceAssetType + public readonly partial struct VectorStoreDataSourceAssetType : IEquatable { - /// uri_asset. - UriAsset, - /// id_asset. - IdAsset + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VectorStoreDataSourceAssetType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UriAssetValue = "uri_asset"; + private const string IdAssetValue = "id_asset"; + + /// Azure URI. + public static VectorStoreDataSourceAssetType UriAsset { get; } = new VectorStoreDataSourceAssetType(UriAssetValue); + /// The data ID. + public static VectorStoreDataSourceAssetType IdAsset { get; } = new VectorStoreDataSourceAssetType(IdAssetValue); + /// Determines if two values are the same. + public static bool operator ==(VectorStoreDataSourceAssetType left, VectorStoreDataSourceAssetType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VectorStoreDataSourceAssetType left, VectorStoreDataSourceAssetType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VectorStoreDataSourceAssetType(string value) => new VectorStoreDataSourceAssetType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VectorStoreDataSourceAssetType other && Equals(other); + /// + public bool Equals(VectorStoreDataSourceAssetType 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.Projects/src/Generated/VectorStoreFileError.cs b/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreFileError.cs index cd886e226df38..05eefeb612967 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreFileError.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/VectorStoreFileError.cs @@ -10,7 +10,7 @@ namespace Azure.AI.Projects { - /// Details on the error that may have ocurred while processing a file for this vector store. + /// Details on the error that may have occurred while processing a file for this vector store. public partial class VectorStoreFileError { /// diff --git a/sdk/ai/Azure.AI.Projects/tsp-location.yaml b/sdk/ai/Azure.AI.Projects/tsp-location.yaml index 3e09002b2b166..b003672683bce 100644 --- a/sdk/ai/Azure.AI.Projects/tsp-location.yaml +++ b/sdk/ai/Azure.AI.Projects/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/ai/Azure.AI.Projects -commit: a2c91a2b8411848584eda2c60d1b36d4e45b55e6 +commit: f82185fa22ee5b879726d7b3a35e98691016db5d repo: Azure/azure-rest-api-specs additionalDirectories: From 597f22b32a85821e5d0f9d37d314dbc490b63e1f Mon Sep 17 00:00:00 2001 From: Marko Hietala Date: Tue, 3 Dec 2024 09:53:34 -0600 Subject: [PATCH 2/2] ran export apis --- .../api/Azure.AI.Projects.net8.0.cs | 57 ++++++++++++++----- .../api/Azure.AI.Projects.netstandard2.0.cs | 57 ++++++++++++++----- 2 files changed, 84 insertions(+), 30 deletions(-) diff --git a/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs b/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs index 8c6e275544ff8..b1512080e2c64 100644 --- a/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs +++ b/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.net8.0.cs @@ -391,6 +391,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static Azure.AI.Projects.AgentStreamEvent ThreadRunCreated { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunExpired { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunFailed { get { throw null; } } + public static Azure.AI.Projects.AgentStreamEvent ThreadRunIncomplete { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunInProgress { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunQueued { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunRequiresAction { get { throw null; } } @@ -454,7 +455,7 @@ public static partial class AIClientModelFactory public static Azure.AI.Projects.RunStepFunctionToolCall RunStepFunctionToolCall(string id, string name, string arguments, string output) { throw null; } public static Azure.AI.Projects.SubmitToolOutputsAction SubmitToolOutputsAction(System.Collections.Generic.IEnumerable toolCalls) { throw null; } public static Azure.AI.Projects.ThreadMessage ThreadMessage(string id = null, System.DateTimeOffset createdAt = default(System.DateTimeOffset), string threadId = null, Azure.AI.Projects.MessageStatus status = default(Azure.AI.Projects.MessageStatus), Azure.AI.Projects.MessageIncompleteDetails incompleteDetails = null, System.DateTimeOffset? completedAt = default(System.DateTimeOffset?), System.DateTimeOffset? incompleteAt = default(System.DateTimeOffset?), Azure.AI.Projects.MessageRole role = default(Azure.AI.Projects.MessageRole), System.Collections.Generic.IEnumerable contentItems = null, string agentId = null, string runId = null, System.Collections.Generic.IEnumerable attachments = null, System.Collections.Generic.IDictionary metadata = null) { throw null; } - public static Azure.AI.Projects.ThreadRun ThreadRun(string id = null, string threadId = null, string agentId = null, Azure.AI.Projects.RunStatus status = default(Azure.AI.Projects.RunStatus), Azure.AI.Projects.RequiredAction requiredAction = null, Azure.AI.Projects.RunError lastError = null, string model = null, string instructions = null, System.Collections.Generic.IEnumerable tools = null, System.DateTimeOffset createdAt = default(System.DateTimeOffset), System.DateTimeOffset? expiresAt = default(System.DateTimeOffset?), System.DateTimeOffset? startedAt = default(System.DateTimeOffset?), System.DateTimeOffset? completedAt = default(System.DateTimeOffset?), System.DateTimeOffset? cancelledAt = default(System.DateTimeOffset?), System.DateTimeOffset? failedAt = default(System.DateTimeOffset?), Azure.AI.Projects.IncompleteRunDetails? incompleteDetails = default(Azure.AI.Projects.IncompleteRunDetails?), Azure.AI.Projects.RunCompletionUsage usage = null, float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? parallelToolCalls = default(bool?)) { throw null; } + public static Azure.AI.Projects.ThreadRun ThreadRun(string id = null, string threadId = null, string agentId = null, Azure.AI.Projects.RunStatus status = default(Azure.AI.Projects.RunStatus), Azure.AI.Projects.RequiredAction requiredAction = null, Azure.AI.Projects.RunError lastError = null, string model = null, string instructions = null, System.Collections.Generic.IEnumerable tools = null, System.DateTimeOffset createdAt = default(System.DateTimeOffset), System.DateTimeOffset? expiresAt = default(System.DateTimeOffset?), System.DateTimeOffset? startedAt = default(System.DateTimeOffset?), System.DateTimeOffset? completedAt = default(System.DateTimeOffset?), System.DateTimeOffset? cancelledAt = default(System.DateTimeOffset?), System.DateTimeOffset? failedAt = default(System.DateTimeOffset?), Azure.AI.Projects.IncompleteRunDetails incompleteDetails = null, Azure.AI.Projects.RunCompletionUsage usage = null, float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? parallelToolCalls = default(bool?)) { throw null; } } public partial class AIProjectClient { @@ -490,6 +491,7 @@ public static partial class AIProjectsModelFactory public static Azure.AI.Projects.Evaluation Evaluation(string id = null, Azure.AI.Projects.InputData data = null, string displayName = null, string description = null, Azure.AI.Projects.SystemData systemData = null, string status = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary evaluators = null) { throw null; } public static Azure.AI.Projects.EvaluationSchedule EvaluationSchedule(string name = null, Azure.AI.Projects.ApplicationInsightsConfiguration data = null, string description = null, Azure.AI.Projects.SystemData systemData = null, string provisioningState = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, string isEnabled = null, System.Collections.Generic.IDictionary evaluators = null, Azure.AI.Projects.Trigger trigger = null) { throw null; } public static Azure.AI.Projects.GetWorkspaceResponse GetWorkspaceResponse(string id = null, string name = null, Azure.AI.Projects.WorkspaceProperties properties = null) { throw null; } + public static Azure.AI.Projects.IncompleteRunDetails IncompleteRunDetails(Azure.AI.Projects.IncompleteDetailsReason reason = default(Azure.AI.Projects.IncompleteDetailsReason)) { throw null; } public static Azure.AI.Projects.ListConnectionsResponse ListConnectionsResponse(System.Collections.Generic.IEnumerable value = null) { throw null; } public static Azure.AI.Projects.MessageDelta MessageDelta(Azure.AI.Projects.MessageRole role = default(Azure.AI.Projects.MessageRole), System.Collections.Generic.IEnumerable content = null) { throw null; } public static Azure.AI.Projects.MessageDeltaChunk MessageDeltaChunk(string id = null, Azure.AI.Projects.MessageDeltaChunkObject @object = default(Azure.AI.Projects.MessageDeltaChunkObject), Azure.AI.Projects.MessageDelta delta = null) { throw null; } @@ -1011,23 +1013,34 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct IncompleteRunDetails : System.IEquatable + public readonly partial struct IncompleteDetailsReason : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public IncompleteRunDetails(string value) { throw null; } - public static Azure.AI.Projects.IncompleteRunDetails MaxCompletionTokens { get { throw null; } } - public static Azure.AI.Projects.IncompleteRunDetails MaxPromptTokens { get { throw null; } } - public bool Equals(Azure.AI.Projects.IncompleteRunDetails other) { throw null; } + public IncompleteDetailsReason(string value) { throw null; } + public static Azure.AI.Projects.IncompleteDetailsReason MaxCompletionTokens { get { throw null; } } + public static Azure.AI.Projects.IncompleteDetailsReason MaxPromptTokens { get { throw null; } } + public bool Equals(Azure.AI.Projects.IncompleteDetailsReason other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.Projects.IncompleteRunDetails left, Azure.AI.Projects.IncompleteRunDetails right) { throw null; } - public static implicit operator Azure.AI.Projects.IncompleteRunDetails (string value) { throw null; } - public static bool operator !=(Azure.AI.Projects.IncompleteRunDetails left, Azure.AI.Projects.IncompleteRunDetails right) { throw null; } + public static bool operator ==(Azure.AI.Projects.IncompleteDetailsReason left, Azure.AI.Projects.IncompleteDetailsReason right) { throw null; } + public static implicit operator Azure.AI.Projects.IncompleteDetailsReason (string value) { throw null; } + public static bool operator !=(Azure.AI.Projects.IncompleteDetailsReason left, Azure.AI.Projects.IncompleteDetailsReason right) { throw null; } public override string ToString() { throw null; } } + public partial class IncompleteRunDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal IncompleteRunDetails() { } + public Azure.AI.Projects.IncompleteDetailsReason Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.IncompleteRunDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.IncompleteRunDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class IndexResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public IndexResource(string indexConnectionId, string indexName) { } @@ -1430,8 +1443,8 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write } public partial class MicrosoftFabricToolDefinition : Azure.AI.Projects.ToolDefinition, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public MicrosoftFabricToolDefinition(Azure.AI.Projects.ToolConnectionList microsoftFabric) { } - public Azure.AI.Projects.ToolConnectionList MicrosoftFabric { get { throw null; } set { } } + public MicrosoftFabricToolDefinition(Azure.AI.Projects.ToolConnectionList fabricAiskill) { } + public Azure.AI.Projects.ToolConnectionList FabricAiskill { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Projects.MicrosoftFabricToolDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -2102,6 +2115,7 @@ internal RunStepUpdate() { } public static Azure.AI.Projects.RunStreamEvent ThreadRunCreated { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunExpired { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunFailed { get { throw null; } } + public static Azure.AI.Projects.RunStreamEvent ThreadRunIncomplete { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunInProgress { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunQueued { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunRequiresAction { get { throw null; } } @@ -2261,7 +2275,7 @@ internal ThreadRun() { } public System.DateTimeOffset? ExpiresAt { get { throw null; } } public System.DateTimeOffset? FailedAt { get { throw null; } } public string Id { get { throw null; } } - public Azure.AI.Projects.IncompleteRunDetails? IncompleteDetails { get { throw null; } } + public Azure.AI.Projects.IncompleteRunDetails IncompleteDetails { get { throw null; } } public string Instructions { get { throw null; } } public Azure.AI.Projects.RunError LastError { get { throw null; } } public int? MaxCompletionTokens { get { throw null; } } @@ -2546,10 +2560,23 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public enum VectorStoreDataSourceAssetType + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VectorStoreDataSourceAssetType : System.IEquatable { - UriAsset = 0, - IdAsset = 1, + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VectorStoreDataSourceAssetType(string value) { throw null; } + public static Azure.AI.Projects.VectorStoreDataSourceAssetType IdAsset { get { throw null; } } + public static Azure.AI.Projects.VectorStoreDataSourceAssetType UriAsset { get { throw null; } } + public bool Equals(Azure.AI.Projects.VectorStoreDataSourceAssetType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.AI.Projects.VectorStoreDataSourceAssetType left, Azure.AI.Projects.VectorStoreDataSourceAssetType right) { throw null; } + public static implicit operator Azure.AI.Projects.VectorStoreDataSourceAssetType (string value) { throw null; } + public static bool operator !=(Azure.AI.Projects.VectorStoreDataSourceAssetType left, Azure.AI.Projects.VectorStoreDataSourceAssetType right) { throw null; } + public override string ToString() { throw null; } } public partial class VectorStoreDeletionStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { diff --git a/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs b/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs index 8c6e275544ff8..b1512080e2c64 100644 --- a/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs +++ b/sdk/ai/Azure.AI.Projects/api/Azure.AI.Projects.netstandard2.0.cs @@ -391,6 +391,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static Azure.AI.Projects.AgentStreamEvent ThreadRunCreated { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunExpired { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunFailed { get { throw null; } } + public static Azure.AI.Projects.AgentStreamEvent ThreadRunIncomplete { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunInProgress { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunQueued { get { throw null; } } public static Azure.AI.Projects.AgentStreamEvent ThreadRunRequiresAction { get { throw null; } } @@ -454,7 +455,7 @@ public static partial class AIClientModelFactory public static Azure.AI.Projects.RunStepFunctionToolCall RunStepFunctionToolCall(string id, string name, string arguments, string output) { throw null; } public static Azure.AI.Projects.SubmitToolOutputsAction SubmitToolOutputsAction(System.Collections.Generic.IEnumerable toolCalls) { throw null; } public static Azure.AI.Projects.ThreadMessage ThreadMessage(string id = null, System.DateTimeOffset createdAt = default(System.DateTimeOffset), string threadId = null, Azure.AI.Projects.MessageStatus status = default(Azure.AI.Projects.MessageStatus), Azure.AI.Projects.MessageIncompleteDetails incompleteDetails = null, System.DateTimeOffset? completedAt = default(System.DateTimeOffset?), System.DateTimeOffset? incompleteAt = default(System.DateTimeOffset?), Azure.AI.Projects.MessageRole role = default(Azure.AI.Projects.MessageRole), System.Collections.Generic.IEnumerable contentItems = null, string agentId = null, string runId = null, System.Collections.Generic.IEnumerable attachments = null, System.Collections.Generic.IDictionary metadata = null) { throw null; } - public static Azure.AI.Projects.ThreadRun ThreadRun(string id = null, string threadId = null, string agentId = null, Azure.AI.Projects.RunStatus status = default(Azure.AI.Projects.RunStatus), Azure.AI.Projects.RequiredAction requiredAction = null, Azure.AI.Projects.RunError lastError = null, string model = null, string instructions = null, System.Collections.Generic.IEnumerable tools = null, System.DateTimeOffset createdAt = default(System.DateTimeOffset), System.DateTimeOffset? expiresAt = default(System.DateTimeOffset?), System.DateTimeOffset? startedAt = default(System.DateTimeOffset?), System.DateTimeOffset? completedAt = default(System.DateTimeOffset?), System.DateTimeOffset? cancelledAt = default(System.DateTimeOffset?), System.DateTimeOffset? failedAt = default(System.DateTimeOffset?), Azure.AI.Projects.IncompleteRunDetails? incompleteDetails = default(Azure.AI.Projects.IncompleteRunDetails?), Azure.AI.Projects.RunCompletionUsage usage = null, float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? parallelToolCalls = default(bool?)) { throw null; } + public static Azure.AI.Projects.ThreadRun ThreadRun(string id = null, string threadId = null, string agentId = null, Azure.AI.Projects.RunStatus status = default(Azure.AI.Projects.RunStatus), Azure.AI.Projects.RequiredAction requiredAction = null, Azure.AI.Projects.RunError lastError = null, string model = null, string instructions = null, System.Collections.Generic.IEnumerable tools = null, System.DateTimeOffset createdAt = default(System.DateTimeOffset), System.DateTimeOffset? expiresAt = default(System.DateTimeOffset?), System.DateTimeOffset? startedAt = default(System.DateTimeOffset?), System.DateTimeOffset? completedAt = default(System.DateTimeOffset?), System.DateTimeOffset? cancelledAt = default(System.DateTimeOffset?), System.DateTimeOffset? failedAt = default(System.DateTimeOffset?), Azure.AI.Projects.IncompleteRunDetails incompleteDetails = null, Azure.AI.Projects.RunCompletionUsage usage = null, float? temperature = default(float?), float? topP = default(float?), int? maxPromptTokens = default(int?), int? maxCompletionTokens = default(int?), Azure.AI.Projects.TruncationObject truncationStrategy = null, System.BinaryData toolChoice = null, System.BinaryData responseFormat = null, System.Collections.Generic.IReadOnlyDictionary metadata = null, Azure.AI.Projects.UpdateToolResourcesOptions toolResources = null, bool? parallelToolCalls = default(bool?)) { throw null; } } public partial class AIProjectClient { @@ -490,6 +491,7 @@ public static partial class AIProjectsModelFactory public static Azure.AI.Projects.Evaluation Evaluation(string id = null, Azure.AI.Projects.InputData data = null, string displayName = null, string description = null, Azure.AI.Projects.SystemData systemData = null, string status = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary evaluators = null) { throw null; } public static Azure.AI.Projects.EvaluationSchedule EvaluationSchedule(string name = null, Azure.AI.Projects.ApplicationInsightsConfiguration data = null, string description = null, Azure.AI.Projects.SystemData systemData = null, string provisioningState = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, string isEnabled = null, System.Collections.Generic.IDictionary evaluators = null, Azure.AI.Projects.Trigger trigger = null) { throw null; } public static Azure.AI.Projects.GetWorkspaceResponse GetWorkspaceResponse(string id = null, string name = null, Azure.AI.Projects.WorkspaceProperties properties = null) { throw null; } + public static Azure.AI.Projects.IncompleteRunDetails IncompleteRunDetails(Azure.AI.Projects.IncompleteDetailsReason reason = default(Azure.AI.Projects.IncompleteDetailsReason)) { throw null; } public static Azure.AI.Projects.ListConnectionsResponse ListConnectionsResponse(System.Collections.Generic.IEnumerable value = null) { throw null; } public static Azure.AI.Projects.MessageDelta MessageDelta(Azure.AI.Projects.MessageRole role = default(Azure.AI.Projects.MessageRole), System.Collections.Generic.IEnumerable content = null) { throw null; } public static Azure.AI.Projects.MessageDeltaChunk MessageDeltaChunk(string id = null, Azure.AI.Projects.MessageDeltaChunkObject @object = default(Azure.AI.Projects.MessageDeltaChunkObject), Azure.AI.Projects.MessageDelta delta = null) { throw null; } @@ -1011,23 +1013,34 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct IncompleteRunDetails : System.IEquatable + public readonly partial struct IncompleteDetailsReason : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public IncompleteRunDetails(string value) { throw null; } - public static Azure.AI.Projects.IncompleteRunDetails MaxCompletionTokens { get { throw null; } } - public static Azure.AI.Projects.IncompleteRunDetails MaxPromptTokens { get { throw null; } } - public bool Equals(Azure.AI.Projects.IncompleteRunDetails other) { throw null; } + public IncompleteDetailsReason(string value) { throw null; } + public static Azure.AI.Projects.IncompleteDetailsReason MaxCompletionTokens { get { throw null; } } + public static Azure.AI.Projects.IncompleteDetailsReason MaxPromptTokens { get { throw null; } } + public bool Equals(Azure.AI.Projects.IncompleteDetailsReason other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.AI.Projects.IncompleteRunDetails left, Azure.AI.Projects.IncompleteRunDetails right) { throw null; } - public static implicit operator Azure.AI.Projects.IncompleteRunDetails (string value) { throw null; } - public static bool operator !=(Azure.AI.Projects.IncompleteRunDetails left, Azure.AI.Projects.IncompleteRunDetails right) { throw null; } + public static bool operator ==(Azure.AI.Projects.IncompleteDetailsReason left, Azure.AI.Projects.IncompleteDetailsReason right) { throw null; } + public static implicit operator Azure.AI.Projects.IncompleteDetailsReason (string value) { throw null; } + public static bool operator !=(Azure.AI.Projects.IncompleteDetailsReason left, Azure.AI.Projects.IncompleteDetailsReason right) { throw null; } public override string ToString() { throw null; } } + public partial class IncompleteRunDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal IncompleteRunDetails() { } + public Azure.AI.Projects.IncompleteDetailsReason Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.IncompleteRunDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.AI.Projects.IncompleteRunDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class IndexResource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public IndexResource(string indexConnectionId, string indexName) { } @@ -1430,8 +1443,8 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write } public partial class MicrosoftFabricToolDefinition : Azure.AI.Projects.ToolDefinition, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public MicrosoftFabricToolDefinition(Azure.AI.Projects.ToolConnectionList microsoftFabric) { } - public Azure.AI.Projects.ToolConnectionList MicrosoftFabric { get { throw null; } set { } } + public MicrosoftFabricToolDefinition(Azure.AI.Projects.ToolConnectionList fabricAiskill) { } + public Azure.AI.Projects.ToolConnectionList FabricAiskill { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.AI.Projects.MicrosoftFabricToolDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -2102,6 +2115,7 @@ internal RunStepUpdate() { } public static Azure.AI.Projects.RunStreamEvent ThreadRunCreated { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunExpired { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunFailed { get { throw null; } } + public static Azure.AI.Projects.RunStreamEvent ThreadRunIncomplete { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunInProgress { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunQueued { get { throw null; } } public static Azure.AI.Projects.RunStreamEvent ThreadRunRequiresAction { get { throw null; } } @@ -2261,7 +2275,7 @@ internal ThreadRun() { } public System.DateTimeOffset? ExpiresAt { get { throw null; } } public System.DateTimeOffset? FailedAt { get { throw null; } } public string Id { get { throw null; } } - public Azure.AI.Projects.IncompleteRunDetails? IncompleteDetails { get { throw null; } } + public Azure.AI.Projects.IncompleteRunDetails IncompleteDetails { get { throw null; } } public string Instructions { get { throw null; } } public Azure.AI.Projects.RunError LastError { get { throw null; } } public int? MaxCompletionTokens { get { throw null; } } @@ -2546,10 +2560,23 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public enum VectorStoreDataSourceAssetType + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VectorStoreDataSourceAssetType : System.IEquatable { - UriAsset = 0, - IdAsset = 1, + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VectorStoreDataSourceAssetType(string value) { throw null; } + public static Azure.AI.Projects.VectorStoreDataSourceAssetType IdAsset { get { throw null; } } + public static Azure.AI.Projects.VectorStoreDataSourceAssetType UriAsset { get { throw null; } } + public bool Equals(Azure.AI.Projects.VectorStoreDataSourceAssetType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.AI.Projects.VectorStoreDataSourceAssetType left, Azure.AI.Projects.VectorStoreDataSourceAssetType right) { throw null; } + public static implicit operator Azure.AI.Projects.VectorStoreDataSourceAssetType (string value) { throw null; } + public static bool operator !=(Azure.AI.Projects.VectorStoreDataSourceAssetType left, Azure.AI.Projects.VectorStoreDataSourceAssetType right) { throw null; } + public override string ToString() { throw null; } } public partial class VectorStoreDeletionStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel {